Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
function instantiate() {
machine="${1}"; shift
# do it
true
#drv="$(nix eval --pure-eval ".#nixosConfigurations.${machine}.config.system.build.toplevel")" # TODO: why????
set -e
drv="$(set -eu; nix --experimental-features 'nix-command flakes' --pure-eval \
eval \
--raw ".#machines.${machine}")"
drv="$(set -euo pipefail; nix --experimental-features 'nix-command flakes' --pure-eval \
show-derivation "${drv}" | jq -r 'to_entries[].key')"
echo -e "${drv}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment