···
cfg = config.services.homed;
12
-
options.services.homed.enable = lib.mkEnableOption ''
13
-
systemd home area/user account manager
13
+
options.services.homed = {
14
+
enable = lib.mkEnableOption "systemd home area/user account manager";
17
+
lib.mkEnableOption ''
18
+
interactively prompting for user creation on first boot
24
+
settings.Home = lib.mkOption {
26
+
type = lib.types.submodule {
27
+
freeformType = lib.types.attrsOf utils.systemdUtils.unitOptions.unitOption;
30
+
DefaultStorage = "luks";
31
+
DefaultFileSystemType = "btrfs";
34
+
Options for systemd-homed. See {manpage}`homed.conf(5)` man page for
config = lib.mkIf cfg.enable {
assertion = config.services.nscd.enable;
20
-
message = "systemd-homed requires the use of systemd nss module. services.nscd.enable must be set to true,";
45
+
systemd-homed requires the use of the systemd nss module.
46
+
services.nscd.enable must be set to true.
systemd.additionalUpstreamSystemUnits = [
"systemd-homed-activate.service"
54
+
"systemd-homed-firstboot.service"
29
-
# This is mentioned in homed's [Install] section.
31
-
# While homed appears to work without it, it's probably better
32
-
# to follow upstream recommendations.
33
-
services.userdbd.enable = lib.mkDefault true;
57
+
# homed exposes SSH public keys and other user metadata using userdb
58
+
services.userdbd = {
60
+
enableSSHSupport = lib.mkDefault config.services.openssh.enable;
63
+
# Enable creation and mounting of LUKS home areas with all filesystems
64
+
# supported by systemd-homed.
65
+
boot.supportedFilesystems = [
71
+
environment.etc."systemd/homed.conf".text = ''
73
+
${utils.systemdUtils.lib.attrsToSection cfg.settings.Home}
37
-
# These packages are required to manage encrypted volumes
78
+
# These packages are required to manage home areas with LUKS storage
path = config.system.fsPackages;
aliases = [ "dbus-org.freedesktop.home1.service" ];
wantedBy = [ "multi-user.target" ];
systemd-homed-activate = {
85
+
wantedBy = [ "systemd-homed.service" ];
88
+
systemd-homed-firstboot = {
89
+
enable = cfg.promptOnFirstBoot;
wantedBy = [ "systemd-homed.service" ];