nixos/stage-2-init: Change permission of /etc/nixos only if it exists

When I boot there's a warning `stage-2-init: install: cannot change permissions of '/etc/nixos': No such file or directory`
because my /etc/nixos is a symlink to $HOME/dotfiles.

```
/etc/nixos -> /home/artturin/dotfiles
```

These lines were added in 56b4653904
This commit is contained in:
Artturin 2023-08-04 20:41:11 +03:00
parent 5b3975cc66
commit 103bb49f84

View file

@ -104,7 +104,10 @@ fi
# Required by the activation script
install -m 0755 -d /etc /etc/nixos
install -m 0755 -d /etc
if [ -d "/etc/nixos" ]; then
install -m 0755 -d /etc/nixos
fi
install -m 01777 -d /tmp