feat(scripts/cache-node): support non-NixOS systems
Signed-off-by: Ryan Lahfa <ryan@dgnum.eu>
This commit is contained in:
parent
c6e728067f
commit
b9688a4d77
1 changed files with 19 additions and 1 deletions
20
scripts/cache-node.sh
Normal file → Executable file
20
scripts/cache-node.sh
Normal file → Executable file
|
@ -3,7 +3,25 @@ set -o nounset
|
|||
set -o pipefail
|
||||
shopt -s lastpipe
|
||||
|
||||
drv=$(colmena eval --instantiate -E "{ nodes, ... }: nodes.${BUILD_NODE}.config.system.build.toplevel")
|
||||
system_type="$(colmena eval -E "{ nodes, ... }: nodes.${BUILD_NODE}.config.deployment.systemType")"
|
||||
# Get rid of surrounding quotes.
|
||||
system_type="${system_type%\"}"
|
||||
system_type="${system_type#\"}"
|
||||
|
||||
case "$system_type" in
|
||||
nixos)
|
||||
toplevel_path="config.system.build.toplevel"
|
||||
;;
|
||||
zyxel-nwa50ax)
|
||||
toplevel_path="config.system.outputs.zyxel-nwa-fit"
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported system type '$system_type' for caching; add an entry in 'scripts/cache-node.sh'"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
drv=$(colmena eval --instantiate -E "{ nodes, ... }: nodes.${BUILD_NODE}.${toplevel_path}")
|
||||
|
||||
# Build the derivation and send it to the great beyond
|
||||
nix-store --query --requisites --force-realise --include-outputs "$drv" | grep -v '.*\.drv' >paths.txt
|
||||
|
|
Loading…
Reference in a new issue