mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-04-15 14:08:04 +00:00
cloud-init: enable filesystems based on what is used
This commit is contained in:
parent
5e73f0c1c9
commit
3d14617fc7
@ -17,6 +17,7 @@ let
|
||||
++ optional cfg.ext4.enable e2fsprogs
|
||||
++ optional cfg.xfs.enable xfsprogs
|
||||
;
|
||||
hasFs = fsName: lib.any (fs: fs.fsType == fsName) (lib.attrValues config.fileSystems);
|
||||
settingsFormat = pkgs.formats.yaml { };
|
||||
cfgfile = settingsFormat.generate "cloud.cfg" cfg.settings;
|
||||
in
|
||||
@ -44,7 +45,8 @@ in
|
||||
|
||||
btrfs.enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
default = hasFs "btrfs";
|
||||
defaultText = literalExpression ''hasFs "btrfs"'';
|
||||
description = mdDoc ''
|
||||
Allow the cloud-init service to operate `btrfs` filesystem.
|
||||
'';
|
||||
@ -52,7 +54,8 @@ in
|
||||
|
||||
ext4.enable = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
default = hasFs "ext4";
|
||||
defaultText = literalExpression ''hasFs "ext4"'';
|
||||
description = mdDoc ''
|
||||
Allow the cloud-init service to operate `ext4` filesystem.
|
||||
'';
|
||||
@ -60,7 +63,8 @@ in
|
||||
|
||||
xfs.enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
default = hasFs "xfs";
|
||||
defaultText = literalExpression ''hasFs "xfs"'';
|
||||
description = mdDoc ''
|
||||
Allow the cloud-init service to operate `xfs` filesystem.
|
||||
'';
|
||||
|
Loading…
Reference in New Issue
Block a user