From 346a189e1eaecdddd54cb61816ecce5c30f3f4a1 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Tue, 23 Jul 2024 21:41:09 +0800 Subject: [PATCH] wrapper-manager-fds/modules: update behavior for setting env-wide XDG dirs --- .../modules/wrapper-manager/xdg-dirs.nix | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-dirs.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-dirs.nix index 112ac1f1..08e8d382 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-dirs.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-dirs.nix @@ -44,14 +44,13 @@ in xdgDirsType = { name, lib, config, ... }: { options.xdg = xdgDirsOption; + # When set this way, we could allow the user to override everything. + config.xdg.configDirs = cfg.configDirs; + config.xdg.dataDirs = cfg.dataDirs; + config.makeWrapperArgs = - let - # Just take note wrapper-specific values should be the one taking over. - configDirs = cfg.configDirs ++ config.xdg.configDirs; - dataDirs = cfg.dataDirs ++ config.xdg.dataDirs; - in - builtins.map (v: "--prefix 'XDG_CONFIG_DIRS' ':' ${v}") configDirs - ++ (builtins.map (v: "--prefix 'XDG_DATA_DIRS' ':' ${v}") dataDirs); + builtins.map (v: "--prefix 'XDG_CONFIG_DIRS' ':' ${v}") config.xdg.configDirs + ++ (builtins.map (v: "--prefix 'XDG_DATA_DIRS' ':' ${v}") config.xdg.dataDirs); }; in with lib.types; attrsOf (submodule xdgDirsType);