From df76518872931c7150ce91327c152c1692761dac Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sat, 27 Jul 2024 12:09:47 +0800 Subject: [PATCH] wrapper-manager-fds/modules: update PATH and XDG dirs to be a part of `env` instead This makes it easier to work with for custom modules. --- .../wrapper-manager-fds/modules/wrapper-manager/base.nix | 5 +++-- .../modules/wrapper-manager/xdg-dirs.nix | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix b/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix index a1ba1793..a292c516 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/base.nix @@ -118,12 +118,13 @@ let }; config = { + env.PATH = lib.concatStringsSep ":" config.pathAdd; + makeWrapperArgs = [ "--argv0" config.arg0 ] - ++ (lib.mapAttrsToList (n: v: "--set ${n} ${v}") config.env) ++ (builtins.map (v: "--unset ${v}") config.unset) - ++ (builtins.map (v: "--prefix 'PATH' ':' ${v}") config.pathAdd) + ++ (lib.mapAttrsToList (n: v: "--set ${n} ${v}") config.env) ++ (builtins.map (v: "--add-flags ${v}") config.prependArgs) ++ (builtins.map (v: "--append-flags ${v}") config.appendArgs) ++ (lib.optionals (!envConfig.build.isBinary && config.preScript != "") ( 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 08e8d382..56027162 100644 --- a/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-dirs.nix +++ b/subprojects/wrapper-manager-fds/modules/wrapper-manager/xdg-dirs.nix @@ -48,9 +48,10 @@ in config.xdg.configDirs = cfg.configDirs; config.xdg.dataDirs = cfg.dataDirs; - config.makeWrapperArgs = - builtins.map (v: "--prefix 'XDG_CONFIG_DIRS' ':' ${v}") config.xdg.configDirs - ++ (builtins.map (v: "--prefix 'XDG_DATA_DIRS' ':' ${v}") config.xdg.dataDirs); + config.env = { + XDG_CONFIG_DIRS = lib.concatStringsSep ":" config.xdg.configDirs; + XDG_DATA_DIRS = lib.concatStringsSep ":" config.xdg.dataDirs; + }; }; in with lib.types; attrsOf (submodule xdgDirsType);