From 4037e2da7b0a10e087ba00f3c09ebf24e65c4953 Mon Sep 17 00:00:00 2001 From: Mike Vink Date: Thu, 20 Jun 2024 10:13:36 +0200 Subject: use vmware fusion to have a vm with nixos --- justfile | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'justfile') diff --git a/justfile b/justfile index 808e3cc..01f2683 100644 --- a/justfile +++ b/justfile @@ -29,6 +29,20 @@ NIXNAME := "vm-aarch64" nixos-install --no-root-passwd && reboot " +@vm-secrets ip: + # GPG keyring + rsync -av -e 'ssh {{SSH_OPTIONS}}' \ + --exclude='.#*' \ + --exclude='S.*' \ + --exclude='*.conf' \ + $HOME/.gnupg/ root@{{ip}}:~/.gnupg + # SSH keys + rsync -av -e 'ssh {{SSH_OPTIONS}}' \ + --exclude='environment' \ + $HOME/.ssh/ root@{{ip}}:~/.ssh + # Sops keys + rsync -avr -e 'ssh {{SSH_OPTIONS}}' --relative ~/./.config/sops root@{{ip}}:~ + # copy the Nix configurations into the VM. @vm-copy ip: rsync -av -e 'ssh {{SSH_OPTIONS}} -p22' \ @@ -38,7 +52,7 @@ NIXNAME := "vm-aarch64" # run the nixos-rebuild switch command. This does NOT copy files so you # have to run vm/copy before. -@vm-switch ip: (vm-copy ip) +@vm-switch ip: (vm-copy ip) (vm-secrets ip) ssh {{SSH_OPTIONS}} -p22 root@{{ip}} " \ sudo NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 nixos-rebuild switch --flake \"/nix-config#{{NIXNAME}}\" \ " -- cgit v1.2.3