summary refs log tree commit diff
path: root/lib/default.nix
diff options
context:
space:
mode:
author(cdep)illabout <cdep.illabout@gmail.com>2019-01-03 23:15:01 +0900
committer(cdep)illabout <cdep.illabout@gmail.com>2019-01-04 18:35:10 +0900
commitb81b3ad1b052aeb2edcf493167df7348b7bfb293 (patch)
treecbbd8cfdc23e362ab18763caea1c44808e2dd6ee /lib/default.nix
parentda00ec4b45f5cfc5b47825818b57db1d1950757d (diff)
downloadnixpkgs-b81b3ad1b052aeb2edcf493167df7348b7bfb293.tar
nixpkgs-b81b3ad1b052aeb2edcf493167df7348b7bfb293.tar.gz
nixpkgs-b81b3ad1b052aeb2edcf493167df7348b7bfb293.tar.bz2
nixpkgs-b81b3ad1b052aeb2edcf493167df7348b7bfb293.tar.lz
nixpkgs-b81b3ad1b052aeb2edcf493167df7348b7bfb293.tar.xz
nixpkgs-b81b3ad1b052aeb2edcf493167df7348b7bfb293.tar.zst
nixpkgs-b81b3ad1b052aeb2edcf493167df7348b7bfb293.zip
lib/modules: Add a function to create an option alias that respects the priority
This commit adds a function `mkAliasOptionModuleWithPriority`.  This
function will make an alias to an existing option and copy over the
priority.

This functionality is needed for PRs like #53041.  In that case
`nixos-generate-config` added an option to `hardware-configuration.nix`
with `mkDefault`.  That option was then changed and an alias created for
the old name.

The end user should be able to set the non-alias option in their
`configuration.nix` and have everything work correctly.  Without this
function, the priority for the option won't be copied over correctly
and the end-user will get a message saying they have the same option
set to two different values.
Diffstat (limited to 'lib/default.nix')
-rw-r--r--lib/default.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/default.nix b/lib/default.nix
index 916f6e05190..17a74cd2135 100644
--- a/lib/default.nix
+++ b/lib/default.nix
@@ -109,7 +109,7 @@ let
       mkFixStrictness mkOrder mkBefore mkAfter mkAliasDefinitions
       mkAliasAndWrapDefinitions fixMergeModules mkRemovedOptionModule
       mkRenamedOptionModule mkMergedOptionModule mkChangedOptionModule
-      mkAliasOptionModule doRename filterModules;
+      mkAliasOptionModule mkAliasOptionModuleWithPriority doRename filterModules;
     inherit (options) isOption mkEnableOption mkSinkUndeclaredOptions
       mergeDefaultOption mergeOneOption mergeEqualOption getValues
       getFiles optionAttrSetToDocList optionAttrSetToDocList'