Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
function instantiate() {
machine="${1}"; shift
# do it
#drv="$(nix eval --pure-eval ".#nixosConfigurations.${machine}")" # 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