# Deploy ## Setup (one time) Build base image: ```sh nixos-rebuild build-image --image-variant proxmox --flake .#base ``` Copy base image to a Proxmox node: ```sh scp result/vzdump-qemu-nixos-26.05.20260401.6201e20.vma.zst root@192.168.0.85:/var/lib/vz/dump/ ``` Restore on Proxmox. Convert to Proxmox Template. Run TF as usual using clone against the Template. Generate host-keys, and age key for the host. ```sh # first time only ./generate-keys.sh torrents--2 ``` ## Secrets w/ `sops` Edit the `.sops.yaml` to include the host's age key Create host's secrets: ```sh sops secrets/torrents-2.yaml ``` ## Push ```sh ./deploy.sh torrents-2 root ``` ## References: https://github.com/nix-community/nixos-generators https://gist.github.com/joshleecreates/e6892ca21b0e6b7c24d96ca2a24bf23e # Hosts ## torrents-2 For all my Linux ISOs ofcourse. ## rproxy-2 Entrypoint into my home-lab services. ## git Set your `sshconfig`: ```sshconfig # ~/.ssh/config Host git.kumardamani.net Port 2222 ``` > Non-SSH access (https) is always read-only, and anonymous. Manage repos with: ```sh ssh -t git@git.kumardamani.net == git repo manager == l) list repos c) create repo p) publish repo h) hide repo d) set description x) delete repo q) quit > ``` Without the ssh config entry, use the abs path: ```sh git clone ssh://git@git.kumardamani.net:2222/srv/git/.git ``` Move an existing local repo onto the server: ```sh ssh git@git.kumardamani.net create ssh git@git.kumardamani.net publish git remote set-url origin git@git.kumardamani.net: git push --all origin && git push --tags origin ``` Push to both our git and GitLab (for ci/cd repos): ```sh git config --unset-all remote.origin.pushurl git remote set-url origin git@git.kumardamani.net:.git git remote set-url --add --push origin git@git.kumardamani.net:.git git remote set-url --add --push origin git@gitlab.com:kdam0/.git git remote -v ```