diff --git a/flake.nix b/flake.nix index 1688264..cd4c73e 100644 --- a/flake.nix +++ b/flake.nix @@ -65,6 +65,12 @@ Some utility commands: The ji-chan package that should be used. ''; }; + user = lib.mkOption { + type = lib.types.str; + description = lib.mdDoc '' + User account under which ji-chan runs. + ''; + }; domain = lib.mkOption { type = lib.types.str; default = "tegakituesday.com"; @@ -107,8 +113,7 @@ Some utility commands: 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} - ''; + ${ if (cfg.user != null) then "User=${cfg.user}\n" else "" }${cfg.package}/bin/ji-chan --domain ${cfg.domain} --token ${cfg.token} --prefix "${builtins.replaceStrings ["\""] ["\\\""] cfg.prefix}" --hugo ${cfg.hugo} --guilds ${cfg.guildData}''; Restart = "always"; DynamicUser = true; };