Add nginx for static websites

This commit is contained in:
thiloho
2023-07-29 22:33:53 +02:00
parent d2fd6028a0
commit afc455b419
3 changed files with 88 additions and 20 deletions

53
flake.lock generated
View File

@@ -1,5 +1,23 @@
{
"nodes": {
"aurora-blog-template": {
"inputs": {
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1686592676,
"narHash": "sha256-rUU3nwKtuQVUopwQ4ZVzfFujMqA9elih6BVugtpKAPQ=",
"owner": "thiloho",
"repo": "aurora",
"rev": "0017fcdfa743a65a5fd4da8871f33425f7c84f28",
"type": "github"
},
"original": {
"owner": "thiloho",
"repo": "aurora",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
@@ -21,6 +39,21 @@
}
},
"nixpkgs": {
"locked": {
"lastModified": 1684787197,
"narHash": "sha256-tvGDj3zgpW5NGoVKvoTQvkhfFPDgkbzfX+zFUW8NeHw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e2614d8ebcdf9a9eae0efe074f4d745d28595886",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1689282004,
"narHash": "sha256-VNhuyb10c9SV+3hZOlxwJwzEGytZ31gN9w4nPCnNvdI=",
@@ -38,8 +71,26 @@
},
"root": {
"inputs": {
"aurora-blog-template": "aurora-blog-template",
"home-manager": "home-manager",
"nixpkgs": "nixpkgs"
"nixpkgs": "nixpkgs_2",
"website": "website"
}
},
"website": {
"flake": false,
"locked": {
"lastModified": 1690057185,
"narHash": "sha256-Tcpi9P+7pEDC8/mJLOAuFJJf/ddXFjwmksoxRehm9FE=",
"owner": "thiloho",
"repo": "website",
"rev": "993d7e0c7cf62477036b023bac766174e9f39970",
"type": "github"
},
"original": {
"owner": "thiloho",
"repo": "website",
"type": "github"
}
}
},

View File

@@ -5,12 +5,18 @@
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
website = {
url = "github:thiloho/website";
flake = false;
};
aurora-blog-template.url = "github:thiloho/aurora";
};
outputs = { nixpkgs, home-manager, ... }: {
outputs = inputs@{ nixpkgs, home-manager, ... }: {
nixosConfigurations = let
mkSystem = entrypoint: nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
entrypoint
home-manager.nixosModules.home-manager

View File

@@ -1,4 +1,4 @@
{ ... }:
{ inputs, ... }:
{
imports = [
@@ -8,25 +8,36 @@
networking.hostName = "server";
services.minecraft-server = {
enable = true;
eula = true;
declarative = true;
openFirewall = true;
whitelist = {
thilo_ho = "4e4d744d-7748-46bc-add8-b3e8ca3b4cf5";
services = {
minecraft-server = {
enable = true;
eula = true;
declarative = true;
openFirewall = true;
whitelist = {
thilo_ho = "4e4d744d-7748-46bc-add8-b3e8ca3b4cf5";
};
serverProperties = {
difficulty = 3;
max-players = 10;
motd = "Minecraft server of Thilo.";
white-list = true;
};
};
serverProperties = {
difficulty = 3;
max-players = 10;
motd = "Minecraft server of Thilo.";
white-list = true;
openssh = {
enable = true;
};
nginx = {
enable = true;
virtualHosts = {
"thilohohlt.com" = {
root = inputs.website;
locations."/" = {
proxyPass = "http://localhost:1000";
};
};
};
};
};
services.openssh = {
enable = true;
settings.PasswordAuthentication = false;
};
users.users.thiloho.openssh.authorizedKeys.keys = [