mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-12-02 13:06:11 +01:00
0e7389fcbd
Signed-off-by: magic_rb <magic_rb@redalder.org>
113 lines
2.2 KiB
Nix
113 lines
2.2 KiB
Nix
{
|
|
inputs,
|
|
lib,
|
|
self,
|
|
...
|
|
}: let
|
|
inherit
|
|
(lib)
|
|
singleton
|
|
concatMap
|
|
mkDefault
|
|
mkImageMediaOverride
|
|
;
|
|
in {
|
|
flake.nixosConfigurations.hela = inputs.nixpkgs-stable.lib.nixosSystem {
|
|
system = "x86_64-linux";
|
|
modules =
|
|
singleton
|
|
(import ./hela.nix);
|
|
specialArgs = {
|
|
inputs' = inputs;
|
|
};
|
|
};
|
|
|
|
flake.nixosConfigurations."jörmungandr" = inputs.nixpkgs-stable.lib.nixosSystem {
|
|
system = "x86_64-linux";
|
|
modules =
|
|
singleton
|
|
(import ./jormungandr.nix);
|
|
specialArgs = {
|
|
inputs' = inputs;
|
|
};
|
|
};
|
|
|
|
flake.nixosConfigurations.client = inputs.nixpkgs-stable.lib.nixosSystem {
|
|
system = "x86_64-linux";
|
|
modules =
|
|
singleton
|
|
(import ./client.nix);
|
|
specialArgs = {
|
|
inputs' = inputs;
|
|
};
|
|
};
|
|
|
|
perSystem = {
|
|
lib,
|
|
pkgs,
|
|
system,
|
|
...
|
|
}: {
|
|
checks.router = pkgs.stdenv.mkDerivation {
|
|
name = "router";
|
|
phases = [
|
|
"runPhase"
|
|
];
|
|
|
|
env = {
|
|
HELA_SYSTEM =
|
|
(self.nixosConfigurations.hela.extendModules {
|
|
modules = [
|
|
"${pkgs.path}/nixos/modules/testing/test-instrumentation.nix"
|
|
];
|
|
})
|
|
.config
|
|
.system
|
|
.build
|
|
.vm;
|
|
|
|
CLIENT_SYSTEM =
|
|
(self.nixosConfigurations.client.extendModules {
|
|
modules = [
|
|
"${pkgs.path}/nixos/modules/testing/test-instrumentation.nix"
|
|
];
|
|
})
|
|
.config
|
|
.system
|
|
.build
|
|
.vm;
|
|
|
|
JORMUNGANDR_SYSTEM =
|
|
(self.nixosConfigurations."jörmungandr".extendModules {
|
|
modules = [
|
|
"${pkgs.path}/nixos/modules/testing/test-instrumentation.nix"
|
|
];
|
|
})
|
|
.config
|
|
.system
|
|
.build
|
|
.vm;
|
|
};
|
|
|
|
nativeBuildInputs = with pkgs; [
|
|
iproute2
|
|
vde2
|
|
socat
|
|
(python3.withPackages (ps:
|
|
with ps; [
|
|
ptpython
|
|
colorama
|
|
junit-xml
|
|
]))
|
|
];
|
|
|
|
runPhase = ''
|
|
PYTHONPATH=${pkgs.path}/nixos/lib/test-driver python ${../router.py}
|
|
|
|
mkdir -p $out
|
|
touch $out/success
|
|
'';
|
|
};
|
|
};
|
|
}
|