-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage.nix
More file actions
52 lines (49 loc) · 1.05 KB
/
package.nix
File metadata and controls
52 lines (49 loc) · 1.05 KB
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
{
lib,
newScope,
riscv-opcodes-src,
pokedex-configs-src,
}:
let
mkScope =
parentScope: builder:
with lib;
builtins.readDir pokedex-configs-src
|> filterAttrs (k: v: hasSuffix ".toml" k && v == "regular")
|> mapAttrs' (
fp: _:
nameValuePair (removeSuffix ".toml" fp) (
lib.makeScope parentScope (
scope:
builder rec {
inherit scope;
configsPath = "${pokedex-configs-src}/${fp}";
configs = importTOML configsPath;
}
)
)
);
in
lib.makeScope newScope (
scope:
{
# Simulator needs no comptime ISA
simulator = scope.callPackage ./simulator/package.nix { };
}
// mkScope scope.newScope (
{
configs,
configsPath,
scope,
}:
{
inherit riscv-opcodes-src;
pokedex-configs = configs // {
src = configsPath;
};
model = scope.callPackage ./model/package.nix { };
tests = scope.callPackage ./tests { };
docs = scope.callPackage ./docs/package.nix { };
}
)
)