summaryrefslogtreecommitdiff
path: root/modules/system
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2018-01-08 19:08:02 +0100
committerDaiderd Jordan <daiderd@gmail.com>2018-01-08 19:08:02 +0100
commit3bedff357a38f965be91b9a88cbe0a82be4a1b4c (patch)
treed3eea7d8ad1a046719d87fd79f2df5aed7fbb538 /modules/system
parentac840a44b4a5a1d728938b7cb20e5b7a7d23e126 (diff)
etc: make link warnings more noticable
Hopefully this helps to make it more obvious that the file will not be created by nix-darwin. See #65
Diffstat (limited to 'modules/system')
-rw-r--r--modules/system/etc.nix7
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/system/etc.nix b/modules/system/etc.nix
index b99ca99..242570e 100644
--- a/modules/system/etc.nix
+++ b/modules/system/etc.nix
@@ -45,14 +45,14 @@ in
ln -sfn "$(readlink -f $systemConfig/etc)" /etc/static
for f in $(find /etc/static/* -type l); do
- l="$(echo $f | sed 's,/etc/static/,/etc/,')"
- d="$(dirname $l)"
+ l=/etc/''${f#/etc/static/}
+ d=''${l%/*}
if [ ! -e "$d" ]; then
mkdir -p "$d"
fi
if [ -e "$l" ]; then
if [ "$(readlink $l)" != "$f" ]; then
- echo "warning: not linking $l because $l exists, skipping..." >&2
+ echo "warning: not linking environment.etc.\"''${l#/etc/}\" because $l exists, skipping..." >&2
fi
else
ln -s "$f" "$l"
@@ -61,6 +61,7 @@ in
for l in $(find /etc/* -type l 2> /dev/null); do
f="$(echo $l | sed 's,/etc/,/etc/static/,')"
+ f=/etc/static/''${l#/etc/}
if [ "$(readlink $l)" = "$f" -a ! -e "$(readlink -f $l)" ]; then
rm "$l"
fi