cloud-init module: fix default settings (#231867)

The `//` operator doesn't do deep merge so it was overriding the first
attrset and not recording the defaults.
This commit is contained in:
Jonas Chevalier 2023-05-14 22:35:06 +02:00 committed by GitHub
parent 193efb0bcd
commit 9c63dd372d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -90,7 +90,7 @@ in
}; };
config = { config = mkIf cfg.enable {
services.cloud-init.settings = { services.cloud-init.settings = {
system_info = mkDefault { system_info = mkDefault {
distro = "nixos"; distro = "nixos";
@ -142,7 +142,6 @@ in
"power-state-change" "power-state-change"
]; ];
}; };
} // (mkIf cfg.enable {
environment.etc."cloud/cloud.cfg" = environment.etc."cloud/cloud.cfg" =
if cfg.config == "" then if cfg.config == "" then
@ -225,5 +224,7 @@ in
description = "Cloud-config availability"; description = "Cloud-config availability";
requires = [ "cloud-init-local.service" "cloud-init.service" ]; requires = [ "cloud-init-local.service" "cloud-init.service" ];
}; };
}); };
meta.maintainers = [ maintainers.zimbatm ];
} }