Merge pull request #324102 from johannwagner/fix/cloud-init-fixes

nixos/cloud-init: Bug fix and enhancements
This commit is contained in:
Jonas Chevalier 2024-07-03 13:25:09 +02:00 committed by GitHub
commit f2506eaef6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -16,6 +16,7 @@ let
++ optional cfg.btrfs.enable btrfs-progs
++ optional cfg.ext4.enable e2fsprogs
++ optional cfg.xfs.enable xfsprogs
++ cfg.extraPackages
;
hasFs = fsName: lib.any (fs: fs.fsType == fsName) (lib.attrValues config.fileSystems);
settingsFormat = pkgs.formats.yaml { };
@ -79,6 +80,14 @@ in
'';
};
extraPackages = mkOption {
type = types.listOf types.package;
default = [ ];
description = ''
List of additional packages to be available within cloud-init jobs.
'';
};
settings = mkOption {
description = ''
Structured cloud-init configuration.
@ -163,7 +172,7 @@ in
{ text = cfg.config; }
;
systemd.network.enable = cfg.network.enable;
systemd.network.enable = mkIf cfg.network.enable true;
systemd.services.cloud-init-local = {
description = "Initial cloud-init job (pre-networking)";