From 6764c2695483041e85a9fd382fbe3ba253109e51 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Mon, 11 Dec 2017 15:14:45 +0100 Subject: [PATCH] files: remove `mode` option This option was deprecated >1 month ago and is therefore removed as per the corresponding news entry. --- modules/files.nix | 22 ++-------------------- modules/lib/file-type.nix | 11 ----------- modules/misc/news.nix | 17 ----------------- 3 files changed, 2 insertions(+), 48 deletions(-) diff --git a/modules/files.nix b/modules/files.nix index 08d226da..b32fd54c 100644 --- a/modules/files.nix +++ b/modules/files.nix @@ -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 # overwrite an existing file. home.activation.checkLinkTargets = dagEntryBefore ["writeBoundary"] ( @@ -215,8 +202,7 @@ in nativeBuildInputs = [ pkgs.xlibs.lndir ]; # Symlink directories and files that have the right execute bit. - # Copy files that need their execute bit changed or use the - # deprecated 'mode' option. + # Copy files that need their execute bit changed. buildCommand = '' mkdir -p $out @@ -224,8 +210,7 @@ in local source="$1" local relTarget="$2" local executable="$3" - local mode="$4" # For backwards compatibility. - local recursive="$5" + local recursive="$4" # Figure out the real absolute path to the target. local target @@ -245,8 +230,6 @@ in else ln -s "$source" "$target" fi - elif [[ $mode ]]; then - install -m "$mode" "$source" "$target" else [[ -x $source ]] && isExecutable=1 || isExecutable="" @@ -283,7 +266,6 @@ in "${if v.executable == null then "inherit" else builtins.toString v.executable}" \ - "${builtins.toString v.mode}" \ "${builtins.toString v.recursive}" '') cfg ); diff --git a/modules/lib/file-type.nix b/modules/lib/file-type.nix index d8622d0c..80d4ab45 100644 --- a/modules/lib/file-type.nix +++ b/modules/lib/file-type.nix @@ -69,17 +69,6 @@ in ''; }; - mode = mkOption { - type = types.nullOr types.str; - default = null; - description = '' - The permissions to apply to the file. - - DEPRECATED: use home.file.<name?>.executable - instead. - ''; - }; - executable = mkOption { type = types.nullOr types.bool; default = null; diff --git a/modules/misc/news.nix b/modules/misc/news.nix index 95c94578..4dfedd39 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -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..mode - - option is now deprecated. Please use - - home.file..executable - - instead. The 'mode' option will be completely removed - December 6, 2017. - ''; - } - { time = "2017-11-12T00:18:59+00:00"; message = ''