This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

ci: expose checks as flake checks

+30 -36
+27
flake.nix
··· 195 195 }) 196 196 ]; 197 197 }; 198 + checks = 199 + let 200 + # Check NixOS configurations can be evaluated (without building) 201 + nixosChecks = lib.mapAttrs' ( 202 + name: config: 203 + lib.nameValuePair "nixos-${name}" ( 204 + pkgs.runCommand "eval-${name}" { } '' 205 + # Force evaluation of the toplevel path without building 206 + echo "Evaluating ${name}: ${builtins.unsafeDiscardStringContext config.config.system.build.toplevel.drvPath}" 207 + touch $out 208 + '' 209 + ) 210 + ) (lib.filterAttrs (_: config: config.pkgs.system == system) self.nixosConfigurations); 211 + 212 + # Check Darwin configurations can be evaluated (without building) 213 + darwinChecks = lib.mapAttrs' ( 214 + name: config: 215 + lib.nameValuePair "darwin-${name}" ( 216 + pkgs.runCommand "eval-darwin-${name}" { } '' 217 + # Force evaluation of the system path without building 218 + echo "Evaluating ${name}: ${builtins.unsafeDiscardStringContext config.system.drvPath}" 219 + touch $out 220 + '' 221 + ) 222 + ) (lib.filterAttrs (_: config: config.pkgs.system == system) self.darwinConfigurations); 223 + in 224 + nixosChecks // darwinChecks; 198 225 }; 199 226 flake.lib = import ./lib { inherit (nixpkgs) lib; }; 200 227 };
+3 -36
.github/workflows/ci.yml
··· 5 5 pull_request: 6 6 7 7 jobs: 8 - eval-machines: 8 + check: 9 9 runs-on: ubuntu-latest 10 10 steps: 11 11 - uses: actions/checkout@v4 ··· 20 20 21 21 - uses: DeterminateSystems/magic-nix-cache-action@main 22 22 23 - - name: Evaluate all NixOS configurations 24 - run: | 25 - echo "Evaluating NixOS configurations..." 26 - failed=0 27 - for machine in $(nix eval --json .#nixosConfigurations --apply builtins.attrNames | jq -r '.[]'); do 28 - echo "Evaluating $machine..." 29 - if ! nix eval .#nixosConfigurations.$machine.config.system.build.toplevel --raw; then 30 - echo "❌ Failed to evaluate $machine" 31 - failed=1 32 - else 33 - echo "✅ $machine evaluated successfully" 34 - fi 35 - done 36 - exit $failed 37 - 38 - - name: Evaluate all Darwin configurations 39 - run: | 40 - echo "Evaluating Darwin configurations..." 41 - failed=0 42 - for machine in $(nix eval --json .#darwinConfigurations --apply builtins.attrNames 2>/dev/null | jq -r '.[]' 2>/dev/null || echo ""); do 43 - if [ -n "$machine" ]; then 44 - echo "Evaluating $machine..." 45 - if ! nix eval .#darwinConfigurations.$machine.system --raw; then 46 - echo "❌ Failed to evaluate $machine" 47 - failed=1 48 - else 49 - echo "✅ $machine evaluated successfully" 50 - fi 51 - fi 52 - done 53 - exit $failed 54 - 55 - - name: Check formatter 56 - run: | 57 - nix fmt -- --fail-on-change 23 + - name: Run flake checks 24 + run: nix flake check