mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-18 10:56:53 +00:00
29027fd1e1
Using pkgs.lib on the spine of module evaluation is problematic because the pkgs argument depends on the result of module evaluation. To prevent an infinite recursion, pkgs and some of the modules are evaluated twice, which is inefficient. Using ‘with lib’ prevents this problem.
41 lines
686 B
Nix
41 lines
686 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.accountservice ];
|
|
|
|
services.dbus.packages = [ pkgs.accountservice ];
|
|
|
|
systemd.packages = [ pkgs.accountservice ];
|
|
};
|
|
|
|
}
|