diff --git a/src/nix/hive/eval.nix b/src/nix/hive/eval.nix index ac15f8c..48e4bc0 100644 --- a/src/nix/hive/eval.nix +++ b/src/nix/hive/eval.nix @@ -80,7 +80,7 @@ let } ''; 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") # The referenced file might return an initialized Nixpkgs attribute set directly else mkNixpkgs configName (import pkgConf) diff --git a/src/nix/hive/tests/mod.rs b/src/nix/hive/tests/mod.rs index 67700e6..323eaf0 100644 --- a/src/nix/hive/tests/mod.rs +++ b/src/nix/hive/tests/mod.rs @@ -319,6 +319,22 @@ fn test_nixpkgs_system() { "#); } +#[test] +fn test_nixpkgs_path_like() { + TempHive::valid(r#" + { + meta = { + nixpkgs = { + outPath = ; + }; + }; + test = { pkgs, ... }: { + boot.isContainer = true; + }; + } + "#); +} + #[test] fn test_nixpkgs_overlay_meta_nixpkgs() { // Only set overlays in meta.nixpkgs