Skip to content

Commit 5103fad

Browse files
songpolaastro
authored andcommitted
fix: allow flake reference updates when updateFlake is null
1 parent 901c80e commit 5103fad

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

nixos-modules/host/default.nix

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ in
7272
];
7373
partOf = [ "microvm@${name}.service" ];
7474
wantedBy = [ "microvms.target" ];
75-
# Only run this if the MicroVM is fully-declarative
76-
# or /var/lib/microvms/$name does not exist yet.
77-
unitConfig.ConditionPathExists = lib.mkIf isFlake "!${stateDir}/${name}";
75+
# Run on every rebuild for fully-declarative MicroVMs and flake-based MicroVMs without updateFlake.
76+
# For MicroVMs with updateFlake set, only run on initial installation.
77+
unitConfig.ConditionPathExists = lib.mkIf (isFlake && updateFlake != null) "!${stateDir}/${name}";
7878
serviceConfig.Type = "oneshot";
7979
script = ''
8080
mkdir -p ${stateDir}/${name}

0 commit comments

Comments
 (0)