From 21de7f5f184c7e4ce6d389ce23c38c65a8318c8b Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Wed, 8 Jun 2022 18:45:11 +0300 Subject: [PATCH] nix: use flake instead of shell --- flake.lock | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 14 +++++++++++++ web/flake.lock | 43 +++++++++++++++++++++++++++++++++++++ web/flake.nix | 21 +++++++++++++++++++ web/shell.nix | 4 ---- 5 files changed, 135 insertions(+), 4 deletions(-) create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 web/flake.lock create mode 100644 web/flake.nix delete mode 100644 web/shell.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..6eb4d95 --- /dev/null +++ b/flake.lock @@ -0,0 +1,57 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1654593855, + "narHash": "sha256-c+SyXvj7THre87OyIdZfRVR+HhI/g1ZDrQ3VUtTuHkU=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "033bd4fa9a8fbe0c68a88e925d9a884161044b25", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "recipes_web": { + "inputs": { + "nixpkgs": "nixpkgs", + "utils": "utils" + }, + "locked": { + "narHash": "sha256-vsut9l2923W62VpZ6FqYn65wEbhfS3KmRUjPtoXJM0c=", + "path": "/nix/store/qdpl5cgjk15nrisgw48jq2n3m5khbzlf-source/web", + "type": "path" + }, + "original": { + "path": "/nix/store/qdpl5cgjk15nrisgw48jq2n3m5khbzlf-source/web", + "type": "path" + } + }, + "root": { + "inputs": { + "recipes_web": "recipes_web" + } + }, + "utils": { + "locked": { + "lastModified": 1653893745, + "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..7cc0c03 --- /dev/null +++ b/flake.nix @@ -0,0 +1,14 @@ +{ + description = "Recipes flake"; + + inputs.recipes_web.url = "./web"; + + outputs = { self, recipes_web }: { + + # Utilized by `nix develop` + devShell.x86_64-linux = recipes_web.devShell.x86_64-linux; + + # Utilized by `nix develop .#` + devShells.x86_64-linux.web = self.devShell.x86_64-linux; + }; +} diff --git a/web/flake.lock b/web/flake.lock new file mode 100644 index 0000000..3660fb7 --- /dev/null +++ b/web/flake.lock @@ -0,0 +1,43 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1654593855, + "narHash": "sha256-c+SyXvj7THre87OyIdZfRVR+HhI/g1ZDrQ3VUtTuHkU=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "033bd4fa9a8fbe0c68a88e925d9a884161044b25", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "utils": "utils" + } + }, + "utils": { + "locked": { + "lastModified": 1653893745, + "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/web/flake.nix b/web/flake.nix new file mode 100644 index 0000000..b3dd4ec --- /dev/null +++ b/web/flake.nix @@ -0,0 +1,21 @@ +{ + description = "Recipes web"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + utils.url = "github:numtide/flake-utils"; + }; + + outputs = {self, nixpkgs, utils}: + let out = system: + let pkgs = nixpkgs.legacyPackages."${system}"; + in { + devShell = pkgs.mkShell { + buildInputs = with pkgs; [ + nodePackages.sass + ]; + }; + }; + in with utils.lib; eachSystem defaultSystems out; + +} diff --git a/web/shell.nix b/web/shell.nix deleted file mode 100644 index 5700296..0000000 --- a/web/shell.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ pkgs ? import {} }: - pkgs.mkShell { - nativeBuildInputs = [ pkgs.nodePackages.sass ]; -}