# deploy target: # nh os switch --file ./default.nix hosts.{{ target }} --target-host {{ target }} --build-host {{ target }} set shell := ["bash", "-c"] deploy target: nixos-rebuild switch --file ./default.nix -A hosts.{{ target }} --target-host {{ target }} --build-host {{ target }} --sudo |& nom # preview {{ target }} # nixos-rebuild switch --store-path xxx --target-host {{ target }} --build-host {{ target }} --sudo &| nom preview target: #!/usr/bin/env bash nixos-rebuild build --file ./default.nix -A hosts.{{ target }} --target-host {{ target }} --build-host {{ target }} --no-flake | tee /tmp/build |& nom export build=$(cat /tmp/build) ssh {{ target }} "nix run nixpkgs#dix -- --color always /run/current-system $build" read -p "Continue deploying? (y/n)\n" ans if [[ "$ans" = "y" ]]; then # ssh {{ target }} "nixos-rebuild switch --store-path $build --sudo" nixos-rebuild switch --target-host {{ target }} --build-host {{ target }} --sudo fi deploy-homelab: nixos-rebuild switch --file ./default.nix -A hosts.home-server --target-host root@snowlab.local --build-host root@snowlab.local |& nom deploy-server: nh os switch --file ./default.nix hosts.server --target-host server --build-host server wireguard_gen: #!/usr/bin/env nix-shell #!nix-shell -i bash -p wireguard-tools key=$(wg genkey) pub=$(echo $key | wg pubkey) psk=$(wg genpsk) echo -e "key: $key\npub: $pub\npsk: $psk"