about summary refs log tree commit diff
path: root/nixpkgs/lib
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-02-26 23:32:33 +0000
committerAlyssa Ross <hi@alyssa.is>2019-02-26 23:32:33 +0000
commit1bf6dffc1145dcf54c2b60d8a72cd384de0ef0b5 (patch)
treecba73be7e3108dca51f75c9ec44a8bd61246b11a /nixpkgs/lib
parentdb8291322dd83add2250dd4480b46298655cbfba (diff)
parent1233c8d9e9bc463899ed6a8cf0232e6bf36475ee (diff)
downloadnixlib-1bf6dffc1145dcf54c2b60d8a72cd384de0ef0b5.tar
nixlib-1bf6dffc1145dcf54c2b60d8a72cd384de0ef0b5.tar.gz
nixlib-1bf6dffc1145dcf54c2b60d8a72cd384de0ef0b5.tar.bz2
nixlib-1bf6dffc1145dcf54c2b60d8a72cd384de0ef0b5.tar.lz
nixlib-1bf6dffc1145dcf54c2b60d8a72cd384de0ef0b5.tar.xz
nixlib-1bf6dffc1145dcf54c2b60d8a72cd384de0ef0b5.tar.zst
nixlib-1bf6dffc1145dcf54c2b60d8a72cd384de0ef0b5.zip
Merge commit '1233c8d9e9bc463899ed6a8cf0232e6bf36475ee'
Diffstat (limited to 'nixpkgs/lib')
-rw-r--r--nixpkgs/lib/default.nix2
-rw-r--r--nixpkgs/lib/licenses.nix5
-rw-r--r--nixpkgs/lib/modules.nix14
-rwxr-xr-xnixpkgs/lib/tests/modules.sh2
-rw-r--r--nixpkgs/lib/tests/modules/alias-with-priority-can-override.nix9
-rw-r--r--nixpkgs/lib/tests/modules/alias-with-priority.nix5
-rw-r--r--nixpkgs/lib/trivial.nix2
7 files changed, 22 insertions, 17 deletions
diff --git a/nixpkgs/lib/default.nix b/nixpkgs/lib/default.nix
index d400907ebb0c..dbb90081b2c3 100644
--- a/nixpkgs/lib/default.nix
+++ b/nixpkgs/lib/default.nix
@@ -109,7 +109,7 @@ let
       mkFixStrictness mkOrder mkBefore mkAfter mkAliasDefinitions
       mkAliasAndWrapDefinitions fixMergeModules mkRemovedOptionModule
       mkRenamedOptionModule mkMergedOptionModule mkChangedOptionModule
-      mkAliasOptionModule mkAliasOptionModuleWithPriority doRename filterModules;
+      mkAliasOptionModule doRename filterModules;
     inherit (options) isOption mkEnableOption mkSinkUndeclaredOptions
       mergeDefaultOption mergeOneOption mergeEqualOption getValues
       getFiles optionAttrSetToDocList optionAttrSetToDocList'
diff --git a/nixpkgs/lib/licenses.nix b/nixpkgs/lib/licenses.nix
index b022d8bc11bf..d285ba2ea0aa 100644
--- a/nixpkgs/lib/licenses.nix
+++ b/nixpkgs/lib/licenses.nix
@@ -561,6 +561,11 @@ lib.mapAttrs (n: v: v // { shortName = n; }) rec {
     fullName = "OpenSSL License";
   };
 
