Added nix-serve config

Could use some work, but it works for now.
This commit is contained in:
Alejandro Angulo 2023-03-24 21:04:13 -07:00
parent 4536c79c68
commit 2627bc30d5
Signed by: alejandro-angulo
GPG key ID: 75579581C74554B6
2 changed files with 57 additions and 28 deletions

View file

@ -27,6 +27,11 @@
apps.tmux.enable = true;
services.openssh.enable = true;
services.nix-serve = {
enable = true;
domain_name = "kilonull.com";
subdomain_name = "gospel";
};
};
boot.binfmt.emulatedSystems = ["aarch64-linux" "armv6l-linux"];
@ -102,34 +107,6 @@
nssmdns = true;
};
services.nix-serve = {
enable = true;
secretKeyFile = "/var/gospelCache";
};
services.nginx = {
enable = true;
virtualHosts = {
"gospel.kilonull.com" = {
serverAliases = ["gospel"];
locations."/".extraConfig = ''
proxy_pass http://localhost:${toString config.services.nix-serve.port};
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
'';
};
};
};
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
networking.firewall = {
allowedTCPPorts = [80];
};
# Copy the NixOS configuration file and link it from the resulting system
# (/run/current-system/configuration.nix). This is useful in case you
# accidentally delete configuration.nix.