diff --git a/dafoe/services/default.nix b/dafoe/services/default.nix index ed9b731..f1e0166 100644 --- a/dafoe/services/default.nix +++ b/dafoe/services/default.nix @@ -5,11 +5,10 @@ ./ddns.nix ./nginx.nix ./forgejo.nix + #./printing.nix ./restic.nix ./ssh.nix ./vaultwarden.nix ./nextcloud.nix - ./domains.nix ]; - services.domains.enable = true; } diff --git a/dafoe/services/domains.nix b/dafoe/services/domains.nix deleted file mode 100644 index c9c143a..0000000 --- a/dafoe/services/domains.nix +++ /dev/null @@ -1,64 +0,0 @@ -{ config, lib, pkgs, ... }: -with lib; -let - cfg = config.domains; -in - { - domains = { - enable = mkOption { - default = false; - type = types.nullOr types.bool; - }; - domain = mkOption { - description = '' - Domain of the server. - ''; - type = types.nullOr types.str; - }; - git = mkOption { - description = '' - Subdomain of the git instance. - ''; - type = types.nullOr types.str; - default = "git"; - }; - vaultwarden = mkOption { - description = '' - Subdomain of the vaultwarden instance - ''; - default = "vaultwarden"; - type = types.nullOr types.str; - }; - video = mkOption { - description = '' - Subdomain of the video instance - ''; - default = "video"; - type = types.nullOr types.str; - }; - www = mkOption { - description = '' - Subdomain of the www instance - ''; - default = "www"; - type = types.nullOr types.str; - }; - files = mkOption { - description = '' - Subdomain of the files instance - ''; - default = "files"; - type = types.nullOr types.str; - }; - cloud = mkOption { - description = '' - Subdomain of the cloud instance - ''; - default = "cloud"; - type = types.nullOr types.str; - }; - }; - config = mkIf cfg.enable { - gitURL = "${cfg.git}.${cfg.domain}"; - }; - } \ No newline at end of file diff --git a/dafoe/services/nextcloud.nix b/dafoe/services/nextcloud.nix index d9b62f4..483eec1 100644 --- a/dafoe/services/nextcloud.nix +++ b/dafoe/services/nextcloud.nix @@ -9,6 +9,7 @@ config.adminpassFile = "${../../nix-secrets/dafoe/nextcloud/adminpass}"; configureRedis = true; maxUploadSize = "1G"; + #nginx.enable = true; settings.overwriteProtocol = "https"; }; } diff --git a/dafoe/services/nginx.nix b/dafoe/services/nginx.nix index 3783f9a..45c2da5 100644 --- a/dafoe/services/nginx.nix +++ b/dafoe/services/nginx.nix @@ -1,4 +1,4 @@ -{ lib, pkgs, inputs, config, ... }: +{ lib, pkgs, inputs, ... }: { services.nginx = { enable = true; @@ -8,46 +8,50 @@ recommendedTlsSettings = true; }; - services.nginx.virtualHosts = let domain = "vatthauer.xyz"; in + services.nginx.virtualHosts = let tld = "vatthauer.xyz"; in { - "config.domains.gitURL" = { + "git.${tld}" = { enableACME = true; forceSSL = true; locations."/" = { proxyPass = "http://localhost:3001/"; }; }; - "vaultwarden.${domain}" = { - enableACME = true; - forceSSL = true; - locations."/" = { - proxyPass = "http://localhost:8222/"; - }; - }; - "video.${domain}" = { - enableACME = true; - forceSSL = false; - locations."/" = { - proxyPass = "http://localhost:8096"; - }; - }; - "www.${domain}" = { - serverAliases = [ domain ]; - forceSSL = true; - enableACME = true; - root = pkgs.callPackage ./resumee-website.nix {}; - }; - "files.${domain}" = { - forceSSL = true; - enableACME = true; - locations."/" = { - root = "/var/www"; - extraConfig = "autoindex on;"; - }; - }; - "cloud.${domain}" = { - forceSSL = true; - enableACME = true; + }; + + services.nginx.virtualHosts."vaultwarden.vatthauer.xyz" = { + enableACME = true; + forceSSL = true; + locations."/" = { + proxyPass = "http://localhost:8222/"; }; }; + + services.nginx.virtualHosts."video.vatthauer.xyz" = { + enableACME = true; + forceSSL = false; + locations."/" = { + proxyPass = "http://localhost:8096"; + }; + }; + services.nginx.virtualHosts."www.vatthauer.xyz" = { + serverAliases = [ "vatthauer.xyz" ]; + forceSSL = true; + enableACME = true; + root = pkgs.callPackage ./resumee-website.nix {}; + }; + services.nginx.virtualHosts."files.vatthauer.xyz" = { + forceSSL = true; + enableACME = true; + locations."/" = { + root = "/var/www"; + extraConfig = "autoindex on;"; + }; + }; + services.nginx.virtualHosts."cloud.vatthauer.xyz" = { + forceSSL = true; + enableACME = true; + #locations."/".proxyPass = "http://localhost:8080"; + # nextcloud does location setup itself + }; } diff --git a/dafoe/services/printing.nix b/dafoe/services/printing.nix new file mode 100644 index 0000000..321e5b2 --- /dev/null +++ b/dafoe/services/printing.nix @@ -0,0 +1,20 @@ +{ pkgs, ... }: +{ + # Enable CUPS to print documents. + services.avahi = { + enable = true; + publish.enable = true; + publish.userServices = true; + }; + services.printing = { + enable = true; + drivers = [ pkgs.splix ]; + browsing = true; + listenAddresses = [ "*:631" ]; + allowFrom = [ "all" ]; + defaultShared = true; + extraConf = '' + BrowseLocalProtocols all + ''; + }; +}