nix: use flake instead of shell

This commit is contained in:
Dmitriy Pleshevskiy 2022-06-08 18:45:11 +03:00
parent a433adf48d
commit 21de7f5f18
Signed by: pleshevskiy
GPG Key ID: 1B59187B161C0215
5 changed files with 135 additions and 4 deletions

57
flake.lock Normal file
View File

@ -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
}

14
flake.nix Normal file
View File

@ -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 .#<name>`
devShells.x86_64-linux.web = self.devShell.x86_64-linux;
};
}

43
web/flake.lock Normal file
View File

@ -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
}

21
web/flake.nix Normal file
View File

@ -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;
}

View File

@ -1,4 +0,0 @@
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
nativeBuildInputs = [ pkgs.nodePackages.sass ];
}