summary refs log tree commit diff
path: root/nixos/modules/config
diff options
context:
space:
mode:
authorfigsoda <figsoda@pm.me>2022-12-27 15:02:29 -0500
committerGitHub <noreply@github.com>2022-12-27 15:02:29 -0500
commit0eef5edd1feb8b7572193f03842155da6499a927 (patch)
tree52010a867c23e400330f8d485be0be6d7cbe44fa /nixos/modules/config
parent4984fe2fb6757bd0155cb4a41dcacc6f9b13cde6 (diff)
parent579f230b0a0e00427c038a8b5948aff5ee082f3b (diff)
downloadnixpkgs-0eef5edd1feb8b7572193f03842155da6499a927.tar
nixpkgs-0eef5edd1feb8b7572193f03842155da6499a927.tar.gz
nixpkgs-0eef5edd1feb8b7572193f03842155da6499a927.tar.bz2
nixpkgs-0eef5edd1feb8b7572193f03842155da6499a927.tar.lz
nixpkgs-0eef5edd1feb8b7572193f03842155da6499a927.tar.xz
nixpkgs-0eef5edd1feb8b7572193f03842155da6499a927.tar.zst
nixpkgs-0eef5edd1feb8b7572193f03842155da6499a927.zip
Merge pull request #201427 from figsoda/path-var
nixos/environment: accept path for variables and sessionVariables
Diffstat (limited to 'nixos/modules/config')
-rw-r--r--nixos/modules/config/shells-environment.nix4
-rw-r--r--nixos/modules/config/system-environment.nix5
2 files changed, 4 insertions, 5 deletions
diff --git a/nixos/modules/config/shells-environment.nix b/nixos/modules/config/shells-environment.nix
index 50bb9b17783..d5ec420f304 100644
--- a/nixos/modules/config/shells-environment.nix
+++ b/nixos/modules/config/shells-environment.nix
@@ -42,8 +42,8 @@ in
         strings.  The latter is concatenated, interspersed with colon
         characters.
       '';
-      type = with types; attrsOf (either str (listOf str));
-      apply = mapAttrs (n: v: if isList v then concatStringsSep ":" v else v);
+      type = with types; attrsOf (oneOf [ str path (listOf str) ]);
+      apply = mapAttrs (n: v: if isList v then concatStringsSep ":" v else "${v}");
     };
 
     environment.profiles = mkOption {
diff --git a/nixos/modules/config/system-environment.nix b/nixos/modules/config/system-environment.nix
index 5b226d5079b..39930418522 100644
--- a/nixos/modules/config/system-environment.nix
+++ b/nixos/modules/config/system-environment.nix
@@ -1,6 +1,6 @@
 # This module defines a system-wide environment that will be
 # initialised by pam_env (that is, not only in shells).
-{ config, lib, pkgs, ... }:
+{ config, lib, options, pkgs, ... }:
 
 with lib;
 
@@ -32,8 +32,7 @@ in
         therefore not possible to use PAM style variables such as
         `@{HOME}`.
       '';
-      type = with types; attrsOf (either str (listOf str));
-      apply = mapAttrs (n: v: if isList v then concatStringsSep ":" v else v);
+      inherit (options.environment.variables) type apply;
     };
 
     environment.profileRelativeSessionVariables = mkOption {