diff options
author | Ethel Morgan <eth@ethulhu.co.uk> | 2020-05-23 18:17:24 +0100 |
---|---|---|
committer | Ethel Morgan <eth@ethulhu.co.uk> | 2020-05-23 18:17:24 +0100 |
commit | e951d875609d46870c0f5c35f9c43d4d3a9a82ce (patch) | |
tree | b1ff3cec07a00973397973ab18a6b598eaae9a23 | |
parent | 06347d7b71834de868dff40341808ac9b747388d (diff) |
add a helix package and a helix-player module
Diffstat (limited to '')
-rw-r--r-- | module-list.nix | 1 | ||||
-rw-r--r-- | modules/helix-player.nix | 50 | ||||
-rw-r--r-- | pkgs/default.nix | 2 |
3 files changed, 53 insertions, 0 deletions
diff --git a/module-list.nix b/module-list.nix index 41a06cf..401dea6 100644 --- a/module-list.nix +++ b/module-list.nix @@ -1,5 +1,6 @@ [ ./modules/keyboard.nix + ./modules/helix-player.nix ./modules/linode.nix ./modules/overlays.nix ./modules/upmpdcli.nix diff --git a/modules/helix-player.nix b/modules/helix-player.nix new file mode 100644 index 0000000..d73fc16 --- /dev/null +++ b/modules/helix-player.nix @@ -0,0 +1,50 @@ +{ config, lib, pkgs, ... }: +with lib; + +let + + cfg = config.services.helix-player; + helixPackage = pkgs.eth.helix; + + runtimeDirectory = "helix-player"; + socket = "/run/${runtimeDirectory}/listen.sock"; + +in { + + options.services.helix-player = { + + enable = mkEnableOption "Whether to enable helix-player"; + + socket = mkOption { + type = types.str; + readOnly = true; + description = "Path of the UNIX socket to listen on."; + example = socket; + }; + }; + + + config = mkIf cfg.enable { + + services.helix-player.socket = socket; + + environment.systemPackages = [ + helixPackage + ]; + + systemd.services.helix-player = { + enable = true; + description = "Helix UPnP player & controller"; + wants = [ "network.target" ]; + after = [ "network.target" ]; + wantedBy = [ "multi-user.target" ]; + serviceConfig = { + DynamicUser = "yes"; + Group = config.services.nginx.group; + RuntimeDirectory = "${runtimeDirectory}"; + ExecStart = "${helixPackage}/bin/helix-player -socket ${socket}"; + }; + }; + }; + +} diff --git a/pkgs/default.nix b/pkgs/default.nix index 01810e2..5ea0599 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -2,6 +2,8 @@ pkgs: super: { eth = { recipesEthMoe = pkgs.callPackage ( builtins.fetchGit { url = "https://github.com/ethulhu/recipes.eth.moe"; } ) {}; + helix = pkgs.callPackage ( builtins.fetchGit { url = "https://github.com/ethulhu/helix"; rev = "142be94fb81ee3ff7aba1694836fd45330d22862"; } ) {}; + libnpupnp = pkgs.callPackage ./libnpupnp { }; libupnpp = pkgs.callPackage ./libupnpp { }; upmpdcli = pkgs.callPackage ./upmpdcli { }; |