summaryrefslogtreecommitdiff
path: root/modules/services/upmpdcli.nix
diff options
context:
space:
mode:
authorEthel Morgan <eth@ethulhu.co.uk>2020-05-29 21:45:44 +0100
committerEthel Morgan <eth@ethulhu.co.uk>2020-05-29 21:45:44 +0100
commit433a9ffcbddda74b0449eba251246a60221ae7cd (patch)
tree94792eabcb1e30b1f452ea18fd9c70e267aa4180 /modules/services/upmpdcli.nix
parent1d6f6c4c6f4823d1b969c6309ad2d472441b7b16 (diff)
better mirror upstream nixpkgs layout
Diffstat (limited to 'modules/services/upmpdcli.nix')
-rw-r--r--modules/services/upmpdcli.nix82
1 files changed, 0 insertions, 82 deletions
diff --git a/modules/services/upmpdcli.nix b/modules/services/upmpdcli.nix
deleted file mode 100644
index d301a49..0000000
--- a/modules/services/upmpdcli.nix
+++ /dev/null
@@ -1,82 +0,0 @@
-{ config, lib, pkgs, ... }:
-with lib;
-
-let
- cfg = config.eth.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.eth.services.upmpdcli = {
- enable = mkEnableOption "Run upmpdcli server";
-
- friendlyName = mkOption {
- type = types.str;
- default = "UpMpd (${config.networking.hostName})";
- 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 {
- systemd.services.upmpdcli = {
- enable = true;
- description = "";
- wants = [ "network.target" ];
- after = [ "network.target" ];
- wantedBy = [ "multi-user.target" ];
- path = [ pkgs.openssl pkgs.python3 ];
- serviceConfig = {
- DynamicUser = true;
-
- CacheDirectory = cacheDir;
-
- Type = "simple";
- ExecStart="${pkgs.eth.upmpdcli}/bin/upmpdcli -c ${upmpdConf}";
- Restart = "always";
- RestartSec = "1min";
-
- NoNewPrivileges = true;
- ProtectHome = true;
- ProtectKernelTunables = true;
- ProtectControlGroups = true;
- ProtectKernelModules = true;
- };
- };
- };
-}