Every time I want to edit and/or rebuild my nixos configuration, I find myself performing the same sequence of actions:
- open a terminal
- enter password
I was playing around with ways to script this so that I could bind it to a key in my xmonad config, and came up with this little composition:
alacritty -e bash -c 'sudo --login bash -c "cd /etc/nixos ; exec bash"'
Alternative would be making the directory owned and writable by your user.
Or even moving it out of
Have you tried
Alternatively move it so some other location that you have easy RW access and then use
nixos-config as an entry for
-I that points to the exact entrypoint file you want to use.
env -C can also be used to set up an initial working directory for a program, e.g.
sudo -i env -C /etc/nixos bash.