diff options
| author | Collin Williams <96917990+bluedragon1221@users.noreply.github.com> | 2026-04-29 15:20:57 -0500 |
|---|---|---|
| committer | Collin Williams <96917990+bluedragon1221@users.noreply.github.com> | 2026-04-29 15:20:57 -0500 |
| commit | 9c9a49a855951662da62bcdec45f69ddc0099e5c (patch) | |
| tree | 1f7852971693d9e49d16a77aff51b87d39940b1b /modules/services/nixos/ganyupload/default.nix | |
| parent | 21de12cd6e63adf463674942f1a8f9b658f47945 (diff) | |
changes
Diffstat (limited to 'modules/services/nixos/ganyupload/default.nix')
| -rw-r--r-- | modules/services/nixos/ganyupload/default.nix | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/modules/services/nixos/ganyupload/default.nix b/modules/services/nixos/ganyupload/default.nix new file mode 100644 index 0000000..0138100 --- /dev/null +++ b/modules/services/nixos/ganyupload/default.nix @@ -0,0 +1,47 @@ +{ + pkgs, + config, + lib, + ... +}: let + cfg = config.collinux.services.ganyupload; + + package = pkgs.callPackage ./pkg.nix {}; +in { + imports = [ + (import ../mkCaddyCfg.nix cfg) + ]; + + config = lib.mkIf cfg.enable { + users.groups."ganyupload" = {}; + users.users."ganyupload" = { + isSystemUser = true; + group = "ganyupload"; + home = "/var/lib/ganyupload"; + createHome = true; + homeMode = "755"; + }; + + systemd.services."ganyupload" = { + description = "Ganymede File Upload Service"; + restartIfChanged = true; + wants = ["network-online.target" "caddy.service"]; + after = ["network-online.target" "caddy.service"]; + + environment = { + PORT = toString cfg.port; + UPLOAD_DIR = "/media/ganyupload"; + }; + + serviceConfig = { + User = "ganyupload"; + Type = "simple"; + + WorkingDirectory = "/var/lib/ganyupload"; + ExecStart = "${package}/bin/ganyupload"; + }; + + wantedBy = ["multi-user.target"]; + }; + }; +} |
