add nix flake

Signed-off-by: Nicolas Froger <nicolas@kektus.xyz>
This commit is contained in:
Nicolas Froger 2022-08-15 23:33:26 +02:00
parent 7e57bd218f
commit dd808711ce
Signed by: nicolas
GPG Key ID: 461D87623FDF1E47
3 changed files with 82 additions and 0 deletions

7
.envrc Normal file
View File

@ -0,0 +1,7 @@
use_configsh() {
watch_file config.sh
eval "$(cat config.sh)"
}
use_flake
use_configsh

43
flake.lock Normal file
View File

@ -0,0 +1,43 @@
{
"nodes": {
"futils": {
"locked": {
"lastModified": 1656928814,
"narHash": "sha256-RIFfgBuKz6Hp89yRr7+NR5tzIAbn52h8vT6vXkYjZoM=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "7e2a3b3dfd9af950a856d66b0a7d01e3c18aa249",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1659526864,
"narHash": "sha256-XFzXrc1+6DZb9hBgHfEzfwylPUSqVFJbQPs8eOgYufU=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "478f3cbc8448b5852539d785fbfe9a53304133be",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-22.05",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"futils": "futils",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

32
flake.nix Normal file
View File

@ -0,0 +1,32 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-22.05";
futils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, futils } @ inputs:
let
inherit (nixpkgs) lib;
inherit (lib) recursiveUpdate;
inherit (futils.lib) eachDefaultSystem;
nixpkgsImport = system:
import nixpkgs {
inherit system;
};
defaultSystemOutputs = eachDefaultSystem (system:
let
pkgs = nixpkgsImport system;
in
{
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
git
go
];
};
});
in
defaultSystemOutputs;
}