From 125e40fa68b340aee9d474a46b540907e2537b5c Mon Sep 17 00:00:00 2001 From: hausken <79340822+hauskens@users.noreply.github.com> Date: Mon, 24 Nov 2025 18:56:44 +0100 Subject: [PATCH] easyeffects: Make service compatible with v8.0.x (#8192) Fixes #8185 The upstream easyeffects project has migrated from GTK to Qt, deprecating --gapplication-service and removing DBus integration. See #8185 for more details. Tested with version 8.0.3 and 7.2.5 , uses lib.versionOlder cfg.package.version "8.0.0" to be backwards compatible. Removed DBus service configuration (Type=dbus, BusName) Move presets and config dir from $XDG_CONFIG_HOME to $XDG_DATA_HOME (new upstream location) Other notes Since they have moved config directory, it will warn show warnings because of empty dirs. These warnings will also show in the service until you remove them. I dont think this is a problem and new users will not experience this. easyeffects --version easyeffects: presets_directory_manager.cpp:140 Old /home/hausken/.config/easyeffects/output directory detected. Migrating its files to /home/hausken/.local/share/easyeffects/output easyeffects: presets_directory_manager.cpp:149 Could not copy any file. Aborting migration of /home/hausken/.config/easyeffects/output easyeffects: presets_directory_manager.cpp:140 Old /home/hausken/.config/easyeffects/irs directory detected. Migrating its files to /home/hausken/.local/share/easyeffects/irs easyeffects: presets_directory_manager.cpp:149 Could not copy any file. Aborting migration of /home/hausken/.config/easyeffects/irs easyeffects: presets_directory_manager.cpp:140 Old /home/hausken/.config/easyeffects/rnnoise directory detected. Migrating its files to /home/hausken/.local/share/easyeffects/rnnoise easyeffects: presets_directory_manager.cpp:149 Could not copy any file. Aborting migration of /home/hausken/.config/easyeffects/rnnoise easyeffects: presets_directory_manager.cpp:140 Old /home/hausken/.config/easyeffects/autoload/output directory detected. Migrating its files to /home/hausken/.local/share/easyeffects/autoload/output easyeffects: presets_directory_manager.cpp:149 Could not copy any file. Aborting migration of /home/hausken/.config/easyeffects/autoload/output --- modules/services/easyeffects.nix | 33 +++++++++++-------- .../services/easyeffects/example-preset.nix | 2 +- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/modules/services/easyeffects.nix b/modules/services/easyeffects.nix index efe224459..a56c332cb 100644 --- a/modules/services/easyeffects.nix +++ b/modules/services/easyeffects.nix @@ -11,6 +11,8 @@ let presetOpts = lib.optionalString (cfg.preset != "") "--load-preset ${cfg.preset}"; + olderThan8 = lib.versionOlder cfg.package.version "8.0.0"; # This version introduces breaking changes and this check is used to stay backwards compatible + jsonFormat = pkgs.formats.json { }; presetType = @@ -31,7 +33,7 @@ let default = { }; description = '' List of presets to import to easyeffects. - Presets are written to input and output folder in `$XDG_CONFIG_HOME/easyeffects`. + Presets are written to input and output folder in `$XDG_DATA_HOME/easyeffects`. Top level block (input/output) determines the folder the file is written to. See community presets at: @@ -97,15 +99,9 @@ in (lib.hm.assertions.assertPlatform "services.easyeffects" pkgs lib.platforms.linux) ]; - # Running easyeffects 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 = with pkgs; [ - cfg.package - at-spi2-core - ]; + home.packages = with pkgs; lib.optional olderThan8 at-spi2-core ++ [ cfg.package ]; # Only include if easyeffects version is below 8.0.0 - xdg.configFile = lib.mkIf (cfg.extraPresets != { }) ( + xdg.dataFile = lib.mkIf (cfg.extraPresets != { }) ( lib.mapAttrs' ( k: v: # Assuming only one of either input or output block is defined, having both in same file not seem to be supported by the application since it separates it by folder @@ -126,15 +122,26 @@ in Install.WantedBy = [ "graphical-session.target" ]; Service = { - ExecStart = "${cfg.package}/bin/easyeffects --gapplication-service ${presetOpts}"; + ExecStart = + if olderThan8 then + "${cfg.package}/bin/easyeffects --gapplication-service ${presetOpts}" + else + "${cfg.package}/bin/easyeffects --hide-window --service-mode ${presetOpts}"; ExecStop = "${cfg.package}/bin/easyeffects --quit"; - Type = "dbus"; - BusName = "com.github.wwmm.easyeffects"; KillMode = "mixed"; Restart = "on-failure"; RestartSec = 5; TimeoutStopSec = 10; - }; + } + // ( + if olderThan8 then + { + Type = "dbus"; + BusName = "com.github.wwmm.easyeffects"; + } + else + { } + ); }; }; } diff --git a/tests/modules/services/easyeffects/example-preset.nix b/tests/modules/services/easyeffects/example-preset.nix index b435ff2a7..442386ada 100644 --- a/tests/modules/services/easyeffects/example-preset.nix +++ b/tests/modules/services/easyeffects/example-preset.nix @@ -27,6 +27,6 @@ nmt.script = '' assertFileContent \ - home-files/.config/easyeffects/input/example-preset.json "${./example-preset.json}" + home-files/.local/share/easyeffects/input/example-preset.json "${./example-preset.json}" ''; }