mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 19:13:26 +03:00
nixos/users-groups: allow changing default home directory
This commit is contained in:
parent
53187aeafe
commit
6f7d7cf76f
2 changed files with 10 additions and 2 deletions
|
@ -477,7 +477,7 @@ let
|
|||
(mkIf config.isNormalUser {
|
||||
group = mkDefault "users";
|
||||
createHome = mkDefault true;
|
||||
home = mkDefault "/home/${config.name}";
|
||||
home = mkDefault "${cfg.defaultUserHome}/${config.name}";
|
||||
homeMode = mkDefault "700";
|
||||
useDefaultShell = mkDefault true;
|
||||
isSystemUser = mkDefault false;
|
||||
|
@ -753,6 +753,14 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
users.defaultUserHome = mkOption {
|
||||
type = types.str;
|
||||
default = "/home";
|
||||
description = ''
|
||||
The default home directory for normal users.
|
||||
'';
|
||||
};
|
||||
|
||||
# systemd initrd
|
||||
boot.initrd.systemd.users = mkOption {
|
||||
description = ''
|
||||
|
|
|
@ -217,7 +217,7 @@ in
|
|||
# /etc/default/useradd: configuration for useradd.
|
||||
"default/useradd".source = pkgs.writeText "useradd" ''
|
||||
GROUP=100
|
||||
HOME=/home
|
||||
HOME=${config.users.defaultUserHome}
|
||||
SHELL=${utils.toShellPath config.users.defaultUserShell}
|
||||
'';
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue