diff options
author | Robert Hensing <robert@roberthensing.nl> | 2021-12-03 12:04:36 +0000 |
---|---|---|
committer | Robert Hensing <robert@roberthensing.nl> | 2022-01-10 12:26:59 +0100 |
commit | be3967e351b6e1b010e95ec16217ed2db33da0c5 (patch) | |
tree | b91857857e9a49333102267e26a4ad068265b31f /nixos | |
parent | fbd038eca24703d8c5cc3ce28adda3e71c5fabf4 (diff) | |
download | nixlib-be3967e351b6e1b010e95ec16217ed2db33da0c5.tar nixlib-be3967e351b6e1b010e95ec16217ed2db33da0c5.tar.gz nixlib-be3967e351b6e1b010e95ec16217ed2db33da0c5.tar.bz2 nixlib-be3967e351b6e1b010e95ec16217ed2db33da0c5.tar.lz nixlib-be3967e351b6e1b010e95ec16217ed2db33da0c5.tar.xz nixlib-be3967e351b6e1b010e95ec16217ed2db33da0c5.tar.zst nixlib-be3967e351b6e1b010e95ec16217ed2db33da0c5.zip |
nixos/nixpkgs.nix: Make independent
(cherry picked from commit 62e7f0eda1c5acf0beb13a00a23f577912a6b8eb)
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/misc/nixpkgs.nix | 5 | ||||
-rw-r--r-- | nixos/modules/misc/nixpkgs/test.nix | 8 | ||||
-rw-r--r-- | nixos/tests/all-tests.nix | 4 |
3 files changed, 17 insertions, 0 deletions
diff --git a/nixos/modules/misc/nixpkgs.nix b/nixos/modules/misc/nixpkgs.nix index 2e0c8e4cf2c4..69967c8a7601 100644 --- a/nixos/modules/misc/nixpkgs.nix +++ b/nixos/modules/misc/nixpkgs.nix @@ -64,6 +64,11 @@ let in { + imports = [ + ./assertions.nix + ./meta.nix + ]; + options.nixpkgs = { pkgs = mkOption { diff --git a/nixos/modules/misc/nixpkgs/test.nix b/nixos/modules/misc/nixpkgs/test.nix new file mode 100644 index 000000000000..ec5fab9fb4a5 --- /dev/null +++ b/nixos/modules/misc/nixpkgs/test.nix @@ -0,0 +1,8 @@ +{ evalMinimalConfig, pkgs, lib, stdenv }: +lib.recurseIntoAttrs { + invokeNixpkgsSimple = + (evalMinimalConfig ({ config, modulesPath, ... }: { + imports = [ (modulesPath + "/misc/nixpkgs.nix") ]; + nixpkgs.system = stdenv.hostPlatform.system; + }))._module.args.pkgs.hello; +} diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 4f62980e8e91..d7971f6c2eb7 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -19,6 +19,9 @@ let handleTestOn = systems: path: args: if elem system systems then handleTest path args else {}; + + nixosLib = import ../lib {}; + evalMinimalConfig = module: nixosLib.evalModules { modules = [ module ]; }; in { _3proxy = handleTest ./3proxy.nix {}; @@ -327,6 +330,7 @@ in nix-serve-ssh = handleTest ./nix-serve-ssh.nix {}; nixops = handleTest ./nixops/default.nix {}; nixos-generate-config = handleTest ./nixos-generate-config.nix {}; + nixpkgs = pkgs.callPackage ../modules/misc/nixpkgs/test.nix { inherit evalMinimalConfig; }; node-red = handleTest ./node-red.nix {}; nomad = handleTest ./nomad.nix {}; novacomd = handleTestOn ["x86_64-linux"] ./novacomd.nix {}; |