diff options
author | Ethel Morgan <eth@ethulhu.co.uk> | 2020-05-24 11:41:49 +0100 |
---|---|---|
committer | Ethel Morgan <eth@ethulhu.co.uk> | 2020-05-24 11:41:49 +0100 |
commit | 276c0a88f5ed89dddfccb7d197559dbc6c95f5b4 (patch) | |
tree | ace68879c92f26fdda09694dce6881d9ccebff53 /modules/upmpdcli.nix | |
parent | 5267b53258f9fdf094b53ee66ff02c4be1161530 (diff) |
move eth.upmpdcli to eth.services.umpdcli
also, the default FriendlyName now includes the system hostname.
Diffstat (limited to 'modules/upmpdcli.nix')
-rw-r--r-- | modules/upmpdcli.nix | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/modules/upmpdcli.nix b/modules/upmpdcli.nix deleted file mode 100644 index 5b83a2f..0000000 --- a/modules/upmpdcli.nix +++ /dev/null @@ -1,78 +0,0 @@ -{ config, lib, pkgs, ... }: -with lib; - -let - cfg = config.services.upmpdcli; - - cacheDir = "upmpdcli"; - - upmpdConf = pkgs.writeText "upmpd.conf" '' - cachedir = /var/cache/${cacheDir} - - friendlyname = ${cfg.friendlyName} - - mpdhost = ${cfg.mpd.host} - mpdport = ${toString cfg.mpd.port} - - ${optionalString (cfg.mpd.password != "") "${cfg.mpd.password}"} - - ${cfg.extraConfig} - ''; - -in { - options.services.upmpdcli = { - enable = mkEnableOption "Run upmpdcli server"; - - friendlyName = mkOption { - type = types.str; - default = "UpMpd"; - description = "Friendly Name used for UPnP discovery."; - }; - - mpd = { - host = mkOption { - type = types.str; - default = config.services.mpd.network.listenAddress; - description = "Host of the MPD server."; - }; - port = mkOption { - type = types.int; - default = config.services.mpd.network.port; - description = "Port of the MPD server."; - }; - password = mkOption { - type = types.str; - default = ""; - description = "Password of the MPD server."; - }; - }; - - extraConfig = mkOption { - type = types.lines; - default = ""; - }; - }; - - config = mkIf cfg.enable { - environment.systemPackages = [ - pkgs.eth.upmpdcli - ]; - - systemd.services.upmpdcli = { - enable = true; - description = ""; - wants = [ "network.target" ]; - after = [ "network.target" ]; - wantedBy = [ "multi-user.target" ]; - path = [ pkgs.openssl pkgs.python3 ]; - serviceConfig = { - DynamicUser = "yes"; - CacheDirectory = cacheDir; - Type = "simple"; - ExecStart="${pkgs.eth.upmpdcli}/bin/upmpdcli -c ${upmpdConf}"; - Restart = "always"; - RestartSec = "1min"; - }; - }; - }; -} |