summary refs log tree commit diff
diff options
context:
space:
mode:
authorArtturin <Artturin@artturin.com>2023-08-04 20:41:11 +0300
committerArtturin <Artturin@artturin.com>2023-08-04 20:54:18 +0300
commit103bb49f84536d8fedc2b88a8ad81ff59342d400 (patch)
tree8739467dbbbcb0d8966a09eb81d4c2718555106c
parent5b3975cc66cefd3c199505c7a5780c5bbba95bce (diff)
downloadnixpkgs-103bb49f84536d8fedc2b88a8ad81ff59342d400.tar
nixpkgs-103bb49f84536d8fedc2b88a8ad81ff59342d400.tar.gz
nixpkgs-103bb49f84536d8fedc2b88a8ad81ff59342d400.tar.bz2
nixpkgs-103bb49f84536d8fedc2b88a8ad81ff59342d400.tar.lz
nixpkgs-103bb49f84536d8fedc2b88a8ad81ff59342d400.tar.xz
nixpkgs-103bb49f84536d8fedc2b88a8ad81ff59342d400.tar.zst
nixpkgs-103bb49f84536d8fedc2b88a8ad81ff59342d400.zip
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 56b465390449926626d3378e05b8e507061cd828
-rwxr-xr-xnixos/modules/system/boot/stage-2-init.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/nixos/modules/system/boot/stage-2-init.sh b/nixos/modules/system/boot/stage-2-init.sh
index f9a2084ea9e..c0af29e3b99 100755
--- a/nixos/modules/system/boot/stage-2-init.sh
+++ b/nixos/modules/system/boot/stage-2-init.sh
@@ -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