home-environment: use lazyAttrsOf for home.sessionVariables (#3541)

* home-environment: use `lazyAttrsOf` for `home.sessionVariables`

`attrs` has unreasonable merge semantics and is deprecated. `attrsOf`
doesn't support variables depending on each other as is recommended in
the option's description.

* home-environment: restrict `sessionVariables` type

The consumer is `toString`, but we don't want to accept e.g. lists.
This commit is contained in:
Naïm Favier 2022-12-29 22:33:15 +01:00 committed by GitHub
parent 079a33a015
commit c8f6322303
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -256,7 +256,7 @@ in
home.sessionVariables = mkOption {
default = {};
type = types.attrs;
type = with types; lazyAttrsOf (oneOf [ str path int float ]);
example = { EDITOR = "emacs"; GS_OPTIONS = "-sPAPERSIZE=a4"; };
description = ''
Environment variables to always set at login.