diff options
author | sils <sils@sils.li> | 2023-03-07 17:09:27 +0100 |
---|---|---|
committer | sils <sils@sils.li> | 2023-03-07 17:46:49 +0100 |
commit | 7b16ff9198d53f5d04603cfd1b2e8c5b582a422c (patch) | |
tree | 7af41a629acce6bad36e43d61473b6113dc23b47 | |
parent | Merge pull request 'Merge to server1' (#16) from server1_develop into server1 (diff) | |
download | nixos-server-7b16ff9198d53f5d04603cfd1b2e8c5b582a422c.tar.gz nixos-server-7b16ff9198d53f5d04603cfd1b2e8c5b582a422c.zip |
Feat: Add Website
This provides an html file located at /srv/www/vhack.eu/index.html over https.
Diffstat (limited to '')
-rw-r--r-- | flake.nix | 1 | ||||
-rw-r--r-- | services/default.nix | 3 | ||||
-rw-r--r-- | services/services/acme.nix | 6 | ||||
-rw-r--r-- | services/services/nginx.nix | 15 |
4 files changed, 23 insertions, 2 deletions
diff --git a/flake.nix b/flake.nix index 2e52203..9df3c84 100644 --- a/flake.nix +++ b/flake.nix @@ -18,4 +18,3 @@ }; }; } - diff --git a/services/default.nix b/services/default.nix index 6983529..c301ba1 100644 --- a/services/default.nix +++ b/services/default.nix @@ -1,6 +1,7 @@ {config, ...}: { imports = [ - ./services/minecraft.nix + ./services/acme.nix + ./services/nginx.nix ./services/nix.nix ./services/opensshd.nix ./services/rust-motd.nix diff --git a/services/services/acme.nix b/services/services/acme.nix new file mode 100644 index 0000000..42f9ed5 --- /dev/null +++ b/services/services/acme.nix @@ -0,0 +1,6 @@ +{...}: { + security.acme = { + acceptTerms = true; + defaults.email = "admin@vhack.eu"; + }; +} diff --git a/services/services/nginx.nix b/services/services/nginx.nix new file mode 100644 index 0000000..204783b --- /dev/null +++ b/services/services/nginx.nix @@ -0,0 +1,15 @@ +{...}: { + networking.firewall = { + allowedTCPPorts = [80 443]; + }; + services.nginx = { + enable = true; + virtualHosts = { + "vhack.eu" = { + forceSSL = true; + enableACME = true; + root = "/srv/www/vhack.eu"; + }; + }; + }; +} |