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

@@ -1,10 +1,16 @@
{ config, pkgs, ... }:
{
virtualisation.docker = {
enable = true;
daemon.settings = {
experimental = true;
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,20 +1,26 @@
{ 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;
options = {
modules.system.nvidia.enable = lib.mkEnableOption "enables nvidia";
};
# install nvidia-smi
environment.systemPackages = with pkgs; [
nvidia-smi
];
config = lib.mkIf config.modules.system.nvidia.enable {
# 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;
};
# enable docker gpu passthrough
virtualisation.docker.enableNvidia = true;
# install nvidia-smi
environment.systemPackages = with pkgs; [
nvidia-smi
];
# enable docker gpu passthrough
virtualisation.docker.enableNvidia = true;
};
}

View File

@@ -1,15 +1,19 @@
{ config, lib, pkgs, ... }:
{
# enable and configure openssh
services.openssh = {
enable = true;
settings = {
PasswordAuthentication = true;
PermitRootLogin = "no";
X11Forwarding = false;
};
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;
settings = {
PasswordAuthentication = true;
PermitRootLogin = "no";
X11Forwarding = false;
};
};
};
}

View File

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

View File

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