diff --git a/tests/main.nix b/tests/main.nix index 8f2aec013a..3fe4fcb262 100644 --- a/tests/main.nix +++ b/tests/main.nix @@ -6,7 +6,6 @@ lib ? pkgs.lib, linkFarm, pkgs, - pkgsUnfree, self, system, }: @@ -29,8 +28,10 @@ let inherit self system; inherit (self) inputs; }; + nixpkgs.config = { + allowUnfree = true; + }; }; - pkgs = pkgsUnfree; }; # List of files containing configurations diff --git a/tests/test-sources/modules/nixpkgs.nix b/tests/test-sources/modules/nixpkgs.nix index 6efce76a93..54efc9977b 100644 --- a/tests/test-sources/modules/nixpkgs.nix +++ b/tests/test-sources/modules/nixpkgs.nix @@ -71,4 +71,25 @@ } ]; }; + + # Test that a nixpkgs revision can be specified using `nixpkgs.source` + source = + { pkgs, ... }: + { + test.runNvim = false; + + nixpkgs.source = builtins.fetchTarball { + url = "https://github.com/NixOS/nixpkgs/archive/1807c2b91223227ad5599d7067a61665c52d1295.tar.gz"; + sha256 = "0xnj86751780hg1zhx9rjkbjr0sx0wps4wxz7zryvrj6hgwrng1z"; + }; + + assertions = [ + { + assertion = pkgs.lib.version == "24.11pre-git"; + message = '' + Expected `pkgs.lib.version` to be "24.11pre-git", but found "${pkgs.lib.version}" + ''; + } + ]; + }; }