fork/home-manager
git clone https://git.julia.blue/fork/home-manager
75790441
master
1{ config , lib , pkgs , ...} : 2 3with lib ; 4 5let 6 7cfg = config . services . easyeffects ; 8 9presetOpts = optionalString ( cfg . preset != "" ) "--load-preset ${ cfg . preset } " ; 10 11in { 12meta . maintainers = [ maintainers . fufexan ]; 13 14options . services . easyeffects = { 15enable = mkEnableOption '' 16Easyeffects daemon. 17Note, it is necessary to add 18```nix 19programs.dconf.enable = true; 20``` 21to your system configuration for the daemon to work correctly'' ; 22 23package = mkOption { 24type = types . package ; 25default = pkgs . easyeffects ; 26defaultText = literalExpression "pkgs.easyeffects" ; 27description = "The `easyeffects` package to use." ; 28}; 29 30preset = mkOption { 31type = types . str ; 32default = "" ; 33description = '' 34Which preset to use when starting easyeffects. 35Will likely need to launch easyeffects to initially create preset. 36'' ; 37}; 38}; 39 40config = mkIf cfg . enable { 41assertions = [ 42( hm . assertions . assertPlatform "services.easyeffects" pkgs platforms . linux ) 43]; 44 45# running easyeffects will just attach itself to gapplication service 46# at-spi2-core is to minimize journalctl noise of: 47# "AT-SPI: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files" 48home . packages = with pkgs ; [ cfg . package at-spi2-core ]; 49 50systemd . user . services . easyeffects = { 51Unit = { 52Description = "Easyeffects daemon" ; 53Requires = [ "dbus.service" ]; 54After = [ "graphical-session-pre.target" ]; 55PartOf = [ "graphical-session.target" "pipewire.service" ]; 56}; 57 58Install . WantedBy = [ "graphical-session.target" ]; 59 60Service = { 61ExecStart = 62" ${ cfg . package } /bin/easyeffects --gapplication-service ${ presetOpts } " ; 63ExecStop = " ${ cfg . package } /bin/easyeffects --quit" ; 64Restart = "on-failure" ; 65RestartSec = 5 ; 66}; 67}; 68}; 69}