this repo has no description
1{
2 inputs = {
3 nixpkgs = {
4 url = "github:nixos/nixpkgs/nixos-25.05";
5 };
6 disko = {
7 url = "github:nix-community/disko";
8 inputs.nixpkgs.follows = "nixpkgs";
9 };
10 nixie = {
11 # TODO change this to a remote URL if you're building a custom installer
12 # url = "github:khuedoan/nixie";
13 url = "path:..";
14 };
15 };
16
17 outputs =
18 {
19 self,
20 nixpkgs,
21 disko,
22 nixie,
23 }:
24 let
25 linuxSystem = "x86_64-linux";
26 hostSystems = [
27 "x86_64-linux"
28 "x86_64-darwin"
29 "aarch64-darwin"
30 ];
31
32 e2eModule = "${nixie.outPath}/tests/e2e/module.nix";
33 e2eRunnerFor =
34 system:
35 let
36 pkgs = import nixpkgs { inherit system; };
37 in
38 if system == linuxSystem then
39 pkgs.writeShellApplication {
40 name = "nixie-e2e";
41 runtimeInputs = with pkgs; [
42 dnsmasq
43 iproute2
44 nix
45 nixos-anywhere
46 openssh
47 OVMF.fd
48 python3
49 qemu_kvm
50 tcpdump
51 ];
52 text = ''
53 export EXAMPLES_FLAKE="${self.outPath}"
54 export NIXIE_BIN="${nixie.packages.${linuxSystem}.default}/bin/nixie"
55 export NIXIE_REPO="${nixie.outPath}"
56 export OVMF_CODE="${pkgs.OVMF.fd}/FV/OVMF_CODE.fd"
57 export OVMF_VARS="${pkgs.OVMF.fd}/FV/OVMF_VARS.fd"
58 exec python3 "${nixie.outPath}/tests/e2e/run.py" "$@"
59 '';
60 }
61 else
62 pkgs.writeShellApplication {
63 name = "nixie-e2e";
64 text = ''
65 echo "The nixie e2e harness currently requires a Linux host with root access."
66 echo "Run nix run ./examples#e2e on a Linux machine to execute it."
67 exit 1
68 '';
69 };
70
71 mkInstalledMachine =
72 hostName: extraModules:
73 nixpkgs.lib.nixosSystem {
74 system = linuxSystem;
75 modules = [
76 disko.nixosModules.disko
77 ./configuration.nix
78 {
79 networking.hostName = hostName;
80 }
81 ] ++ extraModules;
82 };
83 in
84 {
85 nixosModules = {
86 commonMachine = import ./configuration.nix;
87 installer = import ./installer.nix;
88 e2e = import e2eModule;
89 };
90
91 apps = nixpkgs.lib.genAttrs hostSystems (system: {
92 e2e = {
93 type = "app";
94 program = "${e2eRunnerFor system}/bin/nixie-e2e";
95 };
96 });
97
98 packages = nixpkgs.lib.genAttrs hostSystems (system: {
99 e2e = e2eRunnerFor system;
100 });
101
102 devShells.${linuxSystem}.e2e =
103 let
104 pkgs = import nixpkgs { system = linuxSystem; };
105 in
106 pkgs.mkShell {
107 packages = with pkgs; [
108 dnsmasq
109 iproute2
110 nix
111 nixos-anywhere
112 openssh
113 OVMF.fd
114 python3
115 qemu_kvm
116 tcpdump
117 ];
118 };
119
120 nixosConfigurations = {
121 installer = nixpkgs.lib.nixosSystem {
122 system = linuxSystem;
123 modules = [
124 self.nixosModules.installer
125 nixie.nixosModules.nixie-agent
126 ];
127 };
128 machine1 = mkInstalledMachine "machine1" [ ];
129 machine2 = mkInstalledMachine "machine2" [ ];
130 };
131 };
132}