+  osl2 = spdx {
+    spdxId = "OSL-2.0";
+    fullName = "Open Software License 2.0";
+  };
+
   osl21 = spdx {
     spdxId = "OSL-2.1";
     fullName = "Open Software License 2.1";
diff --git a/nixpkgs/lib/modules.nix b/nixpkgs/lib/modules.nix
index 5c9d66d8f97b..a41c9da610ac 100644
--- a/nixpkgs/lib/modules.nix
+++ b/nixpkgs/lib/modules.nix
@@ -596,6 +596,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;
@@ -690,16 +693,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;
diff --git a/nixpkgs/lib/tests/modules.sh b/nixpkgs/lib/tests/modules.sh
index a72777cbf2a6..eadaa0521b35 100755
--- a/nixpkgs/lib/tests/modules.sh
+++ b/nixpkgs/lib/tests/modules.sh
@@ -149,7 +149,7 @@ checkConfigOutput "1 2 3 4 5 6 7 8 9 10" config.result ./loaOf-with-long-list.ni
 # Check loaOf with many merges of lists.
 checkConfigOutput "1 2 3 4 5 6 7 8 9 10" config.result ./loaOf-with-many-list-merges.nix
 
-# Check mkAliasOptionModuleWithPriority.
+# Check mkAliasOptionModule.
 checkConfigOutput "true" config.enable ./alias-with-priority.nix
 checkConfigOutput "true" config.enableAlias ./alias-with-priority.nix
 checkConfigOutput "false" config.enable ./alias-with-priority-can-override.nix
diff --git a/nixpkgs/lib/tests/modules/alias-with-priority-can-override.nix b/nixpkgs/lib/tests/modules/alias-with-priority-can-override.nix
index a6b26895f3a8..9a18c9d9f613 100644
--- a/nixpkgs/lib/tests/modules/alias-with-priority-can-override.nix
+++ b/nixpkgs/lib/tests/modules/alias-with-priority-can-override.nix
@@ -1,5 +1,8 @@
 # This is a test to show that mkAliasOptionModule sets the priority correctly
 # for aliased options.
+#
+# This test shows that an alias with a high priority is able to override
+# a non-aliased option.
 
 { config, lib, ... }:
 
@@ -32,10 +35,10 @@ with lib;
 
   imports = [
     # Create an alias for the "enable" option.
-    (mkAliasOptionModuleWithPriority [ "enableAlias" ] [ "enable" ])
+    (mkAliasOptionModule [ "enableAlias" ] [ "enable" ])
 
-    # Disable the aliased option, but with a default (low) priority so it
-    # should be able to be overridden by the next import.
+    # Disable the aliased option with a high priority so it
+    # should override the next import.
     ( { config, lib, ... }:
       {
         enableAlias = lib.mkForce false;
diff --git a/nixpkgs/lib/tests/modules/alias-with-priority.nix b/nixpkgs/lib/tests/modules/alias-with-priority.nix
index 923483684cb1..a35a06fc6974 100644
--- a/nixpkgs/lib/tests/modules/alias-with-priority.nix
+++ b/nixpkgs/lib/tests/modules/alias-with-priority.nix
@@ -1,5 +1,8 @@
 # This is a test to show that mkAliasOptionModule sets the priority correctly
 # for aliased options.
+#
+# This test shows that an alias with a low priority is able to be overridden
+# with a non-aliased option.
 
 { config, lib, ... }:
 
@@ -32,7 +35,7 @@ with lib;
 
   imports = [
     # Create an alias for the "enable" option.
-    (mkAliasOptionModuleWithPriority [ "enableAlias" ] [ "enable" ])
+    (mkAliasOptionModule [ "enableAlias" ] [ "enable" ])
 
     # Disable the aliased option, but with a default (low) priority so it
     # should be able to be overridden by the next import.
diff --git a/nixpkgs/lib/trivial.nix b/nixpkgs/lib/trivial.nix
index 17489311236d..3f0816b55405 100644
--- a/nixpkgs/lib/trivial.nix
+++ b/nixpkgs/lib/trivial.nix
@@ -134,7 +134,7 @@ rec {
      On each release the first letter is bumped and a new animal is chosen
      starting with that new letter.
   */
-  codeName = "Koi";
+  codeName = "Loris";
 
   /* Returns the current nixpkgs version suffix as string. */
   versionSuffix =