-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathflake.nix
More file actions
98 lines (96 loc) · 2.83 KB
/
flake.nix
File metadata and controls
98 lines (96 loc) · 2.83 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
crane.url = "github:ipetkov/crane";
treefmt-nix.url = "github:numtide/treefmt-nix";
flake-root.url = "github:srid/flake-root";
};
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
inputs.treefmt-nix.flakeModule
inputs.flake-root.flakeModule
];
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
nixfmt
statix
config.treefmt.build.wrapper
self'.packages.ukci
self'.packages.run-qemu
self'.packages.test-qemu
]
++ builtins.attrValues config.treefmt.build.programs;
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
];
};
treefmt.config = {
inherit (config.flake-root) projectRootFile;
# formats .nix files
programs.nixfmt.enable = true;
};
};
}
);
}