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