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,20 +5,30 @@
[ # Include the results of the hardware scan. [ # Include the results of the hardware scan.
./hardware-configuration.nix ./hardware-configuration.nix
../../users/blake/blake.nix ../../users/blake/blake.nix
../../modules/system/ssh.nix ../../modules/system/system.nix
../../modules/system/docker.nix # ../../modules/system/ssh.nix
../../modules/system/syncthing.nix # ../../modules/system/docker.nix
../../modules/system/tailscale.nix # ../../modules/system/syncthing.nix
# ../../modules/system/tailscale.nix
../../modules/homelab/homelab.nix ../../modules/homelab/homelab.nix
# ../../modules/homelab/zfs.nix # ../../modules/homelab/zfs.nix
# ../../modules/homelab/smb.nix # ../../modules/homelab/smb.nix
# ../../modules/homelab/nfs.nix # ../../modules/homelab/nfs.nix
]; ];
modules.homelab = { modules = {
zfs.enable = true; system = {
smb.enable = false; ssh.enable = true;
nfs.enable = true; docker.enable = true;
syncthing.enable = true;
tailscale.enable = true;
#nvidia.enable = true;
};
homelab = {
zfs.enable = true;
smb.enable = true;
nfs.enable = true;
};
}; };

View File

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

View File

@@ -1,20 +1,26 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
{ {
# enable nvidia proprietary driver options = {
hardware.nvidia = { modules.system.nvidia.enable = lib.mkEnableOption "enables nvidia";
modesetting.enable = true; # required
open = false; # use proprietary driver
nvidiaSettings = true; # no shit
powerManagement.enable = false; # can cause sleep issues
package = config.boot.kernelPackages.nvidiaPackages.stable;
}; };
# install nvidia-smi config = lib.mkIf config.modules.system.nvidia.enable {
environment.systemPackages = with pkgs; [ # enable nvidia proprietary driver
nvidia-smi hardware.nvidia = {
]; modesetting.enable = true; # required
open = false; # use proprietary driver
nvidiaSettings = true; # no shit
powerManagement.enable = false; # can cause sleep issues
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
# enable docker gpu passthrough # install nvidia-smi
virtualisation.docker.enableNvidia = true; environment.systemPackages = with pkgs; [
nvidia-smi
];
# enable docker gpu passthrough
virtualisation.docker.enableNvidia = true;
};
} }

View File

@@ -1,15 +1,19 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
{ {
# enable and configure openssh options = {
services.openssh = { modules.system.ssh.enable = lib.mkEnableOption "enables ssh";
enable = true;
settings = {
PasswordAuthentication = true;
PermitRootLogin = "no";
X11Forwarding = false;
};
}; };
config = lib.mkIf config.modules.system.ssh.enable {
# enable and configure openssh
services.openssh = {
enable = true;
settings = {
PasswordAuthentication = true;
PermitRootLogin = "no";
X11Forwarding = false;
};
};
};
} }

View File

@@ -1,16 +1,22 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
services.syncthing = { options = {
enable = true; modules.system.syncthing.enable = lib.mkEnableOption "enables syncthing";
user = "blake"; };
group = "blake";
dataDir = "/home/blake/.local/state/syncthing"; config = lib.mkIf config.modules.system.syncthing.enable {
configDir = "/home/blake/.config/syncthing"; services.syncthing = {
enable = true;
user = "blake";
group = "blake";
# webui dataDir = "/home/blake/.local/state/syncthing";
guiAddress = "0.0.0.0:2222"; configDir = "/home/blake/.config/syncthing";
openDefaultPorts = true;
# webui
guiAddress = "0.0.0.0:2222";
openDefaultPorts = true;
};
}; };
} }

View File

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