Skip to content

Commit d4128ea

Browse files
don't use import in case hermetic = true + config
closes nix-community#58
1 parent e379a5f commit d4128ea

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

deploy_nixos/nixos-instantiate.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,16 @@ command=(nix-instantiate --show-trace --expr '
2727
if flake
2828
then importFromFlake { nixosConfig = configuration; }
2929
else if hermetic
30-
then import configuration
31-
else import <nixpkgs/nixos> { inherit system configuration; };
30+
then
31+
(
32+
if builtins.isString configuration
33+
# case: nixos_config i.e. file path
34+
then import configuration
35+
# case: config i.e. the module expression itself
36+
else configuration
37+
)
38+
else
39+
import <nixpkgs/nixos> { inherit system configuration; };
3240
in {
3341
inherit (builtins) currentSystem;
3442

0 commit comments

Comments
 (0)