aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/nixos/modules/services/audio/squeezelite.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/nixos/modules/services/audio/squeezelite.nix')
-rw-r--r--nixpkgs/nixos/modules/services/audio/squeezelite.nix50
1 files changed, 50 insertions, 0 deletions
diff --git a/nixpkgs/nixos/modules/services/audio/squeezelite.nix b/nixpkgs/nixos/modules/services/audio/squeezelite.nix
new file mode 100644
index 00000000000..05506f5bcc7
--- /dev/null
+++ b/nixpkgs/nixos/modules/services/audio/squeezelite.nix
@@ -0,0 +1,50 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+ dataDir = "/var/lib/squeezelite";
+ cfg = config.services.squeezelite;
+
+in {
+
+ ###### interface
+
+ options = {
+
+ services.squeezelite= {
+
+ enable = mkEnableOption "Squeezelite, a software Squeezebox emulator";
+
+ extraArguments = mkOption {
+ default = "";
+ type = types.str;
+ description = ''
+ Additional command line arguments to pass to Squeezelite.
+ '';
+ };
+
+ };
+
+ };
+
+
+ ###### implementation
+
+ config = mkIf cfg.enable {
+
+ systemd.services.squeezelite= {
+ wantedBy = [ "multi-user.target" ];
+ after = [ "network.target" "sound.target" ];
+ description = "Software Squeezebox emulator";
+ serviceConfig = {
+ DynamicUser = true;
+ ExecStart = "${pkgs.squeezelite}/bin/squeezelite -N ${dataDir}/player-name ${cfg.extraArguments}";
+ StateDirectory = builtins.baseNameOf dataDir;
+ SupplementaryGroups = "audio";
+ };
+ };
+
+ };
+
+}