This reverts commit 1219865a7f.
This commit is contained in:
Leon Vatthauer 2024-06-17 17:32:13 +02:00
parent a434afb90c
commit 61ca79dbd1
Signed by: leonv
SSH key fingerprint: SHA256:G4+ddwoZmhLPRB1agvXzZMXIzkVJ36dUYZXf5NxT+u8
5 changed files with 60 additions and 100 deletions

View file

@ -5,11 +5,10 @@
./ddns.nix ./ddns.nix
./nginx.nix ./nginx.nix
./forgejo.nix ./forgejo.nix
#./printing.nix
./restic.nix ./restic.nix
./ssh.nix ./ssh.nix
./vaultwarden.nix ./vaultwarden.nix
./nextcloud.nix ./nextcloud.nix
./domains.nix
]; ];
services.domains.enable = true;
} }

View file

@ -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}";
};
}

View file

@ -9,6 +9,7 @@
config.adminpassFile = "${../../nix-secrets/dafoe/nextcloud/adminpass}"; config.adminpassFile = "${../../nix-secrets/dafoe/nextcloud/adminpass}";
configureRedis = true; configureRedis = true;
maxUploadSize = "1G"; maxUploadSize = "1G";
#nginx.enable = true;
settings.overwriteProtocol = "https"; settings.overwriteProtocol = "https";
}; };
} }

View file

@ -1,4 +1,4 @@
{ lib, pkgs, inputs, config, ... }: { lib, pkgs, inputs, ... }:
{ {
services.nginx = { services.nginx = {
enable = true; enable = true;
@ -8,36 +8,39 @@
recommendedTlsSettings = true; 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; enableACME = true;
forceSSL = true; forceSSL = true;
locations."/" = { locations."/" = {
proxyPass = "http://localhost:3001/"; proxyPass = "http://localhost:3001/";
}; };
}; };
"vaultwarden.${domain}" = { };
services.nginx.virtualHosts."vaultwarden.vatthauer.xyz" = {
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
locations."/" = { locations."/" = {
proxyPass = "http://localhost:8222/"; proxyPass = "http://localhost:8222/";
}; };
}; };
"video.${domain}" = {
services.nginx.virtualHosts."video.vatthauer.xyz" = {
enableACME = true; enableACME = true;
forceSSL = false; forceSSL = false;
locations."/" = { locations."/" = {
proxyPass = "http://localhost:8096"; proxyPass = "http://localhost:8096";
}; };
}; };
"www.${domain}" = { services.nginx.virtualHosts."www.vatthauer.xyz" = {
serverAliases = [ domain ]; serverAliases = [ "vatthauer.xyz" ];
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
root = pkgs.callPackage ./resumee-website.nix {}; root = pkgs.callPackage ./resumee-website.nix {};
}; };
"files.${domain}" = { services.nginx.virtualHosts."files.vatthauer.xyz" = {
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
locations."/" = { locations."/" = {
@ -45,9 +48,10 @@
extraConfig = "autoindex on;"; extraConfig = "autoindex on;";
}; };
}; };
"cloud.${domain}" = { services.nginx.virtualHosts."cloud.vatthauer.xyz" = {
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
}; #locations."/".proxyPass = "http://localhost:8080";
# nextcloud does location setup itself
}; };
} }

View file

@ -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
'';
};
}