Commit Graph

18 Commits

Author SHA1 Message Date
Olli Helenius e27be9db7b
systemd: avoid creating an empty user.conf
Due to the defaults in `systemd.user.settings`, the default value when
there are no settings explicitly set is `{ Manager = { }; }`. This
means an empty file is created even when `systemd.user.settings` is
never used in home-manager configuration. Since user’s `user.conf` is
preferred to the global `/etc/systemd/user.conf`, this can cause any
values set in the latter to be discarded.
2023-11-11 00:51:53 +01:00
Olli Helenius 6a8444467c
systemd: add settings option (#4276)
The `systemd.user.extraConfig` provides a way to generate a
`systemd-user.conf(5)` file for the user.

This is the home-manager equivalent of NixOS’s option of the same
name, with the difference that NixOS’s option generates a `user.conf`
file that is shared between all users.
2023-11-07 07:55:17 -07: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 eec2272999
tests: various minor cleanups 2023-05-13 00:09:52 +02:00
Ramses d97e8f8861
systemd: accept derivations as values for systemd options (#3974) 2023-05-11 15:50:37 +02:00
ralismark 9fcae11ff2 systemd: name slice unit correctly 2022-10-07 16:07:53 +11:00
Naïm Favier a4b0a3faa4
xdg: add `XDG_*_HOME` variables to `systemd.user.sessionVariables` (#2790)
Make sure those variables are set in systemd user services.
This mirrors the situation for `XDG_*_DIRS` variables.
2022-03-17 22:22:53 -04:00
Tobias Happ c2aa831491
systemd: do not install systemd files when user is root (#2454)
For the user root, there are no user services provided by systemd.
Therefore, these files will never be used.
2021-11-23 01:06:43 -05:00
Robert Helgesson 41903a14b0
Remove a few format exceptions 2021-07-18 23:34:50 +02: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
Robert Helgesson 28eb093a1e
systemd: use `listsAsDuplicateKeys`
This causes list values to be emitted as a list of key-value pairs
instead of a single key-value pair where the value is space separated.

This is useful, e.g., for socket units that would like to specify more
than one `ListenStream=` address.
2020-10-25 22:55:06 +01:00
Robert Helgesson ebdfa06685
tests: update nmt 2020-04-10 01:01:20 +02:00
Robert Helgesson 45abf3d38a
Apply `nixfmt` on many files 2020-02-02 01:07:28 +01:00
Olli Helenius 1fdb16866b
systemd: add support for session variables
Via environment.d(5).
2019-03-24 17:23:50 +01:00
Robert Helgesson 6ebf14143a
systemd: add some basic tests 2019-03-24 15:52:30 +01:00