From d3f2d25a0f4bcaf470634019593fcea84b0228c8 Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Wed, 26 Mar 2025 14:11:44 -0700 Subject: [PATCH] flake.nix: add systemd service user option --- flake.nix | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index 1688264..85fbfe7 100644 --- a/flake.nix +++ b/flake.nix @@ -65,6 +65,13 @@ Some utility commands: The ji-chan package that should be used. ''; }; + user = lib.mkOption { + type = lib.types.str; + default = "ji-chan"; + description = lib.mdDoc '' + User account under which ji-chan runs. + ''; + }; domain = lib.mkOption { type = lib.types.str; default = "tegakituesday.com"; @@ -106,10 +113,9 @@ Some utility commands: after = [ "network.target" ]; wantedBy = [ "network.target" ]; serviceConfig = { - ExecStart = '' - ${cfg.package}/bin/ji-chan --domain ${cfg.domain} --token ${cfg.token} --prefix "${builtins.replaceStrings ["\""] ["\\\""] cfg.prefix}" --hugo ${cfg.hugo} --guilds ${cfg.guildData} - ''; + ExecStart = "${cfg.package}/bin/ji-chan --domain ${cfg.domain} --token ${cfg.token} --prefix \"${builtins.replaceStrings ["\""] ["\\\""] cfg.prefix}\" --hugo ${cfg.hugo} --guilds ${cfg.guildData}"; Restart = "always"; + User = cfg.user; DynamicUser = true; }; };