restructure system to be toggable

This commit is contained in:
2025-10-04 11:46:34 -05:00
parent 464ecdc6ca
commit 8b4d73b2e3
6 changed files with 85 additions and 47 deletions

View File

@@ -5,21 +5,31 @@
[ # Include the results of the hardware scan.
./hardware-configuration.nix
../../users/blake/blake.nix
../../modules/system/ssh.nix
../../modules/system/docker.nix
../../modules/system/syncthing.nix
../../modules/system/tailscale.nix
../../modules/system/system.nix
# ../../modules/system/ssh.nix
# ../../modules/system/docker.nix
# ../../modules/system/syncthing.nix
# ../../modules/system/tailscale.nix
../../modules/homelab/homelab.nix
# ../../modules/homelab/zfs.nix
# ../../modules/homelab/smb.nix
# ../../modules/homelab/nfs.nix
];
modules.homelab = {
modules = {
system = {
ssh.enable = true;
docker.enable = true;
syncthing.enable = true;
tailscale.enable = true;
#nvidia.enable = true;
};
homelab = {
zfs.enable = true;
smb.enable = false;
smb.enable = true;
nfs.enable = true;
};
};
# use the systemd-boot EFI boot loader.

View File

@@ -1,10 +1,16 @@
{ config, pkgs, ... }:
{
options = {
modules.system.docker.enable = lib.mkEnableOption "enables docker";
};
config = lib.mkIf config.modules.system.docker.enable {
virtualisation.docker = {
enable = true;
daemon.settings = {
experimental = true;
};
};
};
}

View File

@@ -1,6 +1,11 @@
{ config, pkgs, lib, ... }:
{
options = {
modules.system.nvidia.enable = lib.mkEnableOption "enables nvidia";
};
config = lib.mkIf config.modules.system.nvidia.enable {
# enable nvidia proprietary driver
hardware.nvidia = {
modesetting.enable = true; # required
@@ -17,4 +22,5 @@
# enable docker gpu passthrough
virtualisation.docker.enableNvidia = true;
};
}

View File

@@ -1,6 +1,11 @@
{ config, lib, pkgs, ... }:
{
options = {
modules.system.ssh.enable = lib.mkEnableOption "enables ssh";
};
config = lib.mkIf config.modules.system.ssh.enable {
# enable and configure openssh
services.openssh = {
enable = true;
@@ -10,6 +15,5 @@
X11Forwarding = false;
};
};
};
}

View File

@@ -1,6 +1,11 @@
{ config, pkgs, ... }:
{
options = {
modules.system.syncthing.enable = lib.mkEnableOption "enables syncthing";
};
config = lib.mkIf config.modules.system.syncthing.enable {
services.syncthing = {
enable = true;
user = "blake";
@@ -13,4 +18,5 @@
guiAddress = "0.0.0.0:2222";
openDefaultPorts = true;
};
};
}

View File

@@ -1,10 +1,16 @@
{ config, pkgs, ... }:
{
options = {
modules.system.tailscale.enable = lib.mkEnableOption "enables tailscale";
};
config = lib.mkIf config.modules.system.tailscale.enable {
services.tailscale = {
enable = true;
useRoutingFeatures = "both";
authKeyFile = "/home/blake/.nix/.keyring/tailscale/authkey";
};
};
}