diff options
| author | Collin Williams <96917990+bluedragon1221@users.noreply.github.com> | 2026-04-02 16:18:29 -0500 |
|---|---|---|
| committer | Collin Williams <96917990+bluedragon1221@users.noreply.github.com> | 2026-04-02 16:18:29 -0500 |
| commit | 48a837a91959efbc7da7f98447c50f32b4ee7c94 (patch) | |
| tree | 0b17514bd37b6de76a8a497ef3ac3d6bf696ae53 /modules/services/nixos/jta/default.nix | |
| parent | 871c22cae2ef84694502fde290838bb24432a1f4 (diff) | |
jta, other changes
Diffstat (limited to 'modules/services/nixos/jta/default.nix')
| -rw-r--r-- | modules/services/nixos/jta/default.nix | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/modules/services/nixos/jta/default.nix b/modules/services/nixos/jta/default.nix new file mode 100644 index 0000000..c1ea012 --- /dev/null +++ b/modules/services/nixos/jta/default.nix @@ -0,0 +1,49 @@ +{ + pkgs, + config, + lib, + ... +}: let + cfg = config.collinux.services.jta; + + package = pkgs.callPackage ./pkg.nix {}; +in { + imports = [ + (import ../mkCaddyCfg.nix cfg) + ]; + + config = lib.mkIf cfg.enable { + users.groups."jta" = {}; + users.users."jta" = { + isSystemUser = true; + group = "jta"; + extraGroups = ["fileserver"]; + + home = "/var/lib/jta"; + createHome = true; + homeMode = "755"; + }; + + systemd.services."jta" = { + description = "Juksere trives aldri, kids"; + restartIfChanged = true; + wants = ["network-online.target" "caddy.service"]; + after = ["network-online.target" "caddy.service"]; + + environment = { + PORT = toString cfg.port; + ROOT_DIR = "/media/jta"; + }; + + serviceConfig = { + User = "jta"; + Type = "simple"; + + WorkingDirectory = "/var/lib/jta"; + ExecStart = "${package}/bin/jta"; + }; + + wantedBy = ["multi-user.target"]; + }; + }; +} |
