summary refs log tree commit diff
path: root/lib/modules.nix
diff options
context:
space:
mode:
author(cdep)illabout <cdep.illabout@gmail.com>2019-01-24 12:58:33 +0900
committer(cdep)illabout <cdep.illabout@gmail.com>2019-01-24 13:02:16 +0900
commit81fa1e392be44585fe83e26921ce3bd720891def (patch)
tree7c551320ca703cc7684fa7d2e0f85d0f364d2053 /lib/modules.nix
parent0abf1810668ec8df0321156b0675519610513100 (diff)
downloadnixpkgs-81fa1e392be44585fe83e26921ce3bd720891def.tar
nixpkgs-81fa1e392be44585fe83e26921ce3bd720891def.tar.gz
nixpkgs-81fa1e392be44585fe83e26921ce3bd720891def.tar.bz2
nixpkgs-81fa1e392be44585fe83e26921ce3bd720891def.tar.lz
nixpkgs-81fa1e392be44585fe83e26921ce3bd720891def.tar.xz
nixpkgs-81fa1e392be44585fe83e26921ce3bd720891def.tar.zst
nixpkgs-81fa1e392be44585fe83e26921ce3bd720891def.zip
lib/modules: Change mkAliasOptionModule to use the priority for the alias.
This commit changes the `mkAliasOptionModule` function to make sure that
the priority for the aliased option is propagated to the non-aliased
option.

This also affects the `mkRenamedOptionModule` function in a similar
fashion.

This also removes the `mkAliasOptionModuleWithPriority` function, since
its functionality is now subsumed by `mkAliasOptionModule`.

This change was recommended by @nbp:
https://github.com/NixOS/nixpkgs/pull/53397#discussion_r245487432
Diffstat (limited to 'lib/modules.nix')
-rw-r--r--lib/modules.nix14
1 files changed, 4 insertions, 10 deletions
diff --git a/lib/modules.nix b/lib/modules.nix
index 9f8e196ee0f..a599f5f4d77 100644
--- a/lib/modules.nix
+++ b/lib/modules.nix
@@ -609,6 +609,9 @@ rec {
 
      forwards any definitions of boot.copyKernels to
      boot.loader.grub.copyKernels while printing a warning.
+
+     This also copies over the priority from the aliased option to the
+     non-aliased option.
   */
   mkRenamedOptionModule = from: to: doRename {
     inherit from to;
@@ -703,16 +706,7 @@ rec {
     use = id;
   };
 
-  /* Like ‘mkAliasOptionModule’, but copy over the priority of the option as well. */
-  mkAliasOptionModuleWithPriority = from: to: doRename {
-    inherit from to;
-    visible = true;
-    warn = false;
-    use = id;
-    withPriority = true;
-  };
-
-  doRename = { from, to, visible, warn, use, withPriority ? false }:
+  doRename = { from, to, visible, warn, use, withPriority ? true }:
     { config, options, ... }:
     let
       fromOpt = getAttrFromPath from options;