diff options
author | zimbatm <zimbatm@zimbatm.com> | 2016-06-19 23:36:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-19 23:36:45 +0100 |
commit | 31c158ad453547993095b9425a60697738fdac5d (patch) | |
tree | 6b7239b1cab6571b745050a5e4ccd70045037f52 /nixos/modules/programs/shadow.nix | |
parent | b0f8416c5c0e5345897832ae0cce139ed85c7fdb (diff) | |
parent | 2974b6f4c8224ab1097e9386d6b3a0d570f95531 (diff) | |
download | nixlib-31c158ad453547993095b9425a60697738fdac5d.tar nixlib-31c158ad453547993095b9425a60697738fdac5d.tar.gz nixlib-31c158ad453547993095b9425a60697738fdac5d.tar.bz2 nixlib-31c158ad453547993095b9425a60697738fdac5d.tar.lz nixlib-31c158ad453547993095b9425a60697738fdac5d.tar.xz nixlib-31c158ad453547993095b9425a60697738fdac5d.tar.zst nixlib-31c158ad453547993095b9425a60697738fdac5d.zip |
Merge pull request #16189 from zimbatm/usershell-config
User shell config
Diffstat (limited to 'nixos/modules/programs/shadow.nix')
-rw-r--r-- | nixos/modules/programs/shadow.nix | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/nixos/modules/programs/shadow.nix b/nixos/modules/programs/shadow.nix index 566398d839fd..6398509357a6 100644 --- a/nixos/modules/programs/shadow.nix +++ b/nixos/modules/programs/shadow.nix @@ -1,6 +1,6 @@ # Configuration for the pwdutils suite of tools: passwd, useradd, etc. -{ config, lib, pkgs, ... }: +{ config, lib, utils, pkgs, ... }: with lib; @@ -43,13 +43,13 @@ in users.defaultUserShell = lib.mkOption { description = '' This option defines the default shell assigned to user - accounts. This must not be a store path, since the path is + accounts. This can be either a full system path or a shell package. + + This must not be a store path, since the path is used outside the store (in particular in /etc/passwd). - Rather, it should be the path of a symlink that points to the - actual shell in the Nix store. ''; - example = "/run/current-system/sw/bin/zsh"; - type = types.path; + example = literalExample "pkgs.zsh"; + type = types.either types.path types.shellPackage; }; }; @@ -60,7 +60,9 @@ in config = { environment.systemPackages = - lib.optional config.users.mutableUsers pkgs.shadow; + lib.optional config.users.mutableUsers pkgs.shadow ++ + lib.optional (types.shellPackage.check config.users.defaultUserShell) + config.users.defaultUserShell; environment.etc = [ { # /etc/login.defs: global configuration for pwdutils. You @@ -74,7 +76,7 @@ in '' GROUP=100 HOME=/home - SHELL=${config.users.defaultUserShell} + SHELL=${utils.toShellPath config.users.defaultUserShell} ''; target = "default/useradd"; } |