flake.nix: add systemd service user option
This commit is contained in:
parent
a1f947eb50
commit
d3f2d25a0f
1 changed files with 9 additions and 3 deletions
12
flake.nix
12
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;
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue