files: remove mode option

This option was deprecated >1 month ago and is therefore removed as
per the corresponding news entry.
This commit is contained in:
Robert Helgesson 2017-12-11 15:14:45 +01:00
parent 040159c02f
commit 6764c26954
No known key found for this signature in database
GPG key ID: C3DB11069E65DC86
3 changed files with 2 additions and 48 deletions

View file

@ -49,19 +49,6 @@ in
}) })
]; ];
warnings =
let
badFiles =
map (f: f.target)
(filter (f: f.mode != null)
(attrValues cfg));
badFilesStr = toString badFiles;
in
mkIf (badFiles != []) [
("The 'mode' field is deprecated for 'home.file', "
+ "use 'executable' instead: ${badFilesStr}")
];
# This verifies that the links we are about to create will not # This verifies that the links we are about to create will not
# overwrite an existing file. # overwrite an existing file.
home.activation.checkLinkTargets = dagEntryBefore ["writeBoundary"] ( home.activation.checkLinkTargets = dagEntryBefore ["writeBoundary"] (
@ -215,8 +202,7 @@ in
nativeBuildInputs = [ pkgs.xlibs.lndir ]; nativeBuildInputs = [ pkgs.xlibs.lndir ];
# Symlink directories and files that have the right execute bit. # Symlink directories and files that have the right execute bit.
# Copy files that need their execute bit changed or use the # Copy files that need their execute bit changed.
# deprecated 'mode' option.
buildCommand = '' buildCommand = ''
mkdir -p $out mkdir -p $out
@ -224,8 +210,7 @@ in
local source="$1" local source="$1"
local relTarget="$2" local relTarget="$2"
local executable="$3" local executable="$3"
local mode="$4" # For backwards compatibility. local recursive="$4"
local recursive="$5"
# Figure out the real absolute path to the target. # Figure out the real absolute path to the target.
local target local target
@ -245,8 +230,6 @@ in
else else
ln -s "$source" "$target" ln -s "$source" "$target"
fi fi
elif [[ $mode ]]; then
install -m "$mode" "$source" "$target"
else else
[[ -x $source ]] && isExecutable=1 || isExecutable="" [[ -x $source ]] && isExecutable=1 || isExecutable=""
@ -283,7 +266,6 @@ in
"${if v.executable == null "${if v.executable == null
then "inherit" then "inherit"
else builtins.toString v.executable}" \ else builtins.toString v.executable}" \
"${builtins.toString v.mode}" \
"${builtins.toString v.recursive}" "${builtins.toString v.recursive}"
'') cfg '') cfg
); );

View file

@ -69,17 +69,6 @@ in
''; '';
}; };
mode = mkOption {
type = types.nullOr types.str;
default = null;
description = ''
The permissions to apply to the file.
</para><para>
DEPRECATED: use <varname>home.file.&lt;name?&gt;.executable</varname>
instead.
'';
};
executable = mkOption { executable = mkOption {
type = types.nullOr types.bool; type = types.nullOr types.bool;
default = null; default = null;

View file

@ -416,23 +416,6 @@ in
''; '';
} }
{
time = "2017-11-06T13:23:17+00:00";
condition = any (f: f.mode != null) (attrValues config.home.file);
message = ''
The
home.file.<name?>.mode
option is now deprecated. Please use
home.file.<name?>.executable
instead. The 'mode' option will be completely removed
December 6, 2017.
'';
}
{ {
time = "2017-11-12T00:18:59+00:00"; time = "2017-11-12T00:18:59+00:00";
message = '' message = ''