1529641b52
Add code to accountsservice that returns an error if the environment variable NIXOS_USERS_PURE is set. This variable is set from the nixos accountsservice module if mutableUsers = false
49 lines
872 B
Nix
49 lines
872 B
Nix
# AccountsService daemon.
|
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
{
|
|
|
|
###### interface
|
|
|
|
options = {
|
|
|
|
services.accounts-daemon = {
|
|
|
|
enable = mkOption {
|
|
type = types.bool;
|
|
default = false;
|
|
description = ''
|
|
Whether to enable AccountsService, a DBus service for accessing
|
|
the list of user accounts and information attached to those accounts.
|
|
'';
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
###### implementation
|
|
|
|
config = mkIf config.services.accounts-daemon.enable {
|
|
|
|
environment.systemPackages = [ pkgs.accountsservice ];
|
|
|
|
services.dbus.packages = [ pkgs.accountsservice ];
|
|
|
|
systemd.packages = [ pkgs.accountsservice ];
|
|
|
|
systemd.services.accounts-daemon= {
|
|
|
|
wantedBy = [ "graphical.target" ];
|
|
|
|
} // (mkIf (!config.users.mutableUsers) {
|
|
environment.NIXOS_USERS_PURE = "true";
|
|
});
|
|
};
|
|
|
|
}
|