Skip to content

Commit

Permalink
tests: test nixpkgs.source
Browse files Browse the repository at this point in the history
  • Loading branch information
MattSturgeon committed Dec 23, 2024
1 parent 459c5d1 commit a5044b0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/main.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
lib ? pkgs.lib,
linkFarm,
pkgs,
pkgsUnfree,
self,
system,
}:
Expand All @@ -29,8 +28,10 @@ let
inherit self system;
inherit (self) inputs;
};
nixpkgs.config = {
allowUnfree = true;
};
};
pkgs = pkgsUnfree;
};

# List of files containing configurations
Expand Down
21 changes: 21 additions & 0 deletions tests/test-sources/modules/nixpkgs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
'';
}
];
};
}

0 comments on commit a5044b0

Please sign in to comment.