Skip to content

Commit

Permalink
Nix module refactors
Browse files Browse the repository at this point in the history
  • Loading branch information
gepbird committed Dec 25, 2024
1 parent 447e399 commit 312896d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions nix/module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ let
package
;

dataDir = "/var/moe";
user = "moe";
cfg = config.moe;
in
{
Expand Down Expand Up @@ -66,7 +68,7 @@ in
config = mkIf cfg.enable {
users.users.moe = {
isSystemUser = true;
home = "/var/moe";
home = dataDir;
createHome = true;
group = cfg.group;
};
Expand All @@ -79,8 +81,9 @@ in
serviceConfig = {
Type = "simple";
ExecStart = "${cfg.package}/bin/moe --register-commands";
WorkingDirectory = "/var/moe";
User = "moe";
WorkingDirectory = dataDir;
User = user;
Group = cfg.group;
EnvironmentFile = cfg.credentialsFile;
Environment = "STATUS_PORT=${toString cfg.settings.status-port}";
};
Expand Down

0 comments on commit 312896d

Please sign in to comment.