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:
@@ -0,0 +1,10 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [ ./hardware-configuration.nix ];
|
||||
}
|
||||
@@ -7,12 +7,12 @@
|
||||
let
|
||||
cfg = config.homelab.core;
|
||||
|
||||
allowRootSSH = if cfg.ssh.PermitRootLogin then "yes" else "no";
|
||||
allowRootSSH = if cfg.ssh.permitRootLogin then "yes" else "no";
|
||||
in
|
||||
{
|
||||
|
||||
config = {
|
||||
boot.kernelPackages = shared.kernelMap.${cfg.kernel};
|
||||
boot.kernelPackages = shared.kernelOptions.${cfg.kernel};
|
||||
|
||||
time.timeZone = "America/Chicago";
|
||||
|
||||
@@ -91,21 +91,18 @@ in
|
||||
};
|
||||
|
||||
boot.loader =
|
||||
if cfg.bootloader == "grub" then
|
||||
if cfg.bootloader.type == "grub" then
|
||||
{
|
||||
grub = {
|
||||
enable = cfg.grub.enable;
|
||||
device = cfg.grub.device;
|
||||
enable = cfg.bootloader.grub.enable;
|
||||
device = cfg.bootloader.grub.device;
|
||||
};
|
||||
|
||||
systemd-boot.enable = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
systemd-boot = {
|
||||
enable = cfg.systemd.enable;
|
||||
efiSupport = cfg.systemd.efiSupport;
|
||||
};
|
||||
systemd-boot.enable = cfg.bootloader.systemd.enable;
|
||||
|
||||
grub.enable = false;
|
||||
};
|
||||
|
||||
@@ -73,22 +73,18 @@
|
||||
};
|
||||
|
||||
shell = lib.mkOption {
|
||||
type = with lib.types; listOf str;
|
||||
type = lib.types.str;
|
||||
default = "fish";
|
||||
description = "The shell the primary user uses";
|
||||
};
|
||||
};
|
||||
|
||||
allowUnfree = lib.mkEnableOption {
|
||||
enable = true;
|
||||
allowUnfree = lib.mkEnableOption "unfree packages" // {
|
||||
default = true;
|
||||
};
|
||||
|
||||
ssh = {
|
||||
permitRootLogin = lib.mkEnableOption {
|
||||
enable = true;
|
||||
default = false;
|
||||
};
|
||||
permitRootLogin = lib.mkEnableOption "root SSH login";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
{
|
||||
kernelOptions = {
|
||||
stable = pkgs.linuxPackages;
|
||||
lts = pkgs.linuxPackages_lts;
|
||||
lts = pkgs.linuxPackages_6_12;
|
||||
latest = pkgs.linuxPackages_latest;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -3,24 +3,24 @@ let
|
||||
cfg = config.homelab.networking.core;
|
||||
in
|
||||
{
|
||||
config = {
|
||||
imports = [
|
||||
./firewall.nix
|
||||
];
|
||||
|
||||
config = {
|
||||
networking = {
|
||||
networkmanager = {
|
||||
enable = true;
|
||||
dns = "systemd-resolved";
|
||||
};
|
||||
|
||||
networking.extraHosts = lib.concatMapStringsSep "\n" (
|
||||
extraHosts = lib.concatMapStringsSep "\n" (
|
||||
host: "${host.ip_address} ${host.hostname}"
|
||||
) cfg.extraHosts;
|
||||
|
||||
nftables.enable = true;
|
||||
|
||||
nameservers = config.core.nameservers;
|
||||
nameservers = cfg.nameservers;
|
||||
};
|
||||
|
||||
services.resolved = {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./options.nix
|
||||
./core
|
||||
./wireguard.nix
|
||||
./tailscale.nix
|
||||
];
|
||||
}
|
||||
|
||||
@@ -13,8 +13,7 @@
|
||||
# core
|
||||
core = {
|
||||
firewall = {
|
||||
allowPing = lib.mkEnableOption "Enable ICMP Pinging" {
|
||||
enable = true;
|
||||
allowPing = lib.mkEnableOption "ICMP pinging" // {
|
||||
default = true;
|
||||
};
|
||||
|
||||
@@ -117,10 +116,7 @@
|
||||
|
||||
# tailscale
|
||||
tailscale = {
|
||||
enable = lib.mkEnableOption "Enable Tailscale Mesh VPN" {
|
||||
enable = true;
|
||||
default = false;
|
||||
};
|
||||
enable = lib.mkEnableOption "Tailscale mesh VPN";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.homelab.networking.tailscale;
|
||||
user = config.homelab.networking.user;
|
||||
in
|
||||
{
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.tailscale = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
extraSetFlags = [ "--operator=${cfg.user}" ];
|
||||
extraSetFlags = [ "--operator=${user}" ];
|
||||
};
|
||||
|
||||
networking.firewall = {
|
||||
@@ -22,7 +23,7 @@ in
|
||||
systemd.network.wait-online.enable = false;
|
||||
boot.initrd.systemd.network.wait-online.enable = false;
|
||||
|
||||
users.users.${cfg.user}.extraGroups = [
|
||||
users.users.${user}.extraGroups = [
|
||||
"tailscale"
|
||||
];
|
||||
};
|
||||
|
||||
@@ -19,9 +19,8 @@ in
|
||||
podman = {
|
||||
enable = lib.mkEnableOption "Podman support";
|
||||
|
||||
packages = lib.mkEnableOption "Install Relevant Podman packages" {
|
||||
enable = true;
|
||||
default = false;
|
||||
packages = {
|
||||
enable = lib.mkEnableOption "relevant Podman packages";
|
||||
};
|
||||
};
|
||||
|
||||
@@ -29,20 +28,11 @@ in
|
||||
qemu = {
|
||||
enable = lib.mkEnableOption "QEMU support";
|
||||
|
||||
containers = lib.mkEnableOption "Enable container support for QEMU" {
|
||||
enable = true;
|
||||
default = false;
|
||||
};
|
||||
containers = lib.mkEnableOption "container support for QEMU";
|
||||
|
||||
spiceUSBRedirection = lib.mkEnableOption "Enable spice USB redirection support for QEMU" {
|
||||
enable = true;
|
||||
default = false;
|
||||
};
|
||||
spiceUSBRedirection = lib.mkEnableOption "spice USB redirection support for QEMU";
|
||||
|
||||
virtManager = lib.mkEnableOption "Enable virt-manager support for QEMU" {
|
||||
enable = true;
|
||||
default = false;
|
||||
};
|
||||
virtManager = lib.mkEnableOption "virt-manager support for QEMU";
|
||||
|
||||
bootModules = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
|
||||
@@ -11,7 +11,7 @@ in
|
||||
config = lib.mkMerge [
|
||||
(lib.mkIf cfg.qemu.enable {
|
||||
virtualisation = {
|
||||
containers.enable = true;
|
||||
containers.enable = cfg.qemu.containers;
|
||||
libvirtd = {
|
||||
enable = true;
|
||||
qemu = {
|
||||
@@ -34,7 +34,7 @@ in
|
||||
programs.virt-manager.enable = true;
|
||||
})
|
||||
|
||||
(lib.mkIf cfg.qemu.bootModules {
|
||||
(lib.mkIf cfg.qemu.enable {
|
||||
boot.kernelModules = cfg.qemu.bootModules;
|
||||
})
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user