-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### 🐟 What? - Adds a default package, that includes a script that builds and deploys all other packages; - Adds the cache URL to README. - Adds the cache to the flake's `nixConf`. ### 🎣 Why? - My laptop can't build the stuff my desktop builds. ### 🍥 Extra - Needs bot to feed it; - Usage: 1. Set `CACHIX_SIGNING_KEY`; 2. Run `nix shell -c build-chaotic-nyx`. - We'll have both ours and cachix urls as trusted keys, I plan to keep some stuff in cachix even when we have our cache running
- Loading branch information
Showing
3 changed files
with
78 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ all-packages | ||
, cachix | ||
, jq | ||
, lib | ||
, nix | ||
, flakeSelf | ||
, writeShellScriptBin | ||
}: | ||
let | ||
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 | ||
"${namespace}.${n}" | ||
else | ||
n | ||
; | ||
packagesEval = namespace: n: v: | ||
(if (builtins.tryEval v).success then | ||
(if lib.attrsets.isDerivation v then | ||
(if (v.meta.broken or true) then | ||
"# broken: ${n}" | ||
else if (v.meta.unfree or true) then | ||
"# unfree: ${n}" | ||
else | ||
evalCommand (guide namespace n) v.outputs | ||
) | ||
else if builtins.isAttrs v then | ||
lib.strings.concatStringsSep "\n" | ||
(lib.attrsets.mapAttrsToList (packagesEval (guide namespace n)) v) | ||
else | ||
"# unrelated: ${n}" | ||
) | ||
else | ||
"# not evaluating: ${n}" | ||
) | ||
; | ||
in | ||
writeShellScriptBin "build-chaotic-nyx" '' | ||
cd "$(mktemp -d)" | ||
${packagesEval "" "" all-packages} | ||
'' |