aboutsummaryrefslogtreecommitdiff
path: root/modules/services/sftpgo/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/services/sftpgo/default.nix')
-rw-r--r--modules/services/sftpgo/default.nix63
1 files changed, 0 insertions, 63 deletions
diff --git a/modules/services/sftpgo/default.nix b/modules/services/sftpgo/default.nix
deleted file mode 100644
index ae0af24..0000000
--- a/modules/services/sftpgo/default.nix
+++ /dev/null
@@ -1,63 +0,0 @@
-{
- config,
- lib,
- pkgs,
- ...
-}:
-with lib;
-let
- cfg = config.modules.services.sftpgo;
-in
-{
- options.modules.services.sftpgo = {
- enable = mkEnableOption "sftpgo";
- port = mkOption {
- default = 8080;
- type = types.int;
- };
- url = mkOption {
- default = null;
- type = types.str;
- };
- dataDir = mkOption {
- default = "/var/lib/sftpgo";
- type = types.str;
- };
- };
-
- config =
- let
- caddy = cfg.url != null;
- in
- mkIf cfg.enable {
- networking.firewall.allowedTCPPorts = mkIf caddy [
- 80
- 443
- ];
-
- services.caddy = mkIf caddy {
- enable = true;
- virtualHosts = {
- ${cfg.url}.extraConfig = ''
- root * /web/client
- encode zstd gzip
- reverse_proxy http://localhost:${builtins.toString cfg.port}
- '';
- };
- };
-
- services.sftpgo = {
- enable = true;
- package = pkgs.sftpgo;
- dataDir = cfg.dataDir;
- settings = {
- httpd.bindings = lib.singleton {
- port = cfg.port;
- address = "0.0.0.0";
- enable_web_client = true;
- enable_web_admin = true;
- };
- };
- };
- };
-}