|
5 | 5 | inputs.nixos-stable.url = "github:NixOS/nixpkgs/nixos-24.05"; |
6 | 6 |
|
7 | 7 | nixConfig.extra-substituters = [ "https://nix-community.cachix.org" ]; |
8 | | - nixConfig.extra-trusted-public-keys = [ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" ]; |
| 8 | + nixConfig.extra-trusted-public-keys = [ |
| 9 | + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" |
| 10 | + ]; |
9 | 11 |
|
10 | | - outputs = { self, nixos-unstable, nixos-stable }: |
| 12 | + outputs = |
| 13 | + { |
| 14 | + self, |
| 15 | + nixos-unstable, |
| 16 | + nixos-stable, |
| 17 | + }: |
11 | 18 | let |
12 | | - supportedSystems = [ "aarch64-linux" "x86_64-linux" ]; |
| 19 | + supportedSystems = [ |
| 20 | + "aarch64-linux" |
| 21 | + "x86_64-linux" |
| 22 | + ]; |
13 | 23 | forAllSystems = nixos-unstable.lib.genAttrs supportedSystems; |
14 | | - in |
15 | | - { |
16 | | - packages = forAllSystems (system: |
| 24 | + |
| 25 | + packages = forAllSystems ( |
| 26 | + system: |
17 | 27 | let |
18 | 28 | netboot = nixpkgs: (import (nixpkgs + "/nixos/release.nix") { }).netboot.${system}; |
19 | | - kexec-installer = nixpkgs: modules: (nixpkgs.legacyPackages.${system}.nixos (modules ++ [ self.nixosModules.kexec-installer ])).config.system.build.kexecTarball; |
20 | | - netboot-installer = nixpkgs: (nixpkgs.legacyPackages.${system}.nixos [ self.nixosModules.netboot-installer ]).config.system.build.netboot; |
21 | | - image-installer = nixpkgs: (nixpkgs.legacyPackages.${system}.nixos [ self.nixosModules.image-installer ]).config.system.build.isoImage; |
| 29 | + kexec-installer = |
| 30 | + nixpkgs: modules: |
| 31 | + (nixpkgs.legacyPackages.${system}.nixos (modules ++ [ self.nixosModules.kexec-installer ])) |
| 32 | + .config.system.build.kexecTarball; |
| 33 | + netboot-installer = |
| 34 | + nixpkgs: |
| 35 | + (nixpkgs.legacyPackages.${system}.nixos [ self.nixosModules.netboot-installer ]) |
| 36 | + .config.system.build.netboot; |
| 37 | + image-installer = |
| 38 | + nixpkgs: |
| 39 | + (nixpkgs.legacyPackages.${system}.nixos [ self.nixosModules.image-installer ]) |
| 40 | + .config.system.build.isoImage; |
22 | 41 | in |
23 | 42 | { |
24 | 43 | netboot-nixos-unstable = netboot nixos-unstable; |
|
30 | 49 | image-installer-nixos-stable = image-installer nixos-stable; |
31 | 50 |
|
32 | 51 | kexec-installer-nixos-unstable-noninteractive = kexec-installer nixos-unstable [ |
33 | | - { |
34 | | - system.kexec-installer.name = "nixos-kexec-installer-noninteractive"; |
35 | | - } |
| 52 | + { system.kexec-installer.name = "nixos-kexec-installer-noninteractive"; } |
36 | 53 | self.nixosModules.noninteractive |
37 | 54 | ]; |
38 | 55 | kexec-installer-nixos-stable-noninteractive = kexec-installer nixos-stable [ |
39 | | - { |
40 | | - system.kexec-installer.name = "nixos-kexec-installer-noninteractive"; |
41 | | - } |
| 56 | + { system.kexec-installer.name = "nixos-kexec-installer-noninteractive"; } |
42 | 57 | self.nixosModules.noninteractive |
43 | 58 | ]; |
44 | 59 |
|
45 | 60 | netboot-installer-nixos-unstable = netboot-installer nixos-unstable; |
46 | 61 | netboot-installer-nixos-stable = netboot-installer nixos-stable; |
47 | | - }); |
| 62 | + } |
| 63 | + ); |
| 64 | + |
| 65 | + crossPackages = { |
| 66 | + x86_64-linux = |
| 67 | + let |
| 68 | + kexec-installer = |
| 69 | + nixpkgs: modules: |
| 70 | + (nixpkgs.legacyPackages.x86_64-linux.pkgsCross.riscv64.nixos ( |
| 71 | + modules |
| 72 | + ++ [ |
| 73 | + self.nixosModules.kexec-installer |
| 74 | + self.nixosModules.noninteractive |
| 75 | + ] |
| 76 | + )).config.system.build.kexecTarball; |
| 77 | + in |
| 78 | + { |
| 79 | + kexec-installer-nixos-unstable-noninteractive-risc64 = kexec-installer nixos-unstable [ ]; |
| 80 | + kexec-installer-nixos-stable-noninteractive-risc64 = kexec-installer nixos-stable [ ]; |
| 81 | + }; |
| 82 | + }; |
| 83 | + in |
| 84 | + { |
| 85 | + packages = nixos-unstable.lib.recursiveUpdate packages crossPackages; |
48 | 86 | nixosModules = { |
49 | 87 | kexec-installer = ./nix/kexec-installer/module.nix; |
50 | 88 | noninteractive = ./nix/noninteractive.nix; |
|
55 | 93 | checks = |
56 | 94 | let |
57 | 95 | # re-export the packages as checks |
58 | | - packages = forAllSystems (system: nixos-unstable.lib.mapAttrs' (n: nixos-unstable.lib.nameValuePair "package-${n}") self.packages.${system}); |
| 96 | + packages = forAllSystems ( |
| 97 | + system: |
| 98 | + nixos-unstable.lib.mapAttrs' ( |
| 99 | + n: nixos-unstable.lib.nameValuePair "package-${n}" |
| 100 | + ) self.packages.${system} |
| 101 | + ); |
59 | 102 | checks = |
60 | 103 | let |
61 | 104 | pkgs = nixos-unstable.legacyPackages.x86_64-linux; |
|
64 | 107 | kexec-installer-unstable = pkgs.callPackage ./nix/kexec-installer/test.nix { |
65 | 108 | kexecTarball = self.packages.x86_64-linux.kexec-installer-nixos-unstable-noninteractive; |
66 | 109 | }; |
67 | | - shellcheck = pkgs.runCommand "shellcheck" |
68 | | - { |
69 | | - nativeBuildInputs = [ pkgs.shellcheck ]; |
70 | | - } '' |
71 | | - shellcheck ${(pkgs.nixos [self.nixosModules.kexec-installer]).config.system.build.kexecRun} |
| 110 | + shellcheck = pkgs.runCommand "shellcheck" { nativeBuildInputs = [ pkgs.shellcheck ]; } '' |
| 111 | + shellcheck ${(pkgs.nixos [ self.nixosModules.kexec-installer ]).config.system.build.kexecRun} |
72 | 112 | touch $out |
73 | 113 | ''; |
74 | | - kexec-installer-stable = nixos-stable.legacyPackages.x86_64-linux.callPackage ./nix/kexec-installer/test.nix { |
75 | | - kexecTarball = self.packages.x86_64-linux.kexec-installer-nixos-stable-noninteractive; |
76 | | - }; |
| 114 | + kexec-installer-stable = |
| 115 | + nixos-stable.legacyPackages.x86_64-linux.callPackage ./nix/kexec-installer/test.nix |
| 116 | + { kexecTarball = self.packages.x86_64-linux.kexec-installer-nixos-stable-noninteractive; }; |
77 | 117 | }; |
78 | 118 | in |
79 | 119 | nixos-unstable.lib.recursiveUpdate packages { x86_64-linux = checks; }; |
|
0 commit comments