1
0
mirror of https://github.com/nix-community/home-manager synced 2024-06-26 16:38:34 +02:00
Commit Graph

12 Commits

Author SHA1 Message Date
Thiago Kenji Okada
0b25ac41ee home-environment: prepend instead of append 2023-11-21 18:50:29 +00:00
Thiago Kenji Okada
7d4f510f26 home-environment: add home.sessionSearchVariables
This commit introduces `home.sessionSearchVariables` option, that is
created to be a "generic" version of `home.sessionPath` for any
environment variables that is similar to PATH (e.g.: MANPATH). This
allows composition of those variables between multiple modules, avoiding
issues like this one:

https://github.com/nix-community/home-manager/pull/4579/files#r1364374048

This commit also reimplements `home.sessionPath` as terms of
`home.sessionSearchVariables`, to reduce code duplication and show that
the code is correct.
2023-11-21 18:38:19 +00:00
Rodney Lorrimar
3be2abb2e6
i18n: Use glibcLocales from NixOS if possible (#2333) (#4177)
This will reduce the system closure size by about 200MB under NixOS by
sharing the glibcLocales package.

When home-manager is installed on Linux without the NixOS module, all
glibc locales are installed, as before.

Resolves: #2333
2023-07-04 11:28:25 +02:00
Robert Helgesson
2499b91692
treewide: apply nixfmt to a few more files 2022-02-27 02:19:44 +01:00
oxalica
70c5b268e1
xdg: add option 'xdg.stateHome' (#2439)
It corresponds to the newly introduced `XDG_STATE_HOME`.
2021-11-04 17:42:44 +01:00
Tad Fisher
01ec2aaefe
systemd: revert systemd-environment-generator usage for environment variables (#2001) 2021-05-16 17:43:50 -04:00
Tad Fisher
23769994e8
xdg.systemDirs: init module (#1797)
There is a need to manage XDG Base Directory system directory
environment variables in Home Manager modules. There is an existing
mechanism in `targets.genericLinux.extraXdgDataDirs', but this does not
apply to NixOS systems.

Furthermore, it is important that `XDG_CONFIG_DIRS' and `XDG_DATA_DIRS'
are set in both login shells (to support getty and SSH sessions) as well
as the systemd user manager (to propagate them to user services and
desktop environments).

The first need is addressed by adding the `xdg.systemDirs' module, which
configures lists of directory names for both `config' and `data'
directories. These are then set in
`$XDG_CONFIG_DIR/environment.d/10-home-manager.conf' and picked up by
the systemd user manager.

To make these, and other variables set in
`systemd.user.sessionVariables', available in login shells, an
additional step is added to `etc/profile.d/hm-session-vars.sh' which
exports the result of
`user-environment-generators/30-systemd-environment-d-generator' which
is shipped with systemd. The effect of this generator is to print
variables set on the systemd user manager such that shells can import
these into their environment.
2021-05-10 20:14:42 -04:00
midchildan
e44faef21c
i18n: various fixes 2021-01-23 16:40:25 +01:00
midchildan
9a12cd7e81
i18n: set the appropriate LOCALE_ARCHIVE_x_xx variable (#1659) 2021-01-23 15:56:38 +01:00
Andrew Fontaine
0006da1381
home-environment: add option home.sessionPath
This option allows adding additional entries to `PATH`.
2020-10-05 21:06:42 +02:00
Robert Helgesson
95b95b1407
tests: improve test purity
Before the XDG variables would be set from the user's environment, if
available. This would break some tests.

With this change the tests should be fully deterministic.

Fixes #1190
2020-04-24 21:46:34 +02:00
Robert Helgesson
b6e613c771
Fix type of various sessionVariables options
Unfortunately, using `attrsOf` is not possible since it results in too
eager evaluation. In particular, the

    home.sessionVariables = {
      FOO = "Hello";
      BAR = "${config.home.sessionVariables.FOO} World!";
    };

example will cause an infinite recursion.

This commit restores the option type of

- `home.sessionVariables`,
- `pam.sessionVariables`,
- `programs.bash.sessionVariables`, and
- `programs.zsh.sessionVariables`

to `attrs`. It also adds test cases for the above options to avoid
regressions.

Fixes #659
2019-04-27 01:07:09 +02:00