diff --git a/devShell.nix b/devShell.nix index f33bb5c..cb8cd1d 100644 --- a/devShell.nix +++ b/devShell.nix @@ -4,12 +4,17 @@ let inherit (builtins) readFile; inherit (writers) writeBash; build = writeScriptBin "build" '' - nix build .#$* + env=$1 + image=$2 + nix build --out-link "./env/$env/$image" .#$image + # add image to cache + git add -Nf ./env/$env/$image ''; build-qcow = writeScriptBin "build-qcow" '' - build qcow - # add image to cache - git add -Nf ./result + build local qcow + ''; + build-gce = writeScriptBin "build-gce" '' + build gcp gce ''; apply = writeScriptBin "apply" '' # defaults to local @@ -64,6 +69,7 @@ in mkShell { # custom build build-qcow + build-gce minikube apply apply-local diff --git a/env/local/config.nix b/env/local/config.nix index 953456d..c831946 100644 --- a/env/local/config.nix +++ b/env/local/config.nix @@ -10,7 +10,7 @@ }; }; volumes = { - nixos = { source = ../../result/nixos.qcow2; }; + nixos = { source = qcow/nixos.qcow2; }; c1v1 = { source = "nixos"; }; c1v2 = { source = "nixos"; }; c1v3 = { source = "nixos"; }; diff --git a/flake.nix b/flake.nix index d7efde0..9fad712 100644 --- a/flake.nix +++ b/flake.nix @@ -43,7 +43,7 @@ qcow = nixos-generators.nixosGenerate { inherit pkgs; modules = [ - # minimal libvirt qcow + # minimal libvirt ./generators/minimal-libvirt.nix ]; format = "qcow"; @@ -52,7 +52,7 @@ gce = nixos-generators.nixosGenerate { inherit pkgs; modules = [ - # minimal libvirt qcow + # minimal gcp ./generators/minimal-gcp.nix ]; format = "gce";