Skip to content

Commit 63e4076

Browse files
committed
nixos.nginx: add default host
1 parent de409e3 commit 63e4076

File tree

3 files changed

+17
-12
lines changed

3 files changed

+17
-12
lines changed

hosts/krypton/configuration.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
downloads.enable = true;
99

10-
tobias-happ.enable = true;
10+
#tobias-happ.enable = true;
1111
};
1212

1313
base.server = {

nixos/applications/tobias-happ/default.nix

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ let
88

99
cfg = config.custom.applications.tobias-happ;
1010

11-
#website = pkgs.runCommand "tobias-happ.de" { } ''
12-
# install -D -m 0400 ${./index.html} ${placeholder "out"}/index.html
13-
# install -D -m 0400 ${./robots.txt} ${placeholder "out"}/robots.txt
14-
#'';
11+
website = pkgs.runCommand "tobias-happ.de" { } ''
12+
install -D -m 0400 ${./index.html} $out/index.html
13+
install -D -m 0400 ${./robots.txt} $out/robots.txt
14+
'';
1515
in
1616

1717
{
@@ -33,15 +33,14 @@ in
3333

3434
services.nginx.virtualHosts = {
3535
"tobias-happ.de" = {
36-
default = true;
37-
root = "/var/empty";
36+
root = website;
3837
enableACME = true;
3938
forceSSL = true;
40-
#extraConfig = "error_page 404 @notfound;";
41-
#locations = {
42-
# "/".index = "index.html";
43-
# "@notfound".extraConfig = "return 302 /;";
44-
#};
39+
extraConfig = "error_page 404 @notfound;";
40+
locations = {
41+
"/".index = "index.html";
42+
"@notfound".extraConfig = "return 302 /;";
43+
};
4544
};
4645

4746
"*.tobias-happ.de".extraConfig = "return 302 https://tobias-happ.de/;";

nixos/services/applications/nginx.nix

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ in
4141
recommendedTlsSettings = true;
4242
recommendedGzipSettings = true;
4343
recommendedProxySettings = true;
44+
45+
virtualHosts._ = {
46+
default = true;
47+
root = "/var/empty";
48+
};
49+
4450
};
4551

4652
};

0 commit comments

Comments
 (0)