Skip to content

Latest commit

 

History

History
21 lines (16 loc) · 1.04 KB

README.md

File metadata and controls

21 lines (16 loc) · 1.04 KB

Deployment scripts for my PC / laptop / servers ...

Setup new nixos on remote host

  1. Boot nixos livecd on remote host
  2. Prepare hardware configure
    1. Prepare filesystem and generate hardware configure via nixos-generate-config --root /mnt
    2. Copy nix files from /mnt/etc/nixos to hosts/nixos/${host} in this repo.
  3. Prepare age key
    1. age-keygen and copy age key to /var/lib/sops/key.txt on remote host.
    2. Update .sops.yaml and update secrets via ./secrets/updatekeys.sh
  4. Build nixos on local host: nix build .#nixosConfigurations.${host}.config.system.build.toplevel
  5. Copy result to remote: nix copy --to "ssh://root@${host}?remote-store=/mnt" ./result
  6. Set system profile: nix-env --store /mnt -p /mnt/nix/var/nix/profiles/system --set $(readlink ./result)
  7. Setup bootloader: NIXOS_INSTALL_BOOTLOADER=1 nixos-enter --root "/mnt" -c "/run/current-system/bin/switch-to-configuration boot"
    1. Please ensure that decryption is work in nixos-enter before reboot

TODO

  • Split v2ray config for different hosts