about summary refs log tree commit diff
path: root/nixos/modules/rename.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/modules/rename.nix')
-rw-r--r--nixos/modules/rename.nix16
1 files changed, 15 insertions, 1 deletions
diff --git a/nixos/modules/rename.nix b/nixos/modules/rename.nix
index 3e3f6dd10c10..ca3bdc08a8d8 100644
--- a/nixos/modules/rename.nix
+++ b/nixos/modules/rename.nix
@@ -30,7 +30,8 @@ let
     zipAttrsWith (n: v:
       if tail v != [] then
         if n == "_type" then (head v)
-        else if n == "extraConfigs" then (concatLists v)
+        else if n == "extraConfigs" then concatLists v
+        else if n == "warnings" then concatLists v
         else if n == "description" || n == "apply" then
           abort "Cannot rename an option to multiple options."
         else zipModules v
@@ -62,6 +63,15 @@ let
         }
       ];
 
+  obsolete' = option: let option' = splitString "." option; in singleton
+    { options = setAttrByPath option' (mkOption {
+        default = null;
+        visible = false;
+      });
+      config.warnings = optional (getAttrFromPath option' config != null)
+        "The option `${option}' set in your configuration no longer has any effect; please remove it.";
+    };
+
 in zipModules ([]
 
 # usage example:
@@ -108,4 +118,8 @@ in zipModules ([]
 # !!! this hardcodes bash, could we detect from config which shell is actually used?
 ++ rename obsolete "environment.promptInit" "programs.bash.promptInit"
 
+# Options that are obsolete and have no replacement.
+++ obsolete' "boot.loader.grub.bootDevice"
+++ obsolete' "boot.initrd.luks.enable"
+
 ) # do not add renaming after this.