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