diff options
author | WORLDofPEACE <worldofpeace@protonmail.ch> | 2020-09-20 15:10:16 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-20 15:10:16 -0400 |
commit | 684d691c6e9d49d3aab96f4053d011c225aa75bf (patch) | |
tree | 73b030eebdf8c14e18b9d6cecf70a909a54921e9 /nixos | |
parent | 8f00cc47e912dbfb7c79fa498719a8356ff9c1cf (diff) | |
parent | e26b348689f64832dee634dea20f4bbf76340aed (diff) |
Merge pull request #97738 from cole-h/build-vm-for-flakes
nixos-rebuild: add flake support for build-vm
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/installer/tools/nixos-rebuild.sh | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/nixos/modules/installer/tools/nixos-rebuild.sh b/nixos/modules/installer/tools/nixos-rebuild.sh index ad40fd2811dc..909e8b229c8a 100644 --- a/nixos/modules/installer/tools/nixos-rebuild.sh +++ b/nixos/modules/installer/tools/nixos-rebuild.sh @@ -438,15 +438,17 @@ if [ -z "$rollback" ]; then if [[ -z $flake ]]; then pathToConfig="$(nixBuild '<nixpkgs/nixos>' -A vm -k "${extraBuildFlags[@]}")" else - echo "$0: 'build-vm' is not supported with '--flake'" >&2 - exit 1 + nix "${flakeFlags[@]}" build "$flake#$flakeAttr.config.system.build.vm" \ + "${extraBuildFlags[@]}" "${lockFlags[@]}" + pathToConfig="$(readlink -f ./result)" fi elif [ "$action" = build-vm-with-bootloader ]; then if [[ -z $flake ]]; then pathToConfig="$(nixBuild '<nixpkgs/nixos>' -A vmWithBootLoader -k "${extraBuildFlags[@]}")" else - echo "$0: 'build-vm-with-bootloader' is not supported with '--flake'" >&2 - exit 1 + nix "${flakeFlags[@]}" build "$flake#$flakeAttr.config.system.build.vmWithBootLoader" \ + "${extraBuildFlags[@]}" "${lockFlags[@]}" + pathToConfig="$(readlink -f ./result)" fi else showSyntax |