rustypaste: switch from root -> rustypaste user

This commit is contained in:
notohh 2024-05-31 12:52:56 -04:00
parent f6b905013f
commit 4f910fbcc3
Signed by: notohh
GPG key ID: BD47506D475EE86D

View file

@ -1,6 +1,16 @@
{pkgs, ...}: { {pkgs, ...}: {
environment.systemPackages = with pkgs; [rustypaste]; environment.systemPackages = with pkgs; [rustypaste];
users = {
users.rustypaste = {
isSystemUser = true;
group = "rustypaste";
};
groups.rustypaste = {
name = "rustypaste";
};
};
systemd.services.rustypaste = { systemd.services.rustypaste = {
enable = true; enable = true;
wantedBy = ["multi-user.target"]; wantedBy = ["multi-user.target"];
@ -9,7 +19,7 @@
CONFIG = "/var/lib/rustypaste/config.toml"; CONFIG = "/var/lib/rustypaste/config.toml";
}; };
serviceConfig = { serviceConfig = {
User = "root"; User = "rustypaste";
ExecStart = "${pkgs.rustypaste}/bin/rustypaste"; ExecStart = "${pkgs.rustypaste}/bin/rustypaste";
Restart = "always"; Restart = "always";
RestartSec = 30; RestartSec = 30;