From e5e9dfd1de2a034b8ebc2b7e0d07192c9cfe0755 Mon Sep 17 00:00:00 2001 From: oqyude Date: Thu, 16 Jul 2026 01:32:50 +0300 Subject: [PATCH] samba fixup --- modules/server/default.nix | 1 + modules/server/nextcloud.nix | 28 +--------------------- modules/server/onlyoffice.nix | 45 +++++++++++++++++++++++++++++++++++ modules/server/samba.nix | 8 ++++++- modules/vds/nginx.nix | 12 ++++++++++ 5 files changed, 66 insertions(+), 28 deletions(-) create mode 100644 modules/server/onlyoffice.nix diff --git a/modules/server/default.nix b/modules/server/default.nix index 37aa47a..bf2794e 100644 --- a/modules/server/default.nix +++ b/modules/server/default.nix @@ -18,6 +18,7 @@ ./nextcloud.nix ./nginx.nix ./nix-serve.nix + # ./onlyoffice.nix ./postgresql.nix ./samba.nix ./step-ca.nix diff --git a/modules/server/nextcloud.nix b/modules/server/nextcloud.nix index f62e863..1d50b96 100644 --- a/modules/server/nextcloud.nix +++ b/modules/server/nextcloud.nix @@ -1,8 +1,8 @@ { config, + inputs, lib, pkgs, - inputs, xlib, ... }: @@ -170,16 +170,6 @@ in # }; # }; # }; - onlyoffice = { - enable = false; - # package = previous.onlyoffice-documentserver; - hostname = "office.home.arpa"; - port = 8090; - allowLocalConnections = true; - wopi = true; - jwtSecretFile = config.sops.secrets.onlyoffice-jwt.path; - securityNonceFile = config.sops.secrets.onlyoffice-nonce.path; - }; }; # fonts.packages = [ work.corefonts ]; @@ -240,22 +230,6 @@ in group = "nextcloud"; mode = "0650"; }; - onlyoffice-nonce = { - format = "yaml"; - key = "nonce"; - sopsFile = ./secrets/onlyoffice.yaml; - owner = "onlyoffice"; - group = "onlyoffice"; - mode = "0650"; - }; - onlyoffice-jwt = { - format = "yaml"; - key = "jwt"; - sopsFile = ./secrets/onlyoffice.yaml; - owner = "onlyoffice"; - group = "onlyoffice"; - mode = "0650"; - }; nextcloud-talk-secret = { format = "yaml"; key = "nextcloud-talk-secret"; diff --git a/modules/server/onlyoffice.nix b/modules/server/onlyoffice.nix new file mode 100644 index 0000000..7765afd --- /dev/null +++ b/modules/server/onlyoffice.nix @@ -0,0 +1,45 @@ +{ + config, + inputs, + lib, + pkgs, + xlib, + ... +}: +let + previous = import inputs.nixpkgs-master { + system = "x86_64-linux"; + config.allowUnfree = true; + config.allowUnfreePredicate = true; + }; +in +{ + services.onlyoffice = { + enable = true; + # package = previous.onlyoffice-documentserver; + hostname = "office.home.arpa"; + port = 8090; + allowLocalConnections = true; + wopi = true; + jwtSecretFile = config.sops.secrets.onlyoffice-jwt.path; + securityNonceFile = config.sops.secrets.onlyoffice-nonce.path; + }; + sops.secrets = { + onlyoffice-nonce = { + format = "yaml"; + key = "nonce"; + sopsFile = ./secrets/onlyoffice.yaml; + owner = "onlyoffice"; + group = "onlyoffice"; + mode = "0650"; + }; + onlyoffice-jwt = { + format = "yaml"; + key = "jwt"; + sopsFile = ./secrets/onlyoffice.yaml; + owner = "onlyoffice"; + group = "onlyoffice"; + mode = "0650"; + }; + }; +} diff --git a/modules/server/samba.nix b/modules/server/samba.nix index 1048885..058a647 100644 --- a/modules/server/samba.nix +++ b/modules/server/samba.nix @@ -1,9 +1,15 @@ { config, + inputs, pkgs, xlib, ... }: +let + stable = import inputs.nixpkgs-master { + system = "x86_64-linux"; + }; +in { services = { samba-wsdd = { @@ -14,7 +20,7 @@ }; samba = { enable = true; - package = pkgs.samba4Full; + # package = pkgs.samba4Full; nmbd = { enable = true; }; diff --git a/modules/vds/nginx.nix b/modules/vds/nginx.nix index 68c0081..d9cd2c9 100644 --- a/modules/vds/nginx.nix +++ b/modules/vds/nginx.nix @@ -49,6 +49,10 @@ in proxyPass = "http://localhost:2096"; proxyWebsockets = true; }; + "/clash/" = { + proxyPass = "http://localhost:2096"; + proxyWebsockets = true; + }; }; }; "kuma.zeroq.su" = { @@ -75,6 +79,14 @@ in proxyWebsockets = true; }; }; + "homebox.zeroq.su" = { + forceSSL = true; + enableACME = true; + locations."/" = { + proxyPass = "http://${server}:7745"; + proxyWebsockets = true; + }; + }; # "agent.zeroq.su" = { # forceSSL = true; # enableACME = true;