Skip to content

Commit

Permalink
build all outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
PedroHLC committed Apr 8, 2023
1 parent 6352cb1 commit f6c9d48
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions shared/builder.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@
, writeShellScriptBin
}:
let
evalCommand = where: ''
echo "Building ${flakeSelf}#${where}"
${nix}/bin/nix build --json "${flakeSelf}#${where}" |\
${jq}/bin/jq -r '.[0].outputs[]' |\
${cachix}/bin/cachix push chaotic-nyx --compression-method zstd
'';
evalCommand = where: drvOutputs:
let
derivation = "${flakeSelf}#${where}";
outputs = map (guide derivation) drvOutputs;
in
''
echo "Building ${derivation}"
${nix}/bin/nix build --json \
${lib.strings.concatStringsSep " \\\n " outputs} |\
${jq}/bin/jq -r '.[].outputs[]' |\
${cachix}/bin/cachix push chaotic-nyx --compression-method zstd
'';

guide = namespace: n:
if namespace != "" then
Expand All @@ -28,7 +34,7 @@ let
else if (v.meta.unfree or true) then
"# unfree: ${n}"
else
evalCommand (guide namespace n)
evalCommand (guide namespace n) v.outputs
)
else if builtins.isAttrs v then
lib.strings.concatStringsSep "\n"
Expand Down

0 comments on commit f6c9d48

Please sign in to comment.