at 18.09-beta 1.2 kB view raw
1# AccountsService daemon. 2 3{ config, lib, pkgs, ... }: 4 5with lib; 6 7{ 8 9 ###### interface 10 11 options = { 12 13 services.accounts-daemon = { 14 15 enable = mkOption { 16 type = types.bool; 17 default = false; 18 description = '' 19 Whether to enable AccountsService, a DBus service for accessing 20 the list of user accounts and information attached to those accounts. 21 ''; 22 }; 23 24 }; 25 26 }; 27 28 29 ###### implementation 30 31 config = mkIf config.services.accounts-daemon.enable { 32 33 environment.systemPackages = [ pkgs.accountsservice ]; 34 35 # Accounts daemon looks for dbus interfaces in $XDG_DATA_DIRS/accountsservice 36 environment.pathsToLink = [ "/share/accountsservice" ]; 37 38 services.dbus.packages = [ pkgs.accountsservice ]; 39 40 systemd.packages = [ pkgs.accountsservice ]; 41 42 systemd.services.accounts-daemon = { 43 44 wantedBy = [ "graphical.target" ]; 45 46 # Accounts daemon looks for dbus interfaces in $XDG_DATA_DIRS/accountsservice 47 environment.XDG_DATA_DIRS = "${config.system.path}/share"; 48 49 } // (optionalAttrs (!config.users.mutableUsers) { 50 environment.NIXOS_USERS_PURE = "true"; 51 }); 52 }; 53 54}