Make servers headless, modularize the domain grabber

This commit is contained in:
Bun 2025-03-23 12:44:03 -04:00
parent bbc1f4dce1
commit 88da54facd
9 changed files with 15 additions and 15 deletions

View file

@ -1,8 +1,7 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
boot = { boot = {
kernelPackages = pkgs.linuxPackages_latest; kernelPackages = pkgs.linuxPackages_hardened;
lanzaboote.enable = true;
plymouth.enable = true; plymouth.enable = true;
}; };
} }

View file

@ -1,4 +1,4 @@
{ config, lib, ... }: { modulesPath, ... }:
{ {
imports = [ imports = [
./boot ./boot
@ -7,12 +7,14 @@
./hardware ./hardware
./users ./users
../../modules/system ../../modules/system
(modulesPath + "/profiles/headless.nix")
]; ];
networking = { networking = {
hostName = "kitty"; hostName = "kitty";
hostId = "8745e22e";
interfaces."eno1".ipv4.addresses = [{ interfaces."eno1".ipv4.addresses = [{
address = "10.2.0.101"; address = "10.2.0.2";
prefixLength = 8; prefixLength = 8;
}]; }];
defaultGateway = { defaultGateway = {
@ -22,7 +24,7 @@
}; };
system = { system = {
desktop.enable = true; server.enable = true;
stateVersion = "24.11"; stateVersion = "24.11";
}; };
} }

View file

@ -4,7 +4,7 @@
isNormalUser = true; isNormalUser = true;
createHome = true; createHome = true;
openssh.authorizedKeys.keys = [ openssh.authorizedKeys.keys = [
"AAAAC3NzaC1lZDI1NTE5AAAAIKaZsnlyUJDNx2oK4iHsUDb+Ok4vg1jNYEAnoHsjjM2c Chinook" "AAAAC3NzaC1lZDI1NTE5AAAAIBCADciME1/rtWOlR2BxaAkRSgIZt61SYOgjTi6hw+yS Chinook"
"AAAAC3NzaC1lZDI1NTE5AAAAICtoHVAmq8Ps7EguBsV3VY4snagzkhH6aXqwbKzuGs2H Radiant" "AAAAC3NzaC1lZDI1NTE5AAAAICtoHVAmq8Ps7EguBsV3VY4snagzkhH6aXqwbKzuGs2H Radiant"
]; ];
uid = 1001; uid = 1001;

View file

@ -1,8 +1,6 @@
{ config, lib, ... }: { config, lib, ... }:
{ {
home-manager.users."${config.sysusers.main}".home = { home-manager.users."${config.sysusers.main}".home = {
desktop.enable = true;
production.enable = true;
stateVersion = lib.mkForce config.system.stateVersion; stateVersion = lib.mkForce config.system.stateVersion;
}; };
} }

View file

@ -1,4 +1,4 @@
{ ... }: { modulesPath, ... }:
{ {
imports = [ imports = [
./boot ./boot
@ -9,6 +9,7 @@
./services ./services
./users ./users
../../modules/system ../../modules/system
(modulesPath + "/profiles/headless.nix")
]; ];
networking = { networking = {

View file

@ -6,7 +6,7 @@
chain PREROUTING { chain PREROUTING {
type nat hook prerouting priority dstnat; policy accept; type nat hook prerouting priority dstnat; policy accept;
tcp dport 2211 dnat ip to 10.2.0.100:22 comment "SSH to Tower" tcp dport 2211 dnat ip to 10.2.0.100:22 comment "SSH to Tower"
tcp dport 2222 dnat ip to 10.2.0.101:22 comment "SSH to Kitty" tcp dport 2222 dnat ip to 10.2.0.2:22 comment "SSH to Kitty"
udp dport { 27005, 27015 } dnat ip to 10.2.0.100 comment "PC Hosted Games" udp dport { 27005, 27015 } dnat ip to 10.2.0.100 comment "PC Hosted Games"

View file

@ -1,6 +1,7 @@
{ ... }: { ... }:
{ {
services = { services = {
cloudflare-dyndns.enable = true;
forgejo.enable = true; forgejo.enable = true;
icecast.enable = true; icecast.enable = true;
jellyfin.enable = true; jellyfin.enable = true;

View file

@ -1,4 +1,4 @@
{ ... }: { modulesPath, ... }:
{ {
imports = [ imports = [
./boot ./boot
@ -7,6 +7,7 @@
./hardware ./hardware
./users ./users
../../modules/system ../../modules/system
(modulesPath + "/profiles/headless.nix")
]; ];
networking = { networking = {
@ -21,6 +22,7 @@
}; };
services = { services = {
cloudflare-dyndns.enable = true;
mailserver.enable = true; mailserver.enable = true;
nginx.enable = true; nginx.enable = true;
wireguard.client.enable = true; wireguard.client.enable = true;

View file

@ -1,7 +1,4 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
services.cloudflare-dyndns = { services.cloudflare-dyndns.apiTokenFile = "${pkgs.writeText "cloudflareapikey" config.secrets.flareApiKey}";
enable = config.system.server.enable;
apiTokenFile = "${pkgs.writeText "cloudflareapikey" config.secrets.flareApiKey}";
};
} }