diff options
author | Jonathan Ringer <jonringer117@gmail.com> | 2020-04-21 13:12:45 -0700 |
---|---|---|
committer | Robert Helgesson <robert@rycee.net> | 2020-04-26 15:50:21 +0200 |
commit | a6037a9eb885d8ad8c2087e3b2091cd5913242b2 (patch) | |
tree | 4849e07de73697893a544e2e70a087514670924d /modules/services/pulseeffects.nix | |
parent | 23220d43f35a401dc2044e86d4d5ad147ff60007 (diff) |
pulseeffects: add module
Pulseeffects is an advanced mixer for PulseAudio.
PR #1182
Diffstat (limited to 'modules/services/pulseeffects.nix')
-rw-r--r-- | modules/services/pulseeffects.nix | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/modules/services/pulseeffects.nix b/modules/services/pulseeffects.nix new file mode 100644 index 00000000000..af6cebe1281 --- /dev/null +++ b/modules/services/pulseeffects.nix @@ -0,0 +1,52 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + + cfg = config.services.pulseeffects; + + presetOpts = optionalString (cfg.preset != "") "--load-preset ${cfg.preset}"; + +in { + meta.maintainers = [ maintainers.jonringer ]; + + options.services.pulseeffects = { + enable = mkEnableOption "Pulseeffects daemon"; + + preset = mkOption { + type = types.str; + default = ""; + description = '' + Which preset to use when starting pulseeffects. + Will likely need to launch pulseeffects to initially create preset. + ''; + }; + }; + + config = mkIf cfg.enable { + # running pulseeffects will just attach itself to gapplication service + # at-spi2-core is to minimize journalctl noise of: + # "AT-SPI: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files" + home.packages = [ pkgs.pulseeffects pkgs.at-spi2-core ]; + + # Will need to add `services.dbus.packages = with pkgs; [ gnome3.dconf ];` + # to /etc/nixos/configuration.nix for daemon to work correctly + + systemd.user.services.pulseeffects = { + Unit = { + Description = "Pulseeffects daemon"; + Requires = [ "pulseaudio.service" "dbus.service" ]; + After = [ "graphical-session.target" ]; + }; + + Service = { + ExecStart = + "${pkgs.pulseeffects}/bin/pulseeffects --gapplication-service ${presetOpts}"; + ExecStop = "${pkgs.pulseeffects}/bin/pulseeffects --quit"; + Restart = "on-failure"; + RestartSec = 5; + }; + }; + }; +} |