my over complex system configurations
4

Configure Feed

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

flake/checks: cleanup

isabel (May 10, 2026, 12:57 PM +0100) 66ef8564 1cda1b09

+45 -30
+4 -4
modules/flake/checks/default.nix
··· 1 - # I would highly advise you do not use my flake as an input and instead you vendor this 2 - # if you want to use this code. 3 1 { pkgs, inputs, ... }: 4 2 5 3 let 6 4 inherit (pkgs) lib; 7 5 8 - scope = pkgs.lib.makeScope pkgs.newScope (scopeSelf: { 6 + scope = lib.makeScope pkgs.newScope (scopeSelf: { 9 7 inherit (inputs) self; 10 8 11 9 # keep-sorted start block=yes newline_separated=yes 12 10 formatting = scopeSelf.callPackage ./formatting.nix { }; 13 11 14 - # lib = scopeSelf.callPackage ./lib.nix { }; 12 + port-collector = scopeSelf.callPackage ./port-collector.nix { }; 13 + 14 + selflib = scopeSelf.callPackage ./lib.nix { }; 15 15 # keep-sorted end 16 16 }); 17 17
+11 -5
modules/flake/checks/formatting.nix
··· 6 6 let 7 7 fmt = self.formatter.${stdenvNoCC.hostPlatform.system}; 8 8 in 9 - runCommandLocal "formatting-checks" { nativeBuildInputs = [ fmt ]; } '' 10 - cd ${self} 11 - treefmt --no-cache --fail-on-change 12 - touch $out 13 - '' 9 + runCommandLocal "formatting-checks" 10 + { 11 + nativeBuildInputs = [ fmt ]; 12 + __structuredAttrs = true; 13 + strictDeps = true; 14 + } 15 + '' 16 + cd ${self} 17 + treefmt --no-cache --fail-on-change 18 + touch $out 19 + ''
+30 -21
modules/flake/checks/lib.nix
··· 84 84 expected, 85 85 result, 86 86 }: 87 - builtins.readFile ( 88 - runCommandLocal "nix-flake-tests-error" 89 - { 90 - expected = formatValue expected; 91 - result = formatValue result; 92 - passAsFile = [ 93 - "expected" 94 - "result" 95 - ]; 96 - } 97 - '' 98 - echo "${name} failed (- expected, + result)" > $out 99 - cp ''${expectedPath} ''${expectedPath}.json 100 - cp ''${resultPath} ''${resultPath}.json 101 - ${deepdiff}/bin/deep diff ''${expectedPath}.json ''${resultPath}.json >> $out 102 - '' 103 - ); 87 + runCommandLocal "nix-flake-tests-error" 88 + { 89 + __structuredAttrs = true; 90 + strictDeps = true; 91 + expected = formatValue expected; 92 + result = formatValue result; 93 + } 94 + '' 95 + printf '%s' "$expected" > expected.json 96 + printf '%s' "$result" > result.json 97 + echo "${name} failed (- expected, + result)" > $out 98 + ${deepdiff}/bin/deep diff expected.json result.json >> $out 99 + ''; 104 100 in 105 - if res != [ ] then 106 - throw (lib.strings.concatStringsSep "\n" (map resultToString (lib.debug.traceValSeq res))) 107 - else 108 - runCommandLocal "nix-flake-tests-success" { } "echo > $out" 101 + runCommandLocal "nix-flake-tests-success" 102 + { 103 + __structuredAttrs = true; 104 + strictDeps = true; 105 + failures = map resultToString res; 106 + } 107 + '' 108 + if [ ''${#failures[@]} -gt 0 ]; then 109 + for f in "''${failures[@]}"; do 110 + cat "$f" 111 + echo 112 + done 113 + exit 1 114 + fi 115 + 116 + touch $out 117 + ''