expose blog via nginx

This commit is contained in:
Cyryl Płotnicki 2023-08-12 18:15:18 +01:00
parent d43f1b2867
commit 6190998c8a
2 changed files with 34 additions and 0 deletions

32
nixos/boxes/mb1/blog.nix Normal file
View file

@ -0,0 +1,32 @@
{ config, pkgs, ... }:
let
path = "/var/www/blog/";
in
{
imports = [ ../nginx.nix ];
services.nginx = {
virtualHosts = {
"blog.cyplo.net" = {
forceSSL = true;
enableACME = true;
locations."/" = {
root = path;
index = "index.html";
};
};
};
};
users.extraUsers.blog = {
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB9dJ1elfJvH9SgmSVKOYgkxJBagWusLvJJ9RsEnzCik cyryl@foryog"
];
shell = null;
group = "nginx";
isSystemUser = false;
isNormalUser = true;
home = path;
createHome = true;
homeMode = "750";
};
}

View file

@ -6,9 +6,11 @@
./boot.nix
./disks.nix
./search.nix
./blog.nix
];
networking.hostName = "mb1";
zramSwap = {
enable = true;
algorithm = "zstd";