24 cfg = config.services.music-assistant;
26 finalPackage = cfg.package.override {
27 inherit (cfg) providers;
32 meta.buildDocsInSandbox = false;
34 options.services.music-assistant = {
35 enable = mkEnableOption "Music Assistant";
37 package = mkPackageOption pkgs "music-assistant" { };
39 extraOptions = mkOption {
43 "/var/lib/music-assistant"
50 List of extra options to pass to the music-assistant executable.
54 providers = mkOption {
55 type = listOf (enum cfg.package.providerNames);
62 List of provider names for which dependencies will be installed.
67 config = mkIf cfg.enable {
68 systemd.services.music-assistant = {
69 description = "Music Assistant";
70 documentation = [ "https://music-assistant.io" ];
72 wantedBy = [ "multi-user.target" ];
75 HOME = "/var/lib/music-assistant";
76 PYTHONPATH = finalPackage.pythonPath;
80 ExecStart = utils.escapeSystemdExecArgs (
82 (lib.getExe cfg.package)
87 StateDirectory = "music-assistant";
88 AmbientCapabilities = "";
89 CapabilityBoundingSet = [ "" ];
90 DevicePolicy = "closed";
91 LockPersonality = true;
92 MemoryDenyWriteExecute = true;
95 ProtectControlGroups = true;
97 ProtectHostname = true;
98 ProtectKernelLogs = true;
99 ProtectKernelModules = true;
100 ProtectKernelTunables = true;
101 ProtectProc = "invisible";
102 RestrictAddressFamilies = [
107 RestrictNamespaces = true;
108 RestrictRealtime = true;
109 SystemCallArchitectures = "native";
112 "~@privileged @resources"
114 RestrictSUIDSGID = true;