diff options
author | Shea Levy <shea@shealevy.com> | 2018-01-31 14:02:19 -0500 |
---|---|---|
committer | Shea Levy <shea@shealevy.com> | 2018-01-31 14:02:19 -0500 |
commit | 943592f69850fd07dd2422da062b1c1ebc45974d (patch) | |
tree | 3376a06cd3ab25a1622c8f320573ab09b55a9470 /nixos | |
parent | 0d7a0d7572d35526ddf34b6d011b7b88a8904b36 (diff) | |
download | nixpkgs-943592f69850fd07dd2422da062b1c1ebc45974d.tar nixpkgs-943592f69850fd07dd2422da062b1c1ebc45974d.tar.gz nixpkgs-943592f69850fd07dd2422da062b1c1ebc45974d.tar.bz2 nixpkgs-943592f69850fd07dd2422da062b1c1ebc45974d.tar.lz nixpkgs-943592f69850fd07dd2422da062b1c1ebc45974d.tar.xz nixpkgs-943592f69850fd07dd2422da062b1c1ebc45974d.tar.zst nixpkgs-943592f69850fd07dd2422da062b1c1ebc45974d.zip |
Add setFunctionArgs lib function.
Among other things, this will allow *2nix tools to output plain data while still being composable with the traditional callPackage/.override interfaces.
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/doc/manual/default.nix | 2 | ||||
-rw-r--r-- | nixos/lib/testing.nix | 2 | ||||
-rw-r--r-- | nixos/modules/misc/nixpkgs.nix | 6 | ||||
-rw-r--r-- | nixos/modules/profiles/clone-config.nix | 2 | ||||
-rw-r--r-- | nixos/tests/make-test.nix | 2 |
5 files changed, 7 insertions, 7 deletions
diff --git a/nixos/doc/manual/default.nix b/nixos/doc/manual/default.nix index 9bc83be6610..8079a2feb29 100644 --- a/nixos/doc/manual/default.nix +++ b/nixos/doc/manual/default.nix @@ -12,7 +12,7 @@ let substFunction = x: if builtins.isAttrs x then lib.mapAttrs (name: substFunction) x else if builtins.isList x then map substFunction x - else if builtins.isFunction x then "<function>" + else if lib.isFunction x then "<function>" else x; # Clean up declaration sites to not refer to the NixOS source tree. diff --git a/nixos/lib/testing.nix b/nixos/lib/testing.nix index 532fff681d3..cf213d906f5 100644 --- a/nixos/lib/testing.nix +++ b/nixos/lib/testing.nix @@ -85,7 +85,7 @@ rec { testScript' = # Call the test script with the computed nodes. - if builtins.isFunction testScript + if lib.isFunction testScript then testScript { inherit nodes; } else testScript; diff --git a/nixos/modules/misc/nixpkgs.nix b/nixos/modules/misc/nixpkgs.nix index 1793c1447d6..b01f5431909 100644 --- a/nixos/modules/misc/nixpkgs.nix +++ b/nixos/modules/misc/nixpkgs.nix @@ -4,10 +4,10 @@ with lib; let isConfig = x: - builtins.isAttrs x || builtins.isFunction x; + builtins.isAttrs x || lib.isFunction x; optCall = f: x: - if builtins.isFunction f + if lib.isFunction f then f x else f; @@ -38,7 +38,7 @@ let overlayType = mkOptionType { name = "nixpkgs-overlay"; description = "nixpkgs overlay"; - check = builtins.isFunction; + check = lib.isFunction; merge = lib.mergeOneOption; }; diff --git a/nixos/modules/profiles/clone-config.nix b/nixos/modules/profiles/clone-config.nix index 77d86f8d740..5b4e68beb6a 100644 --- a/nixos/modules/profiles/clone-config.nix +++ b/nixos/modules/profiles/clone-config.nix @@ -17,7 +17,7 @@ let # you should use files). moduleFiles = # FIXME: use typeOf (Nix 1.6.1). - filter (x: !isAttrs x && !builtins.isFunction x) modules; + filter (x: !isAttrs x && !lib.isFunction x) modules; # Partition module files because between NixOS and non-NixOS files. NixOS # files may change if the repository is updated. diff --git a/nixos/tests/make-test.nix b/nixos/tests/make-test.nix index f3e26aa7e74..1b571a008e0 100644 --- a/nixos/tests/make-test.nix +++ b/nixos/tests/make-test.nix @@ -2,4 +2,4 @@ f: { system ? builtins.currentSystem, ... } @ args: with import ../lib/testing.nix { inherit system; }; -makeTest (if builtins.isFunction f then f (args // { inherit pkgs; inherit (pkgs) lib; }) else f) +makeTest (if lib.isFunction f then f (args // { inherit pkgs; inherit (pkgs) lib; }) else f) |