restructured & first test of toggleable config

This commit is contained in:
2025-10-04 11:26:42 -05:00
parent 142dd3b568
commit 887e7c2b97
6 changed files with 85 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
{ config, lib, pkgs, ... }:
{
imports = [
./zfs.nix
./smb.nix
./nfs.nix
];
homelab.zfs.enable = lib.mkDefault true;
homelab.smb.enable = lib.mkDefault true;
homelab.nfs.enable = lib.mkDefault true;
}

10
modules/system/docker.nix Normal file
View File

@@ -0,0 +1,10 @@
{ config, pkgs, ... }:
{
virtualisation.docker = {
enable = true;
daemon.settings = {
experimental = true;
};
};
}

20
modules/system/nvidia.nix Normal file
View File

@@ -0,0 +1,20 @@
{ config, pkgs, lib, ... }:
{
# enable nvidia proprietary driver
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;
};
# install nvidia-smi
environment.systemPackages = with pkgs; [
nvidia-smi
];
# enable docker gpu passthrough
virtualisation.docker.enableNvidia = true;
}

15
modules/system/ssh.nix Normal file
View File

@@ -0,0 +1,15 @@
{ config, lib, pkgs, ... }:
{
# enable and configure openssh
services.openssh = {
enable = true;
settings = {
PasswordAuthentication = true;
PermitRootLogin = "no";
X11Forwarding = false;
};
};
}

View File

@@ -0,0 +1,16 @@
{ config, pkgs, ... }:
{
services.syncthing = {
enable = true;
user = "blake";
group = "blake";
dataDir = "/home/blake/.local/state/syncthing";
configDir = "/home/blake/.config/syncthing";
# webui
guiAddress = "0.0.0.0:2222";
openDefaultPorts = true;
};
}

View File

@@ -0,0 +1,10 @@
{ config, pkgs, ... }:
{
services.tailscale = {
enable = true;
useRoutingFeatures = "both";
authKeyFile = "/home/blake/.nix/.keyring/tailscale/authkey";
};
}