1# Udisks daemon. 2 3{ config, lib, pkgs, ... }: 4 5with lib; 6 7{ 8 9 ###### interface 10 11 options = { 12 13 services.udisks2 = { 14 15 enable = mkOption { 16 type = types.bool; 17 default = true; 18 description = '' 19 Whether to enable Udisks, a DBus service that allows 20 applications to query and manipulate storage devices. 21 ''; 22 }; 23 24 }; 25 26 }; 27 28 29 ###### implementation 30 31 config = mkIf config.services.udisks2.enable { 32 33 environment.systemPackages = [ pkgs.udisks2 ]; 34 35 services.dbus.packages = [ pkgs.udisks2 ]; 36 37 system.activationScripts.udisks2 = 38 '' 39 mkdir -m 0755 -p /var/lib/udisks2 40 ''; 41 42 services.udev.packages = [ pkgs.udisks2 ]; 43 44 systemd.services.udisks2 = { 45 description = "Udisks2 service"; 46 serviceConfig = { 47 Type = "dbus"; 48 BusName = "org.freedesktop.UDisks2"; 49 ExecStart = "${pkgs.udisks2}/libexec/udisks2/udisksd --no-debug"; 50 }; 51 }; 52 }; 53 54}