From c7702080a9aecd7e2163deda306c82cbdc05f891 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sat, 15 Aug 2020 16:37:19 -0300 Subject: 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 --- README.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index df4707a..578826e 100644 --- a/README.md +++ b/README.md @@ -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 -- cgit v1.2.3