aboutsummaryrefslogtreecommitdiff
path: root/nixos/modules/services/audio/mpd.nix
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2017-02-16 01:17:44 +0100
committerProfpatsch <mail@profpatsch.de>2017-02-18 16:03:16 +0100
commit2b0469c48f3211425ed06ae3ee5f257f97d9753c (patch)
treeac94bb16a2e958faa689e492a054bb8e82b27951 /nixos/modules/services/audio/mpd.nix
parent31dac10c330faf453ba946cbf558c04ca19102b9 (diff)
modules/mpd: factor out name & mention man 5 mpd.conf
Diffstat (limited to 'nixos/modules/services/audio/mpd.nix')
-rw-r--r--nixos/modules/services/audio/mpd.nix19
1 files changed, 11 insertions, 8 deletions
diff --git a/nixos/modules/services/audio/mpd.nix b/nixos/modules/services/audio/mpd.nix
index a89215d73828..56af8fe152e0 100644
--- a/nixos/modules/services/audio/mpd.nix
+++ b/nixos/modules/services/audio/mpd.nix
@@ -4,6 +4,8 @@ with lib;
let
+ name = "mpd";
+
uid = config.ids.uids.mpd;
gid = config.ids.gids.mpd;
cfg = config.services.mpd;
@@ -54,13 +56,14 @@ in {
description = ''
Extra directives added to to the end of MPD's configuration file,
mpd.conf. Basic configuration like file location and uid/gid
- is added automatically to the beginning of the file.
+ is added automatically to the beginning of the file. For available
+ options see <literal>man 5 mpd.conf</literal>'.
'';
};
dataDir = mkOption {
type = types.path;
- default = "/var/lib/mpd";
+ default = "/var/lib/${name}";
description = ''
The directory where MPD stores its state, tag cache,
playlists etc.
@@ -69,13 +72,13 @@ in {
user = mkOption {
type = types.str;
- default = "mpd";
+ default = name;
description = "User account under which MPD runs.";
};
group = mkOption {
type = types.str;
- default = "mpd";
+ default = name;
description = "Group account under which MPD runs.";
};
@@ -131,17 +134,17 @@ in {
};
};
- users.extraUsers = optionalAttrs (cfg.user == "mpd") (singleton {
+ users.extraUsers = optionalAttrs (cfg.user == name) (singleton {
inherit uid;
- name = "mpd";
+ inherit name;
group = cfg.group;
extraGroups = [ "audio" ];
description = "Music Player Daemon user";
home = "${cfg.dataDir}";
});
- users.extraGroups = optionalAttrs (cfg.group == "mpd") (singleton {
- name = "mpd";
+ users.extraGroups = optionalAttrs (cfg.group == name) (singleton {
+ inherit name;
gid = gid;
});
};