diff options
author | EuAndreh <eu@euandre.org> | 2020-08-15 16:37:19 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2020-08-15 17:26:47 -0300 |
commit | c7702080a9aecd7e2163deda306c82cbdc05f891 (patch) | |
tree | 8880f089a4510ce9107aabf504cd3764044cfca0 /README.md | |
parent | Add generated Terraform files (diff) | |
download | toph-c7702080a9aecd7e2163deda306c82cbdc05f891.tar.gz toph-c7702080a9aecd7e2163deda306c82cbdc05f891.tar.xz |
Use new image with ownership of /etc/nixos/configuration.nix by user
Useful reference:
- https://discourse.nixos.org/t/can-i-move-etc-nixos-to-my-dotfiles-and-symlink-it-back-to-etc-nixos/4833/10
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -60,14 +60,16 @@ The basic `configuration.nix` file in the current snapshots looks just like this This basic setup allows it to boot, starts the OpenSSH server agent and allows the listed `openssh.authorizedKeys.keys` to login. -I've also changed the nix-channel to the `nixos-unstable` imperatively before -creating the image snapshot: +I've also changed the ownership of `/etc/nixos/configuration.nix` to allow my +user to write to it by piping through SSH without trying some +[non-working solutions like before][0]: ```shell -sudo nix-channel --remove nixos -sudo nix-channel --add https://nixos.org/channels/nixos-unstable nixos +sudo chown andreh /etc/nixos/configuration.nix ``` -So the first run of `./nixos-update.sh` will already get the latest channel from -unstable, which makes this image not tied to the particular original 19.09 NixOS -distribution. +With that `./nixos-update.sh` can write to the NixOS configuration file without +running into issues with `sudo` password permissions through the SSH pipe while +writing to stdin. + +[0]: https://git.sr.ht/~euandreh/vps/tree/a7983c859f3d8890e35c587176f497b73a7a7dc7/nixos-switch.sh#L7 |