forked from DGNum/colmena
eval.nix: Accept path-likes in meta.nixpkgs as well
This fixes usage with Niv.
This commit is contained in:
parent
b87da69558
commit
1cd3aa6401
2 changed files with 17 additions and 1 deletions
|
@ -80,7 +80,7 @@ let
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
if typeOf pkgConf == "path" then
|
if typeOf pkgConf == "path" || (typeOf pkgConf == "set" && pkgConf ? outPath) then
|
||||||
if hermetic then throw (uninitializedError "a path to Nixpkgs")
|
if hermetic then throw (uninitializedError "a path to Nixpkgs")
|
||||||
# The referenced file might return an initialized Nixpkgs attribute set directly
|
# The referenced file might return an initialized Nixpkgs attribute set directly
|
||||||
else mkNixpkgs configName (import pkgConf)
|
else mkNixpkgs configName (import pkgConf)
|
||||||
|
|
|
@ -319,6 +319,22 @@ fn test_nixpkgs_system() {
|
||||||
"#);
|
"#);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_nixpkgs_path_like() {
|
||||||
|
TempHive::valid(r#"
|
||||||
|
{
|
||||||
|
meta = {
|
||||||
|
nixpkgs = {
|
||||||
|
outPath = <nixpkgs>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
test = { pkgs, ... }: {
|
||||||
|
boot.isContainer = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
"#);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_nixpkgs_overlay_meta_nixpkgs() {
|
fn test_nixpkgs_overlay_meta_nixpkgs() {
|
||||||
// Only set overlays in meta.nixpkgs
|
// Only set overlays in meta.nixpkgs
|
||||||
|
|
Loading…
Reference in a new issue