From 90ae324e2c56af10f20549ab72014804a3064c7f Mon Sep 17 00:00:00 2001 From: Chris Hodapp <108633+clhodapp@users.noreply.github.com> Date: Thu, 11 Jul 2024 14:48:33 -0700 Subject: [PATCH] sd-switch: respect xdg directory specifications --- modules/systemd.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/systemd.nix b/modules/systemd.nix index d480a1e45..717a5922d 100644 --- a/modules/systemd.nix +++ b/modules/systemd.nix @@ -100,6 +100,8 @@ let settingsFormat.generate "user.conf" cfg.settings; }; + configHome = lib.removePrefix config.home.homeDirectory config.xdg.configHome; + in { meta.maintainers = [ lib.maintainers.rycee ]; @@ -355,13 +357,13 @@ in { fi if [[ -v oldGenPath ]]; then - oldUnitsDir="$oldGenPath/home-files/.config/systemd/user" + oldUnitsDir="$oldGenPath/home-files${configHome}/systemd/user" if [[ ! -e $oldUnitsDir ]]; then oldUnitsDir= fi fi - newUnitsDir="$newGenPath/home-files/.config/systemd/user" + newUnitsDir="$newGenPath/home-files${configHome}/systemd/user" if [[ ! -e $newUnitsDir ]]; then newUnitsDir=${pkgs.emptyDirectory} fi