From 62e7f0eda1c5acf0beb13a00a23f577912a6b8eb Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Fri, 3 Dec 2021 12:04:36 +0000 Subject: [PATCH] nixos/nixpkgs.nix: Make independent --- nixos/modules/misc/nixpkgs.nix | 2 ++ nixos/modules/misc/nixpkgs/test.nix | 8 ++++++++ nixos/tests/all-tests.nix | 1 + 3 files changed, 11 insertions(+) create mode 100644 nixos/modules/misc/nixpkgs/test.nix diff --git a/nixos/modules/misc/nixpkgs.nix b/nixos/modules/misc/nixpkgs.nix index 08bc4398555b..9098ae53790a 100644 --- a/nixos/modules/misc/nixpkgs.nix +++ b/nixos/modules/misc/nixpkgs.nix @@ -64,6 +64,8 @@ let in { + imports = [ ./assertions.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..c2fe3657d420 --- /dev/null +++ b/nixos/modules/misc/nixpkgs/test.nix @@ -0,0 +1,8 @@ +{ lib, stdenv }: +lib.recurseIntoAttrs { + invokeNixpkgsSimple = + (lib.nixos.core ({ config, modules, ... }: { + imports = [ modules.invokeNixpkgs ]; + nixpkgs.system = stdenv.hostPlatform.system; + }))._module.args.pkgs.hello; +} diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 63be67892017..62ac35bf290d 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -322,6 +322,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 { }; node-red = handleTest ./node-red.nix {}; nomad = handleTest ./nomad.nix {}; novacomd = handleTestOn ["x86_64-linux"] ./novacomd.nix {};