diff --git a/module/default.nix b/module/default.nix index ef6f05259f55a14842bdd3ccd4396eae2b8aa245..d8c7566622adbf98d081cbb11d7bdb1f65d8dc37 100644 --- a/module/default.nix +++ b/module/default.nix @@ -14,56 +14,43 @@ ... }: { options = { enable = lib.mkEnableOption "tsnet-serve-${name}"; - user = lib.mkOption { type = lib.types.str; default = "tsnet-serve"; description = "User to run tsnet-serve"; }; - backend = lib.mkOption { type = lib.types.nullOr lib.types.str; default = null; description = "Target URL to proxy"; example = "https://localhost:3000"; }; - hostname = lib.mkOption { type = lib.types.str; default = name; description = "App name"; example = "myapp"; }; - port = lib.mkOption { type = lib.types.port; default = 443; description = "Port to listen on"; }; - mountPath = lib.mkOption { type = lib.types.str; default = "/"; description = "Path to mount proxy on"; }; - stateDir = lib.mkOption { type = lib.types.str; default = "/var/lib/tsnet-serve-${name}"; description = "Directory to store state in"; }; - authKey = lib.mkOption { type = lib.types.nullOr lib.types.str; default = null; description = "Tailscale auth key"; }; - - package = lib.mkOption { - type = lib.types.package; - default = pkg; - description = "The tsnet-serve package to use"; - }; }; }; in { @@ -94,7 +81,7 @@ "--listen-port=${builtins.toString instanceCfg.port}" "--mount-path=${instanceCfg.mountPath}" "--state-dir=${instanceCfg.stateDir}" ]; - in "${cfg.package}/bin/tsnet-serve ${lib.concatStringsSep " " args}"; + in "${pkg}/bin/tsnet-serve ${lib.concatStringsSep " " args}"; User = instanceCfg.user; Restart = "on-failure"; Environment = ["TS_AUTHKEY=${instanceCfg.authKey}"];