mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 19:46:05 +01:00
files: add home.file.<name>.ignorelinks
This commit is contained in:
parent
910292fe34
commit
a48fecda09
2 changed files with 19 additions and 1 deletions
|
|
@ -297,6 +297,7 @@ in
|
||||||
local relTarget="$2"
|
local relTarget="$2"
|
||||||
local executable="$3"
|
local executable="$3"
|
||||||
local recursive="$4"
|
local recursive="$4"
|
||||||
|
local ignorelinks="$5"
|
||||||
|
|
||||||
# If the target already exists then we have a collision. Note, this
|
# If the target already exists then we have a collision. Note, this
|
||||||
# should not happen due to the assertion found in the 'files' module.
|
# should not happen due to the assertion found in the 'files' module.
|
||||||
|
|
@ -321,7 +322,11 @@ in
|
||||||
if [[ -d $source ]]; then
|
if [[ -d $source ]]; then
|
||||||
if [[ $recursive ]]; then
|
if [[ $recursive ]]; then
|
||||||
mkdir -p "$target"
|
mkdir -p "$target"
|
||||||
lndir -silent "$source" "$target"
|
if [[ $ignorelinks ]]; then
|
||||||
|
lndir -silent -ignorelinks "$source" "$target"
|
||||||
|
else
|
||||||
|
lndir -silent "$source" "$target"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
ln -s "$source" "$target"
|
ln -s "$source" "$target"
|
||||||
fi
|
fi
|
||||||
|
|
@ -357,6 +362,7 @@ in
|
||||||
v.target
|
v.target
|
||||||
(if v.executable == null then "inherit" else toString v.executable)
|
(if v.executable == null then "inherit" else toString v.executable)
|
||||||
(toString v.recursive)
|
(toString v.recursive)
|
||||||
|
(toString v.ignorelinks)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
'') cfg
|
'') cfg
|
||||||
|
|
|
||||||
|
|
@ -102,6 +102,18 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
ignorelinks = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = ''
|
||||||
|
When `recursive` is enabled, adds `-ignorelinks` flag to lndir
|
||||||
|
|
||||||
|
It causes lndir to not treat symbolic links in the source directory specially.
|
||||||
|
The link created in the target directory will point back to the corresponding
|
||||||
|
(symbolic link) file in the source directory. If the link is to a directory
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
onChange = mkOption {
|
onChange = mkOption {
|
||||||
type = types.lines;
|
type = types.lines;
|
||||||
default = "";
|
default = "";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue