From 9b9a0c33c3c70ce635dfc6908cc8b418c392c1fc Mon Sep 17 00:00:00 2001 From: Rob Date: Wed, 5 Jun 2024 07:06:45 +0000 Subject: [PATCH] add nextcloud with htts via tailscale/acme-LetsEncrypt --- configuration.nix | 21 ++++++++++----------- modules/nextcloud.nix | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 11 deletions(-) create mode 100644 modules/nextcloud.nix diff --git a/configuration.nix b/configuration.nix index ac50489..14203a1 100644 --- a/configuration.nix +++ b/configuration.nix @@ -12,15 +12,16 @@ ./hardware-configuration.nix # meine module - ./modules/cron.nix - ./modules/users.nix - ./modules/storage.nix - ./modules/root-programs.nix - ./modules/smb.nix - ./modules/tailscale.nix - ./modules/tmux.nix -# ./modules/minetest-server.nix -# ./modules/wifi.nix ## noch kein device gefunden das geht. das kleine dwa-171 geht nicht + modules/cron.nix + modules/users.nix + modules/storage.nix + modules/root-programs.nix + modules/smb.nix + modules/tailscale.nix + modules/tmux.nix + modules/nextcloud.nix +# modules/minetest-server.nix +# modules/wifi.nix ## noch kein device gefunden das geht. das kleine dwa-171 geht nicht ]; # Use the GRUB 2 boot loader. @@ -32,8 +33,6 @@ # boot.loader.grub.device = "/dev/disk/by-label/nixos"; #"/dev/sda"; # or "nodev" for efi only boot.loader.grub.device = "/dev/disk/by-id/ata-TOSHIBA_MK5061GSY_3273P0RAT"; - - networking.hostName = "bfds"; # Define your hostname. # Pick only one of the below networking options. # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. diff --git a/modules/nextcloud.nix b/modules/nextcloud.nix new file mode 100644 index 0000000..a1a6170 --- /dev/null +++ b/modules/nextcloud.nix @@ -0,0 +1,38 @@ +{ pkgs, ... }: +{ + services.nextcloud = { + package = pkgs.nextcloud29; + enable = true; + hostName = "bfds.taila388c.ts.net"; + config.extraTrustedDomains = [ "bfds" "bfds.local" ]; + + database.createLocally = true; + config = { + dbtype = "pgsql"; + adminpassFile = "/var/lib/nextcloud-pass-files/nc-admin-password"; + }; + extraApps = { + inherit (pkgs.nextcloud29Packages.apps) + cookbook + notes + ; + }; + extraAppsEnable = true; + https = true; + }; + + services.nginx.virtualHosts."bfds.taila388c.ts.net" = { + addSSL = true; +# forceSSL = true; + enableACME = true; + }; + + security.acme = { + acceptTerms = true; + defaults.email = "rw@boogiedev.net"; + certs = { + "bfds.taila388c.ts.net".email = "rw@boogiedev.net"; + }; + }; + networking.firewall.allowedTCPPorts = [ 80 443 ]; +}