43 lines
1 KiB
Nix
43 lines
1 KiB
Nix
{
|
|
pkgs,
|
|
config,
|
|
lib,
|
|
...
|
|
}:
|
|
let
|
|
cfg = config.xyno.desktop.easyeffects;
|
|
in
|
|
{
|
|
options.xyno.desktop.easyeffects.enable = lib.mkEnableOption "enable easyeffects sound thingy";
|
|
options.xyno.desktop.easyeffects.wantedBy = lib.mkOption {
|
|
type = lib.types.str;
|
|
default = "niri.service";
|
|
};
|
|
options.xyno.desktop.easyeffects.package = lib.mkOption {
|
|
type = lib.types.package;
|
|
default = pkgs.easyeffects;
|
|
};
|
|
config = lib.mkIf cfg.enable {
|
|
environment.systemPackages = [ cfg.package ];
|
|
systemd.user.services.easyeffects = {
|
|
unitConfig = {
|
|
Description = "Easyeffects daemon";
|
|
Requires = [ "dbus.service" ];
|
|
After = [ cfg.wantedBy ];
|
|
PartOf = [
|
|
cfg.wantedBy
|
|
"pipewire.service"
|
|
];
|
|
};
|
|
|
|
wantedBy = [ cfg.wantedBy ];
|
|
|
|
serviceConfig = {
|
|
ExecStart = "${cfg.package}/bin/easyeffects --gapplication-service";
|
|
ExecStop = "${cfg.package}/bin/easyeffects --quit";
|
|
Restart = "on-failure";
|
|
RestartSec = 5;
|
|
};
|
|
};
|
|
};
|
|
}
|