Skip to content

Commit a5044b0

Browse files
committed
tests: test nixpkgs.source
1 parent 459c5d1 commit a5044b0

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

tests/main.nix

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
lib ? pkgs.lib,
77
linkFarm,
88
pkgs,
9-
pkgsUnfree,
109
self,
1110
system,
1211
}:
@@ -29,8 +28,10 @@ let
2928
inherit self system;
3029
inherit (self) inputs;
3130
};
31+
nixpkgs.config = {
32+
allowUnfree = true;
33+
};
3234
};
33-
pkgs = pkgsUnfree;
3435
};
3536

3637
# List of files containing configurations

tests/test-sources/modules/nixpkgs.nix

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,25 @@
7171
}
7272
];
7373
};
74+
75+
# Test that a nixpkgs revision can be specified using `nixpkgs.source`
76+
source =
77+
{ pkgs, ... }:
78+
{
79+
test.runNvim = false;
80+
81+
nixpkgs.source = builtins.fetchTarball {
82+
url = "https://github.com/NixOS/nixpkgs/archive/1807c2b91223227ad5599d7067a61665c52d1295.tar.gz";
83+
sha256 = "0xnj86751780hg1zhx9rjkbjr0sx0wps4wxz7zryvrj6hgwrng1z";
84+
};
85+
86+
assertions = [
87+
{
88+
assertion = pkgs.lib.version == "24.11pre-git";
89+
message = ''
90+
Expected `pkgs.lib.version` to be "24.11pre-git", but found "${pkgs.lib.version}"
91+
'';
92+
}
93+
];
94+
};
7495
}

0 commit comments

Comments
 (0)