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 {
41 default = [ "--config" "/var/lib/music-assistant" ];
47 List of extra options to pass to the music-assistant executable.
51 providers = mkOption {
52 type = listOf (enum cfg.package.providerNames);
59 List of provider names for which dependencies will be installed.
64 config = mkIf cfg.enable {
65 systemd.services.music-assistant = {
66 description = "Music Assistant";
67 documentation = [ "https://music-assistant.io" ];
69 wantedBy = [ "multi-user.target" ];
72 HOME = "/var/lib/music-assistant";
73 PYTHONPATH = finalPackage.pythonPath;
77 ExecStart = utils.escapeSystemdExecArgs ([
78 (lib.getExe cfg.package)
79 ] ++ cfg.extraOptions);
81 StateDirectory = "music-assistant";
82 AmbientCapabilities = "";
83 CapabilityBoundingSet = [ "" ];
84 DevicePolicy = "closed";
85 LockPersonality = true;
86 MemoryDenyWriteExecute = true;
89 ProtectControlGroups = true;
91 ProtectHostname = true;
92 ProtectKernelLogs = true;
93 ProtectKernelModules = true;
94 ProtectKernelTunables = true;
95 ProtectProc = "invisible";
96 RestrictAddressFamilies = [
101 RestrictNamespaces = true;
102 RestrictRealtime = true;
103 SystemCallArchitectures = "native";
106 "~@privileged @resources"
108 RestrictSUIDSGID = true;