nixos/udisks2: add freeform settings
This commit is contained in:
parent
172165a1ba
commit
4d49c7e6d8
@ -4,6 +4,13 @@
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
settingsFormat = pkgs.formats.ini {
|
||||
listToValue = concatMapStringsSep "," (generators.mkValueStringDefault {});
|
||||
};
|
||||
configFiles = mapAttrs (name: value: (settingsFormat.generate name value)) (mapAttrs' (name: value: nameValuePair name value ) config.services.udisks2.settings);
|
||||
in
|
||||
|
||||
{
|
||||
|
||||
###### interface
|
||||
@ -21,6 +28,36 @@ with lib;
|
||||
'';
|
||||
};
|
||||
|
||||
settings = mkOption rec {
|
||||
type = types.attrsOf settingsFormat.type;
|
||||
apply = recursiveUpdate default;
|
||||
default = {
|
||||
"udisks2.conf" = {
|
||||
udisks2 = {
|
||||
modules = [ "*" ];
|
||||
modules_load_preference = "ondemand";
|
||||
};
|
||||
defaults = {
|
||||
encryption = "luks2";
|
||||
};
|
||||
};
|
||||
};
|
||||
example = literalExpression ''
|
||||
{
|
||||
"WDC-WD10EZEX-60M2NA0-WD-WCC3F3SJ0698.conf" = {
|
||||
ATA = {
|
||||
StandbyTimeout = 50;
|
||||
};
|
||||
};
|
||||
};
|
||||
'';
|
||||
description = ''
|
||||
Options passed to udisksd.
|
||||
See <link xlink:href="http://manpages.ubuntu.com/manpages/latest/en/man5/udisks2.conf.5.html">here</link> and
|
||||
drive configuration in <link xlink:href="http://manpages.ubuntu.com/manpages/latest/en/man8/udisks.8.html">here</link> for supported options.
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
@ -32,6 +69,8 @@ with lib;
|
||||
|
||||
environment.systemPackages = [ pkgs.udisks2 ];
|
||||
|
||||
environment.etc = mapAttrs' (name: value: nameValuePair "udisks2/${name}" { source = value; } ) configFiles;
|
||||
|
||||
security.polkit.enable = true;
|
||||
|
||||
services.dbus.packages = [ pkgs.udisks2 ];
|
||||
|
Loading…
Reference in New Issue
Block a user