mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-02-07 06:19:00 +00:00
lib: improve NixOS-like environment generation
This commit is contained in:
parent
e3122bfd24
commit
9c345c5f4c
@ -18,8 +18,7 @@
|
|||||||
# set of applications and everything (except for overlapping NixOS services
|
# set of applications and everything (except for overlapping NixOS services
|
||||||
# that will just add them into the NixOS environment itself).
|
# that will just add them into the NixOS environment itself).
|
||||||
mkNixoslikeEnvironment = config: args:
|
mkNixoslikeEnvironment = config: args:
|
||||||
pkgs.buildEnv {
|
pkgs.buildEnv (args // {
|
||||||
inherit (args) paths name;
|
|
||||||
inherit (config.environment) pathsToLink extraOutputsToInstall;
|
inherit (config.environment) pathsToLink extraOutputsToInstall;
|
||||||
ignoreCollisions = true;
|
ignoreCollisions = true;
|
||||||
postBuild =
|
postBuild =
|
||||||
@ -33,11 +32,12 @@
|
|||||||
|
|
||||||
${config.environment.extraSetup}
|
${config.environment.extraSetup}
|
||||||
'';
|
'';
|
||||||
};
|
});
|
||||||
|
|
||||||
# Given an environment (built with `pkgs.buildEnv`), create a systemd
|
# Given an environment (built with `pkgs.buildEnv`), create a systemd
|
||||||
# environment attrset meant to be used as part of the desktop service.
|
# environment attrset meant to be used as part of the desktop service.
|
||||||
mkSystemdDesktopEnvironment = env: {
|
mkSystemdDesktopEnvironment = env: {
|
||||||
|
PATH = "${lib.getBin env}\${PATH:+:$PATH}";
|
||||||
XDG_DATA_DIRS = "${env}/share\${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}";
|
XDG_DATA_DIRS = "${env}/share\${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}";
|
||||||
XDG_CONFIG_DIRS = "${env}/etc/xdg\${XDG_CONFIG_DIRS:+:$XDG_CONFIG_DIRS}";
|
XDG_CONFIG_DIRS = "${env}/etc/xdg\${XDG_CONFIG_DIRS:+:$XDG_CONFIG_DIRS}";
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user