- Activate git in configuration.nix
- Create a ssh key with:
sudo ssh-keygen -t ed25519 -C "nixos-root-config" -f /root/.ssh/id_nixos_github - Configura the ssh for Root:
sudo nvim /root/.ssh/configwith:
Host github.com
IdentityFile /root/.ssh/id_nixos_github
User git
- Add permission:
sudo chmod 600 /root/.ssh/configsudo chmod 600 /root/.ssh/id_nixos_github - Add the key to github deploy:
- Take the key:
sudo cat /root/.ssh/id_nixos_github.pub - Go on Github -> create the repository (if necessary) or go to the repository wanted -> Settings -> Deploy Key -> Add DeployKey (Allow write acces)
- Take the key:
- Then do as usual, but with sudo always before git