diff options
| author | Kyren223 <kyren223@proton.me> | 2025-08-03 20:20:49 +0300 |
|---|---|---|
| committer | Kyren223 <kyren223@proton.me> | 2025-08-03 20:20:49 +0300 |
| commit | 3c7f1a8c2c46271ca889a523734cb32e6bcc4cd7 (patch) | |
| tree | cc0f11b5eac03b594799f90776f79a805c8c79ff | |
| parent | d427beaebabb5f68c3817b96c9f528ed36169ceb (diff) | |
Replaced state dir with runtime dir, hopefully fixes issues
| -rw-r--r-- | service.nix | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/service.nix b/service.nix index a0750ac..50473b2 100644 --- a/service.nix +++ b/service.nix @@ -55,6 +55,23 @@ in type = lib.types.path; }; + user = lib.mkOption { + description = "Eko user"; + default = "eko"; + type = lib.types.str; + }; + + group = lib.mkOption { + description = "Eko group"; + default = "eko"; + type = lib.types.str; + }; + + permission = lib.mkOption { + description = "Permission to access dataDir"; + default = "0750"; + type = lib.types.str; + }; }; config = lib.mkIf cfg.enable { @@ -71,6 +88,10 @@ in group = "eko"; }; + systemd.tmpfiles.rules = [ + "d '${cfg.dataDir}' ${cfg.permission} ${cfg.user} ${cfg.group} - -" + ]; + # Systemd service for eko systemd.services.eko = { description = "Eko - a secure terminal-native social media platform"; @@ -98,14 +119,17 @@ in ExecReload = "${pkgs.coreutils}/bin/kill -SIGHUP $MAINPID"; ConfigurationDirectory = "eko"; - StateDirectory = "eko"; - StateDirectoryMode = "0700"; + # StateDirectory = "eko"; + # StateDirectoryMode = "0700"; + # Runtime directory and mode + RuntimeDirectory = "eko"; + RuntimeDirectoryMode = cfg.permission; LogsDirectory = "eko"; WorkingDirectory = cfg.dataDir; Type = "simple"; - User = "eko"; - Group = "eko"; + User = cfg.user; + Group = cfg.group; # Hardening ProtectHome = true; |
