-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathflake.nix
More file actions
77 lines (76 loc) · 2.21 KB
/
flake.nix
File metadata and controls
77 lines (76 loc) · 2.21 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
crane.url = "github:ipetkov/crane";
};
outputs =
inputs@{
flake-parts,
crane,
nixpkgs,
...
}:
flake-parts.lib.mkFlake { inherit inputs; } (
{ withSystem, flake-parts-lib, ... }:
let
inherit (flake-parts-lib) importApply;
tracexec.default = importApply ./nix/tracexec.nix { inherit crane; };
ukci.default = importApply ./nix/ukci.nix { inherit nixpkgs; inherit crane; };
in
{
imports = [
tracexec.default
ukci.default
];
flake = { };
systems = [
"x86_64-linux"
"aarch64-linux"
"riscv64-linux"
];
perSystem =
{
self',
config,
lib,
pkgs,
system,
...
}:
let
defaultShell = pkgs.mkShell {
name = "Development Shell";
packages = with pkgs; [
strace
nixpkgs-fmt
self'.packages.ukci
self'.packages.run-qemu
self'.packages.test-qemu
];
shellHook = ''export TRACEXEC_LOGLEVEL=debug'';
};
in
{
packages.default = self'.packages.tracexec;
devShells.default = defaultShell;
devShells.extended = pkgs.mkShell {
inputsFrom = [ defaultShell ];
packages = lib.optionals (system != "aarch64-linux") [
self'.packages.ukci-aarch64
self'.packages.run-qemu-aarch64
self'.packages.test-qemu-aarch64
] ++ lib.optionals (system != "x86_64-linux") [
self'.packages.ukci-x86_64
self'.packages.run-qemu-x86_64
self'.packages.test-qemu-x86_64
] ++ lib.optionals (system != "riscv64-linux") [
self'.packages.ukci-riscv64
self'.packages.run-qemu-riscv64
self'.packages.test-qemu-riscv64
];
};
};
}
);
}