-
Notifications
You must be signed in to change notification settings - Fork 2
/
flake.nix
64 lines (56 loc) · 1.55 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
59
60
61
62
63
64
{
description = "A recursive blake2 digest (hash) of a file-system path";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
flake-utils.url = "github:numtide/flake-utils";
flakebox = {
url = "github:rustshop/flakebox?rev=00baca64cf47f00dceb6782bcbbc37307fdb51fd";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, flake-utils, flakebox }:
flake-utils.lib.eachDefaultSystem (system:
let
projectName = "rblake2sum";
flakeboxLib = flakebox.lib.${system} {
config = {
github.ci.buildOutputs = [ ".#ci.rblake2sum" ];
typos.pre-commit.enable = false;
};
};
buildPaths = [
"Cargo.toml"
"Cargo.lock"
".cargo"
"src"
];
buildSrc = flakeboxLib.filterSubPaths {
root = builtins.path {
name = projectName;
path = ./.;
};
paths = buildPaths;
};
multiBuild =
(flakeboxLib.craneMultiBuild { }) (craneLib':
let
craneLib = (craneLib'.overrideArgs {
pname = "flexbox-multibuild";
src = buildSrc;
});
in
{
rblake2sum = craneLib.buildPackage { };
});
in
{
packages.default = multiBuild.rblake2sum;
legacyPackages = multiBuild;
devShells = {
default = flakeboxLib.mkDevShell {
packages = [ ];
};
};
}
);
}