nix flake init
This commit is contained in:
parent
0856a89c18
commit
cdf3887f53
2 changed files with 111 additions and 0 deletions
43
flake.lock
generated
Normal file
43
flake.lock
generated
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1773375660,
|
||||
"narHash": "sha256-SEzUWw2Rf5Ki3bcM26nSKgbeoqi2uYy8IHVBqOKjX3w=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "3e20095fe3c6cbb1ddcef89b26969a69a1570776",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-25.11",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs",
|
||||
"systems": "systems"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
68
flake.nix
Normal file
68
flake.nix
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
{
|
||||
description = "age encrypted secrets vault for Nix flakes";
|
||||
|
||||
inputs = {
|
||||
systems.url = "github:nix-systems/default";
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
...
|
||||
} @ inputs: let
|
||||
systems = import inputs.systems;
|
||||
|
||||
mkPkgs = system: repo:
|
||||
import repo {
|
||||
inherit system;
|
||||
allowUnfree = false;
|
||||
allowBroken = false;
|
||||
overlays = builtins.attrValues self.overlays or {};
|
||||
};
|
||||
|
||||
forAllSystems = f:
|
||||
nixpkgs.lib.genAttrs systems (system:
|
||||
f rec {
|
||||
inherit system;
|
||||
inherit (pkgs) lib;
|
||||
pkgs = mkPkgs system nixpkgs;
|
||||
});
|
||||
in {
|
||||
devShells = forAllSystems (
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
default = pkgs.mkShell rec {
|
||||
name = "vaultage";
|
||||
shell = "${pkgs.bash}/bin/bash";
|
||||
|
||||
# packages we need at runtime
|
||||
packages = with pkgs; [
|
||||
rustc
|
||||
cargo
|
||||
cargo-mommy
|
||||
|
||||
rust-analyzer-unwrapped
|
||||
(rustfmt.override {asNightly = true;})
|
||||
clippy
|
||||
taplo
|
||||
];
|
||||
|
||||
# packages we need at build time
|
||||
nativeBuildInputs = with pkgs; [
|
||||
rustPlatform.bindgenHook
|
||||
pkg-config
|
||||
];
|
||||
|
||||
# packages we link against
|
||||
buildInputs = [];
|
||||
|
||||
env.LD_LIBRARY_PATH = builtins.toString (lib.makeLibraryPath buildInputs);
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue