1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-05 16:27:03 +00:00
nix-darwin/modules/services/mopidy.nix
Piotr Limanowski 79e3d78f43 Makes mopidy service non-adaptive
Noticed that adaptive service causes mopidy to stutter under heavy load.
2017-03-21 13:34:12 +01:00

59 lines
1.3 KiB
Nix

{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.mopidy;
in
{
options = {
services.mopidy = {
enable = mkOption {
type = types.bool;
default = false;
description = "Whether to enable the Mopidy Daemon.";
};
package = mkOption {
type = types.path;
default = pkgs.mopidy;
description = "This option specifies the mopidy package to use.";
};
mediakeys = {
enable = mkOption {
type = types.bool;
default = false;
description = "Whether to enable the Mopidy OSX Media Keys support daemon.";
};
package = mkOption {
type = types.path;
default = pkgs.pythonPackages.osxmpdkeys;
description = "This option specifies the mediakeys package to use.";
};
};
};
};
config = mkMerge [
(mkIf cfg.enable {
launchd.user.agents.mopidy = {
serviceConfig.Program = "${cfg.package}/bin/mopidy";
serviceConfig.RunAtLoad = true;
serviceConfig.KeepAlive = true;
};
})
(mkIf cfg.mediakeys.enable {
launchd.user.agents.mopidymediakeys = {
serviceConfig.Program = "${cfg.package}/bin/mpdkeys";
serviceConfig.RunAtLoad = true;
serviceConfig.KeepAlive = true;
};
})
];
}