holy shit im stupid, a lot of changes.

also added the configuration bc idk how to add only certain files but
whatever
This commit is contained in:
2026-07-05 23:42:52 -05:00
parent 4f9269315b
commit 4e925f8a89
10 changed files with 40 additions and 50 deletions
+10
View File
@@ -0,0 +1,10 @@
{
config,
lib,
pkgs,
...
}:
{
imports = [ ./hardware-configuration.nix ];
}
+6 -9
View File
@@ -7,12 +7,12 @@
let let
cfg = config.homelab.core; cfg = config.homelab.core;
allowRootSSH = if cfg.ssh.PermitRootLogin then "yes" else "no"; allowRootSSH = if cfg.ssh.permitRootLogin then "yes" else "no";
in in
{ {
config = { config = {
boot.kernelPackages = shared.kernelMap.${cfg.kernel}; boot.kernelPackages = shared.kernelOptions.${cfg.kernel};
time.timeZone = "America/Chicago"; time.timeZone = "America/Chicago";
@@ -91,21 +91,18 @@ in
}; };
boot.loader = boot.loader =
if cfg.bootloader == "grub" then if cfg.bootloader.type == "grub" then
{ {
grub = { grub = {
enable = cfg.grub.enable; enable = cfg.bootloader.grub.enable;
device = cfg.grub.device; device = cfg.bootloader.grub.device;
}; };
systemd-boot.enable = false; systemd-boot.enable = false;
} }
else else
{ {
systemd-boot = { systemd-boot.enable = cfg.bootloader.systemd.enable;
enable = cfg.systemd.enable;
efiSupport = cfg.systemd.efiSupport;
};
grub.enable = false; grub.enable = false;
}; };
+3 -7
View File
@@ -73,22 +73,18 @@
}; };
shell = lib.mkOption { shell = lib.mkOption {
type = with lib.types; listOf str; type = lib.types.str;
default = "fish"; default = "fish";
description = "The shell the primary user uses"; description = "The shell the primary user uses";
}; };
}; };
allowUnfree = lib.mkEnableOption { allowUnfree = lib.mkEnableOption "unfree packages" // {
enable = true;
default = true; default = true;
}; };
ssh = { ssh = {
permitRootLogin = lib.mkEnableOption { permitRootLogin = lib.mkEnableOption "root SSH login";
enable = true;
default = false;
};
}; };
}; };
} }
+1 -1
View File
@@ -3,7 +3,7 @@
{ {
kernelOptions = { kernelOptions = {
stable = pkgs.linuxPackages; stable = pkgs.linuxPackages;
lts = pkgs.linuxPackages_lts; lts = pkgs.linuxPackages_6_12;
latest = pkgs.linuxPackages_latest; latest = pkgs.linuxPackages_latest;
}; };
} }
+3 -3
View File
@@ -3,24 +3,24 @@ let
cfg = config.homelab.networking.core; cfg = config.homelab.networking.core;
in in
{ {
config = {
imports = [ imports = [
./firewall.nix ./firewall.nix
]; ];
config = {
networking = { networking = {
networkmanager = { networkmanager = {
enable = true; enable = true;
dns = "systemd-resolved"; dns = "systemd-resolved";
}; };
networking.extraHosts = lib.concatMapStringsSep "\n" ( extraHosts = lib.concatMapStringsSep "\n" (
host: "${host.ip_address} ${host.hostname}" host: "${host.ip_address} ${host.hostname}"
) cfg.extraHosts; ) cfg.extraHosts;
nftables.enable = true; nftables.enable = true;
nameservers = config.core.nameservers; nameservers = cfg.nameservers;
}; };
services.resolved = { services.resolved = {
+2 -2
View File
@@ -1,8 +1,8 @@
{ ... }:
{ {
imports = [ imports = [
./options.nix
./core ./core
./wireguard.nix
./tailscale.nix ./tailscale.nix
]; ];
} }
+2 -6
View File
@@ -13,8 +13,7 @@
# core # core
core = { core = {
firewall = { firewall = {
allowPing = lib.mkEnableOption "Enable ICMP Pinging" { allowPing = lib.mkEnableOption "ICMP pinging" // {
enable = true;
default = true; default = true;
}; };
@@ -117,10 +116,7 @@
# tailscale # tailscale
tailscale = { tailscale = {
enable = lib.mkEnableOption "Enable Tailscale Mesh VPN" { enable = lib.mkEnableOption "Tailscale mesh VPN";
enable = true;
default = false;
};
}; };
}; };
} }
+3 -2
View File
@@ -1,13 +1,14 @@
{ config, lib, ... }: { config, lib, ... }:
let let
cfg = config.homelab.networking.tailscale; cfg = config.homelab.networking.tailscale;
user = config.homelab.networking.user;
in in
{ {
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
services.tailscale = { services.tailscale = {
enable = true; enable = true;
openFirewall = true; openFirewall = true;
extraSetFlags = [ "--operator=${cfg.user}" ]; extraSetFlags = [ "--operator=${user}" ];
}; };
networking.firewall = { networking.firewall = {
@@ -22,7 +23,7 @@ in
systemd.network.wait-online.enable = false; systemd.network.wait-online.enable = false;
boot.initrd.systemd.network.wait-online.enable = false; boot.initrd.systemd.network.wait-online.enable = false;
users.users.${cfg.user}.extraGroups = [ users.users.${user}.extraGroups = [
"tailscale" "tailscale"
]; ];
}; };
+5 -15
View File
@@ -19,9 +19,8 @@ in
podman = { podman = {
enable = lib.mkEnableOption "Podman support"; enable = lib.mkEnableOption "Podman support";
packages = lib.mkEnableOption "Install Relevant Podman packages" { packages = {
enable = true; enable = lib.mkEnableOption "relevant Podman packages";
default = false;
}; };
}; };
@@ -29,20 +28,11 @@ in
qemu = { qemu = {
enable = lib.mkEnableOption "QEMU support"; enable = lib.mkEnableOption "QEMU support";
containers = lib.mkEnableOption "Enable container support for QEMU" { containers = lib.mkEnableOption "container support for QEMU";
enable = true;
default = false;
};
spiceUSBRedirection = lib.mkEnableOption "Enable spice USB redirection support for QEMU" { spiceUSBRedirection = lib.mkEnableOption "spice USB redirection support for QEMU";
enable = true;
default = false;
};
virtManager = lib.mkEnableOption "Enable virt-manager support for QEMU" { virtManager = lib.mkEnableOption "virt-manager support for QEMU";
enable = true;
default = false;
};
bootModules = lib.mkOption { bootModules = lib.mkOption {
type = lib.types.listOf lib.types.str; type = lib.types.listOf lib.types.str;
+2 -2
View File
@@ -11,7 +11,7 @@ in
config = lib.mkMerge [ config = lib.mkMerge [
(lib.mkIf cfg.qemu.enable { (lib.mkIf cfg.qemu.enable {
virtualisation = { virtualisation = {
containers.enable = true; containers.enable = cfg.qemu.containers;
libvirtd = { libvirtd = {
enable = true; enable = true;
qemu = { qemu = {
@@ -34,7 +34,7 @@ in
programs.virt-manager.enable = true; programs.virt-manager.enable = true;
}) })
(lib.mkIf cfg.qemu.bootModules { (lib.mkIf cfg.qemu.enable {
boot.kernelModules = cfg.qemu.bootModules; boot.kernelModules = cfg.qemu.bootModules;
}) })
]; ];