diff --git a/nixos/boxes/mb1/blog.nix b/nixos/boxes/mb1/blog.nix new file mode 100644 index 00000000..d855c3c6 --- /dev/null +++ b/nixos/boxes/mb1/blog.nix @@ -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"; + }; +} diff --git a/nixos/boxes/mb1/default.nix b/nixos/boxes/mb1/default.nix index ea117510..86b4bc1b 100644 --- a/nixos/boxes/mb1/default.nix +++ b/nixos/boxes/mb1/default.nix @@ -6,9 +6,11 @@ ./boot.nix ./disks.nix ./search.nix + ./blog.nix ]; networking.hostName = "mb1"; + zramSwap = { enable = true; algorithm = "zstd";