start domain
This commit is contained in:
parent
af2abd3cb5
commit
f57f9a37f6
|
@ -174,6 +174,7 @@
|
||||||
services.openssh.enable = true;
|
services.openssh.enable = true;
|
||||||
services.openssh.settings.PasswordAuthentication = false;
|
services.openssh.settings.PasswordAuthentication = false;
|
||||||
# services.openssh.settings.PermitRootLogin = "proh";
|
# services.openssh.settings.PermitRootLogin = "proh";
|
||||||
|
services.nginx.enable = true;
|
||||||
security.acme = {
|
security.acme = {
|
||||||
acceptTerms = true;
|
acceptTerms = true;
|
||||||
defaults = {
|
defaults = {
|
||||||
|
@ -181,8 +182,12 @@
|
||||||
dnsProvider = "cloudflare";
|
dnsProvider = "cloudflare";
|
||||||
# # location of your CLOUDFLARE_DNS_API_TOKEN=[value]
|
# # location of your CLOUDFLARE_DNS_API_TOKEN=[value]
|
||||||
# # https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html#EnvironmentFile=
|
# # https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html#EnvironmentFile=
|
||||||
environmentFile = "/etc/nixos/.secrets/cloudflare_dns_tokend";
|
environmentFile = "/etc/nixos/.secrets/cloudflare_zone_dns_edit";
|
||||||
};
|
};
|
||||||
|
# certs."sondell.org" = {
|
||||||
|
# domain = "*.sondell.org";
|
||||||
|
# group = config.services.nginx.group;
|
||||||
|
# };
|
||||||
};
|
};
|
||||||
# networking.firewall.allowedTCPPorts = [ ... ];
|
# networking.firewall.allowedTCPPorts = [ ... ];
|
||||||
# networking.firewall.allowedUDPPorts = [ ... ];
|
# networking.firewall.allowedUDPPorts = [ ... ];
|
||||||
|
|
43
homepage.nix
43
homepage.nix
|
@ -1,25 +1,8 @@
|
||||||
{ homepage, ... }:
|
{homepage, ...}: let
|
||||||
|
domain1 = "sondell.org";
|
||||||
let
|
domain2 = "start.sondell.org";
|
||||||
domain = "sondell.org";
|
|
||||||
port = "8118";
|
port = "8118";
|
||||||
in
|
hostSettings = {
|
||||||
{
|
|
||||||
systemd.services.homepage = {
|
|
||||||
enable = true;
|
|
||||||
description = "homepage with links to selfhosted services";
|
|
||||||
wantedBy = [ "multi-user.target" ];
|
|
||||||
unitConfig = {
|
|
||||||
After="network-online.target";
|
|
||||||
};
|
|
||||||
serviceConfig = {
|
|
||||||
ExecStart = "${homepage}/bin/home-prod -p ${port}";
|
|
||||||
User= "sondell";
|
|
||||||
Type= "simple";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services.nginx.virtualHosts.${domain} = {
|
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
|
@ -27,5 +10,21 @@ in
|
||||||
proxyWebsockets = true;
|
proxyWebsockets = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
in {
|
||||||
|
systemd.services.homepage = {
|
||||||
|
enable = true;
|
||||||
|
description = "homepage with links to selfhosted services";
|
||||||
|
wantedBy = ["multi-user.target"];
|
||||||
|
unitConfig = {
|
||||||
|
After = "network-online.target";
|
||||||
|
};
|
||||||
|
serviceConfig = {
|
||||||
|
ExecStart = "${homepage}/bin/home-prod -p ${port}";
|
||||||
|
User = "sondell";
|
||||||
|
Type = "simple";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.nginx.virtualHosts.${domain1} = hostSettings;
|
||||||
|
services.nginx.virtualHosts.${domain2} = hostSettings;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue