|
2 | 2 | description = "NixOS configuration with flakes";
|
3 | 3 |
|
4 | 4 | nixConfig.extra-substituters = [ "https://cache.thalheim.io" ];
|
5 |
| - nixConfig.extra-trusted-public-keys = [ "cache.thalheim.io-1:R7msbosLEZKrxk/lKxf9BTjOOH7Ax3H0Qj0/6wiHOgc=" ]; |
| 5 | + nixConfig.extra-trusted-public-keys = [ |
| 6 | + "cache.thalheim.io-1:R7msbosLEZKrxk/lKxf9BTjOOH7Ax3H0Qj0/6wiHOgc=" |
| 7 | + ]; |
6 | 8 |
|
7 | 9 | # To update all inputs:
|
8 | 10 | # $ nix flake update
|
|
66 | 68 | srvos.url = "github:numtide/srvos";
|
67 | 69 | srvos.inputs.nixpkgs.follows = "nixpkgs";
|
68 | 70 |
|
69 |
| - clan-core.url = "git+https://git.clan.lol/clan/clan-core"; |
70 |
| - #clan-core.url = "git+file:///home/joerg/work/clan/clan-core?ref=openssh"; |
| 71 | + #clan-core.url = "git+https://git.clan.lol/clan/clan-core"; |
| 72 | + clan-core.url = "git+file:///home/joerg/work/clan/clan-core?ref=openssh"; |
71 | 73 | clan-core.inputs.nixpkgs.follows = "nixpkgs";
|
72 | 74 | clan-core.inputs.sops-nix.follows = "sops-nix";
|
73 | 75 | clan-core.inputs.treefmt-nix.follows = "treefmt-nix";
|
|
112 | 114 | #microvm.inputs.flake-utils.follows = "flake-utils";
|
113 | 115 | };
|
114 | 116 |
|
115 |
| - outputs = inputs @ { self, flake-parts, nixpkgs, ... }: |
116 |
| - (flake-parts.lib.evalFlakeModule |
117 |
| - { inherit inputs; } |
118 |
| - ({ withSystem, config, ... }: { |
| 117 | + outputs = |
| 118 | + inputs@{ |
| 119 | + self, |
| 120 | + flake-parts, |
| 121 | + nixpkgs, |
| 122 | + ... |
| 123 | + }: |
| 124 | + (flake-parts.lib.evalFlakeModule { inherit inputs; } ( |
| 125 | + { withSystem, config, ... }: |
| 126 | + { |
119 | 127 | imports = [
|
120 | 128 | ./nixos/flake-module.nix
|
121 | 129 | ./nixos/images/flake-module.nix
|
|
124 | 132 | ./devshell/flake-module.nix
|
125 | 133 | inputs.hercules-ci-effects.flakeModule
|
126 | 134 | ];
|
127 |
| - systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" ]; |
| 135 | + systems = [ |
| 136 | + "x86_64-linux" |
| 137 | + "aarch64-linux" |
| 138 | + "aarch64-darwin" |
| 139 | + ]; |
128 | 140 |
|
129 | 141 | herculesCI = herculesCI: {
|
130 |
| - onPush.default.outputs.effects.deploy = withSystem config.defaultEffectSystem ({ pkgs, hci-effects, ... }: |
131 |
| - hci-effects.runIf (herculesCI.config.repo.branch == "main") (hci-effects.mkEffect { |
132 |
| - effectScript = '' |
133 |
| - ${pkgs.hello}/bin/hello |
134 |
| - ''; |
135 |
| - }) |
| 142 | + onPush.default.outputs.effects.deploy = withSystem config.defaultEffectSystem ( |
| 143 | + { pkgs, hci-effects, ... }: |
| 144 | + hci-effects.runIf (herculesCI.config.repo.branch == "main") ( |
| 145 | + hci-effects.mkEffect { |
| 146 | + effectScript = '' |
| 147 | + ${pkgs.hello}/bin/hello |
| 148 | + ''; |
| 149 | + } |
| 150 | + ) |
136 | 151 | );
|
137 | 152 | };
|
138 | 153 |
|
139 |
| - perSystem = { config, inputs', self', lib, system, ... }: { |
140 |
| - # make pkgs available to all `perSystem` functions |
141 |
| - _module.args.pkgs = inputs'.nixpkgs.legacyPackages; |
142 |
| - |
143 |
| - formatter = config.treefmt.build.wrapper; |
144 |
| - |
145 |
| - checks = |
146 |
| - let |
147 |
| - nixosMachines = lib.mapAttrs' (name: config: lib.nameValuePair "nixos-${name}" config.config.system.build.toplevel) ((lib.filterAttrs (_: config: config.pkgs.system == system)) self.nixosConfigurations); |
148 |
| - blacklistPackages = [ "install-iso" "nspawn-template" "netboot-pixie-core" "netboot" ]; |
149 |
| - packages = lib.mapAttrs' (n: lib.nameValuePair "package-${n}") (lib.filterAttrs (n: _v: !(builtins.elem n blacklistPackages)) self'.packages); |
150 |
| - devShells = lib.mapAttrs' (n: lib.nameValuePair "devShell-${n}") self'.devShells; |
151 |
| - homeConfigurations = lib.mapAttrs' (name: config: lib.nameValuePair "home-manager-${name}" config.activation-script) (self'.legacyPackages.homeConfigurations or { }); |
152 |
| - in |
153 |
| - nixosMachines // packages // devShells // homeConfigurations; |
154 |
| - }; |
| 154 | + perSystem = |
| 155 | + { |
| 156 | + config, |
| 157 | + inputs', |
| 158 | + self', |
| 159 | + lib, |
| 160 | + system, |
| 161 | + ... |
| 162 | + }: |
| 163 | + { |
| 164 | + # make pkgs available to all `perSystem` functions |
| 165 | + _module.args.pkgs = inputs'.nixpkgs.legacyPackages; |
| 166 | + |
| 167 | + formatter = config.treefmt.build.wrapper; |
| 168 | + |
| 169 | + checks = |
| 170 | + let |
| 171 | + nixosMachines = lib.mapAttrs' ( |
| 172 | + name: config: lib.nameValuePair "nixos-${name}" config.config.system.build.toplevel |
| 173 | + ) ((lib.filterAttrs (_: config: config.pkgs.system == system)) self.nixosConfigurations); |
| 174 | + blacklistPackages = [ |
| 175 | + "install-iso" |
| 176 | + "nspawn-template" |
| 177 | + "netboot-pixie-core" |
| 178 | + "netboot" |
| 179 | + ]; |
| 180 | + packages = lib.mapAttrs' (n: lib.nameValuePair "package-${n}") ( |
| 181 | + lib.filterAttrs (n: _v: !(builtins.elem n blacklistPackages)) self'.packages |
| 182 | + ); |
| 183 | + devShells = lib.mapAttrs' (n: lib.nameValuePair "devShell-${n}") self'.devShells; |
| 184 | + homeConfigurations = lib.mapAttrs' ( |
| 185 | + name: config: lib.nameValuePair "home-manager-${name}" config.activation-script |
| 186 | + ) (self'.legacyPackages.homeConfigurations or { }); |
| 187 | + in |
| 188 | + nixosMachines // packages // devShells // homeConfigurations; |
| 189 | + }; |
155 | 190 | # CI
|
156 |
| - })).config.flake; |
| 191 | + } |
| 192 | + )).config.flake; |
157 | 193 | }
|
0 commit comments