restructured & first test of toggleable config
This commit is contained in:
14
modules/homelab/homelab.nix
Normal file
14
modules/homelab/homelab.nix
Normal 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
10
modules/system/docker.nix
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
virtualisation.docker = {
|
||||||
|
enable = true;
|
||||||
|
daemon.settings = {
|
||||||
|
experimental = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
20
modules/system/nvidia.nix
Normal file
20
modules/system/nvidia.nix
Normal 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
15
modules/system/ssh.nix
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# enable and configure openssh
|
||||||
|
services.openssh = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
PasswordAuthentication = true;
|
||||||
|
PermitRootLogin = "no";
|
||||||
|
X11Forwarding = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
16
modules/system/syncthing.nix
Normal file
16
modules/system/syncthing.nix
Normal 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;
|
||||||
|
};
|
||||||
|
}
|
||||||
10
modules/system/tailscale.nix
Normal file
10
modules/system/tailscale.nix
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
services.tailscale = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
useRoutingFeatures = "both";
|
||||||
|
authKeyFile = "/home/blake/.nix/.keyring/tailscale/authkey";
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user