restructure system to be toggable
This commit is contained in:
@@ -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;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user