From 9c345c5f4ca2e1b945dcca1a18ff01a9a24fab53 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 8 Jul 2024 13:32:01 +0800 Subject: [PATCH] lib: improve NixOS-like environment generation --- lib/env-specific/nixos.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/env-specific/nixos.nix b/lib/env-specific/nixos.nix index 36d92559..44c6647c 100644 --- a/lib/env-specific/nixos.nix +++ b/lib/env-specific/nixos.nix @@ -18,8 +18,7 @@ # set of applications and everything (except for overlapping NixOS services # that will just add them into the NixOS environment itself). mkNixoslikeEnvironment = config: args: - pkgs.buildEnv { - inherit (args) paths name; + pkgs.buildEnv (args // { inherit (config.environment) pathsToLink extraOutputsToInstall; ignoreCollisions = true; postBuild = @@ -33,11 +32,12 @@ ${config.environment.extraSetup} ''; - }; + }); # Given an environment (built with `pkgs.buildEnv`), create a systemd # environment attrset meant to be used as part of the desktop service. mkSystemdDesktopEnvironment = env: { + PATH = "${lib.getBin env}\${PATH:+:$PATH}"; XDG_DATA_DIRS = "${env}/share\${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}"; XDG_CONFIG_DIRS = "${env}/etc/xdg\${XDG_CONFIG_DIRS:+:$XDG_CONFIG_DIRS}"; };