8 cfg = config.services.homebox;
18 options.services.homebox = {
19 enable = mkEnableOption "homebox";
20 package = mkPackageOption pkgs "homebox" { };
21 settings = lib.mkOption {
22 type = types.attrsOf types.str;
24 HBOX_STORAGE_DATA = "/var/lib/homebox/data";
25 HBOX_STORAGE_SQLITE_URL = "/var/lib/homebox/data/homebox.db?_pragma=busy_timeout=999&_pragma=journal_mode=WAL&_fk=1";
26 HBOX_OPTIONS_ALLOW_REGISTRATION = "false";
27 HBOX_MODE = "production";
30 The homebox configuration as Environment variables. For definitions and available options see the upstream
31 [documentation](https://homebox.software/en/quick-start.html#env-variables-configuration).
36 config = mkIf cfg.enable {
37 users.users.homebox = {
41 users.groups.homebox = { };
42 services.homebox.settings = {
43 HBOX_STORAGE_DATA = mkDefault "/var/lib/homebox/data";
44 HBOX_STORAGE_SQLITE_URL = mkDefault "/var/lib/homebox/data/homebox.db?_pragma=busy_timeout=999&_pragma=journal_mode=WAL&_fk=1";
45 HBOX_OPTIONS_ALLOW_REGISTRATION = mkDefault "false";
46 HBOX_MODE = mkDefault "production";
48 systemd.services.homebox = {
49 after = [ "network.target" ];
50 environment = cfg.settings;
54 ExecStart = lib.getExe cfg.package;
55 StateDirectory = "homebox";
56 WorkingDirectory = "/var/lib/homebox";
57 LimitNOFILE = "1048576";
59 PrivateDevices = true;
60 StateDirectoryMode = "0700";
64 CapabilityBoundingSet = "";
65 LockPersonality = true;
66 MemoryDenyWriteExecute = true;
69 ProtectControlGroups = true;
71 ProtectHostname = true;
72 ProtectKernelLogs = true;
73 ProtectKernelModules = true;
74 ProtectKernelTunables = true;
75 ProtectProc = "invisible";
77 ProtectSystem = "strict";
78 RestrictAddressFamilies = [
83 RestrictNamespaces = true;
84 RestrictRealtime = true;
85 SystemCallArchitectures = "native";
90 RestrictSUIDSGID = true;
94 wantedBy = [ "multi-user.target" ];
97 meta.maintainers = with lib.maintainers; [ patrickdag ];