Merge pull request from worldofpeace/pam-home

nixos/system-environment: use pam syntax for home variable
This commit is contained in:
worldofpeace 2019-10-05 15:04:31 +00:00 committed by GitHub
commit 60ddfac0c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 3 deletions
nixos/modules/config

View File

@ -78,9 +78,7 @@ in
# We're trying to use the same syntax for PAM variables and env variables. # We're trying to use the same syntax for PAM variables and env variables.
# That means we need to map the env variables that people might use to their # That means we need to map the env variables that people might use to their
# equivalent PAM variable. # equivalent PAM variable.
# Note: PAM_USER is a PAM_ITEM, HOME is an environment variable, they have replaceEnvVars = replaceStrings ["$HOME" "$USER"] ["@{HOME}" "@{PAM_USER}"];
# different syntax.
replaceEnvVars = replaceStrings ["$HOME" "$USER"] ["\${HOME}" "@{PAM_USER}"];
pamVariable = n: v: pamVariable = n: v:
''${n} DEFAULT="${concatStringsSep ":" (map replaceEnvVars (toList v))}"''; ''${n} DEFAULT="${concatStringsSep ":" (map replaceEnvVars (toList v))}"'';