-
Notifications
You must be signed in to change notification settings - Fork 0
/
overlay.nix
41 lines (35 loc) · 998 Bytes
/
overlay.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
{ inputs
, final
, prev
}:
with final;
let
rustToolchain = rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
craneLib = (inputs.crane.mkLib final).overrideToolchain rustToolchain;
sourceCode = lib.cleanSourceWith {
src = inputs.self;
filter = path: type:
(baseNameOf path == "justfile")
|| (lib.hasSuffix ".s" path)
|| (lib.hasSuffix ".ld" path)
|| (craneLib.filterCargoSources path type);
};
version =
let
year = lib.substring 0 4 inputs.self.lastModifiedDate;
month = lib.substring 4 2 inputs.self.lastModifiedDate;
day = lib.substring 6 2 inputs.self.lastModifiedDate;
in
"0.pre+date=${year}-${month}-${day}";
in
{
zebraPackages = recurseIntoAttrs {
inherit rustToolchain;
zebra-kernel = callPackage ./kernel {
inherit sourceCode version craneLib;
inherit (zebraPackages) zebra-kernel;
};
zebra-runner = zebraPackages.zebra-kernel.runner;
docs = callPackage ./docs { };
};
}