Last active
August 6, 2020 19:26
-
-
Save colemickens/790aa973b2249a383f38a297a91ac294 to your computer and use it in GitHub Desktop.
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
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