Add frontends

This commit is contained in:
muon 2024-12-10 13:31:39 +00:00
parent 4b3808c042
commit 92528d7121
8 changed files with 87 additions and 58 deletions

View file

@ -1,9 +1,8 @@
{ config, lib, pkgs, inputs, system, ... }:
let cfg = config.mods;
in {
# Hardware
imports = [ ./hardware-configuration.nix ];
imports = [ ./hardware-configuration.nix ../ports.nix ];
# System
mods.user.name = "muon";
@ -11,6 +10,10 @@ in {
networking.hostId = "56e55e83";
mods.home.file = ./home.nix;
# Hosting
networking.firewall.allowedTCPPorts =
lib.attrsets.mapAttrsToList (name: value: value) cfg.server.nginx.ports;
# Modules
mods.desktop.enable = true;
mods.desktop.gaming.enable = true;
@ -21,6 +24,8 @@ in {
mods.server.photos.enable = true;
mods.server.search.enable = true;
mods.server.videos.enable = true;
mods.server.reddit.enable = true;
mods.tailscale.enable = true;
mods.wireguard.id = 3;

View file

@ -9,7 +9,7 @@ let
in {
# Hardware
imports = [ ./hardware-configuration.nix ];
imports = [ ./hardware-configuration.nix ../ports.nix ];
# System
mods.user.name = "muon";
@ -42,16 +42,18 @@ in {
boot.loader.grub.device = "/dev/vda";
boot.initrd.checkJournalingFS = false;
# services.static-web-server = {
# enable = true;
# listen = "[::]:80";
# root = "/var/www";
# configuration = {
# general = {
# directory-listing = true;
# };
# };
# };
services.static-web-server = {
enable = true;
listen = "[::]:8008";
root = "/var/www";
configuration = { general = { directory-listing = true; }; };
};
services.nginx.virtualHosts."muon.host" = {
enableACME = true;
forceSSL = true;
default = true;
locations."/" = { proxyPass = "http://localhost:8008"; };
};
# Enable the OpenSSH daemon.
services.openssh.enable = true;

9
hosts/ports.nix Normal file
View file

@ -0,0 +1,9 @@
{ pkgs, lib, config, ... }: {
mods.server.nginx.ports = {
photos = 3001;
search = 8081;
videos = 8082;
reddit = 8083;
};
}