website maybe

This commit is contained in:
twoneis 2025-02-06 18:51:46 +01:00
parent 65139a31ac
commit 3e96b08562
5 changed files with 28 additions and 0 deletions

View file

@ -2,6 +2,7 @@
conf = { conf = {
ssh.enable = true; ssh.enable = true;
nginx.enable = true; nginx.enable = true;
website.enable = true;
stateVersion = "25.05"; stateVersion = "25.05";
hmStateVersion = "25.05"; hmStateVersion = "25.05";

View file

@ -9,12 +9,14 @@ in {
./home ./home
./layout ./layout
./networking ./networking
./nginx
./niri ./niri
./nix ./nix
./secureboot ./secureboot
./ssh ./ssh
./utils ./utils
./vm ./vm
./website
]; ];
documentation.nixos.enable = false; documentation.nixos.enable = false;

View file

@ -0,0 +1,8 @@
{ config, lib, ... }: let
inherit (config) conf;
inherit (lib) mkIf;
in mkIf conf.nginx.enable {
services.nginx = {
enable = true;
};
}

View file

@ -0,0 +1,16 @@
{ lib, config, pkgs, ... }: let
inherit (lib) mkIf;
inherit (config) conf;
in mkIf conf.website.enable {
services.nginx.virtualHosts = {
"twoneis.site" = {
servername = "twoneis.site";
forceSSL = false;
locations = {
"/" = {
return = "200 \"Faggot\"";
};
};
};
};
}

View file

@ -18,6 +18,7 @@ in {
# Generally server options # Generally server options
ssh.enable = mkEnableOption "Install my public key to allow accessing this machine via ssh."; ssh.enable = mkEnableOption "Install my public key to allow accessing this machine via ssh.";
nginx.enable = mkEnableOption "Enable nginx."; nginx.enable = mkEnableOption "Enable nginx.";
website.enable = mkEnableOption "Serve website through nginx. Nginx must be enabled to work correctly.";
# Mixed and more complex options # Mixed and more complex options
username = mkOption { username = mkOption {