From 4f910fbcc328608aca83b00795eac72a75bd7643 Mon Sep 17 00:00:00 2001 From: notohh Date: Fri, 31 May 2024 12:52:56 -0400 Subject: [PATCH] rustypaste: switch from root -> rustypaste user --- hosts/sakura/services/rustypaste.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/hosts/sakura/services/rustypaste.nix b/hosts/sakura/services/rustypaste.nix index b7bf771..2d26749 100644 --- a/hosts/sakura/services/rustypaste.nix +++ b/hosts/sakura/services/rustypaste.nix @@ -1,6 +1,16 @@ {pkgs, ...}: { environment.systemPackages = with pkgs; [rustypaste]; + users = { + users.rustypaste = { + isSystemUser = true; + group = "rustypaste"; + }; + groups.rustypaste = { + name = "rustypaste"; + }; + }; + systemd.services.rustypaste = { enable = true; wantedBy = ["multi-user.target"]; @@ -9,7 +19,7 @@ CONFIG = "/var/lib/rustypaste/config.toml"; }; serviceConfig = { - User = "root"; + User = "rustypaste"; ExecStart = "${pkgs.rustypaste}/bin/rustypaste"; Restart = "always"; RestartSec = 30;