diff options
author | Anton Plotnikov <apl@dsx.uk> | 2019-11-22 12:54:29 +0300 |
---|---|---|
committer | Robert Helgesson <robert@rycee.net> | 2019-11-22 20:16:42 +0100 |
commit | b1dd373f5ad3fd3f5e727ff9be72c76c2f7919fa (patch) | |
tree | 7e7c9be34aaadf01c39412edb8a0d3c4b5be672e /modules/files.nix | |
parent | 286dd9b3088298e5a4625b517f8e72b1c62e4f74 (diff) |
files: update script to support linked Nix store
Diffstat (limited to 'modules/files.nix')
-rw-r--r-- | modules/files.nix | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/files.nix b/modules/files.nix index ac946976faf..11f89963986 100644 --- a/modules/files.nix +++ b/modules/files.nix @@ -236,6 +236,9 @@ in ('' mkdir -p $out + # Needed in case /nix is a symbolic link. + realOut="$(realpath -m "$out")" + function insertFile() { local source="$1" local relTarget="$2" @@ -244,10 +247,10 @@ in # Figure out the real absolute path to the target. local target - target="$(realpath -m "$out/$relTarget")" + target="$(realpath -m "$realOut/$relTarget")" # Target path must be within $HOME. - if [[ ! $target == $out* ]] ; then + if [[ ! $target == $realOut* ]] ; then echo "Error installing file '$relTarget' outside \$HOME" >&2 exit 1 fi |