-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
58 lines (55 loc) · 1.37 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{
description = "A password manager";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};
nixConfig = {
extra-substituters = [ "https://henrytill.cachix.org" ];
extra-trusted-public-keys = [
"henrytill.cachix.org-1:EOoUIk8e9627viyFmT6mfqghh/xtfnpzEtqT4jnyn1M="
];
};
outputs =
{
self,
nixpkgs,
flake-utils,
...
}:
let
makeAnanke =
pkgs:
pkgs.rustPlatform.buildRustPackage {
name = "ananke";
pname = "ananke";
cargoLock = {
lockFile = ./Cargo.lock;
};
buildInputs = with pkgs; [ sqlite ];
nativeCheckInputs = with pkgs; [ gnupg ];
src = builtins.path {
path = ./.;
name = "ananke-src";
};
env = {
ANANKE_COMMIT_HASH = "${self.rev or self.dirtyRev}";
ANANKE_COMMIT_SHORT_HASH = "${self.shortRev or self.dirtyShortRev}";
};
};
in
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
packages.ananke = makeAnanke pkgs;
packages.default = self.packages.${system}.ananke;
}
);
}