modules/nixpkgs: construct an instance of nixpkgs.source

This commit is contained in:
Matt Sturgeon 2024-10-19 22:59:48 +01:00
parent 8dc8fa38b0
commit 912841c1a7
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
3 changed files with 81 additions and 37 deletions

15
tests/nixpkgs-mock.nix Normal file
View file

@ -0,0 +1,15 @@
# This mock nixpkgs can be used as `nixpkgs.source` in nixpkgs-module-test
# if we want/need to avoid importing & instantiating a real nixpkgs
{
config ? { },
...
}:
let
pkgs = {
_type = "pkgs";
__splicedPackages = pkgs;
inherit config pkgs;
mock = true;
};
in
pkgs