Make a hosts folder for system and home, remove legacy.nix cause I never used it, change some comments

This commit is contained in:
Jimbo 2024-10-02 21:35:29 -04:00
parent 1a096662e1
commit d9469fc321
36 changed files with 380 additions and 402 deletions

View file

@ -0,0 +1,51 @@
{
imports = [
# Base configs
./../../base.nix
# Import users and groups
./../../users/jimbo.nix
./../../users/groups.nix
# Desktop
./../../desktop/misc.nix
./../../desktop/sway.nix
./../../desktop/greetd-sway.nix
./../../desktop/printing.nix
./../../desktop/gaming.nix
./../../desktop/pipewire.nix
./../../desktop/bluetooth.nix
./../../desktop/firewall.nix
./../../desktop/fonts.nix
./../../desktop/qt.nix
# Modules
./../../modules/security.nix
# Hardware
./hardware-configuration.nix
./../../modules/systemdboot.nix
./../../modules/opengl.nix
./../../modules/filesystems.nix
./../../modules/nvidia.nix
#./../../modules/nouveau.nix
# Services
./../../services/openssh.nix
./../../services/gnome-keyring.nix
./../../services/qemukvm.nix
./../../services/udev.nix
./../../services/sunshine.nix
./../../services/mpd.nix
#./../../services/waydroid.nix
];
# Set hostname
networking.hostName = "JimDesktop";
# Force Electron to use Wayland
environment.sessionVariables.NIXOS_OZONE_WL = "1";
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
system.stateVersion = "24.05";
}

View file

@ -0,0 +1,113 @@
{ config, lib, pkgs, outputs, modulesPath, ... }: let
# Set common boot paramaters
commonKernelParams = [
# Nvidia settings
"nvidia_drm.fbdev=1"
"nouveau.config=NvGspRm=1"
# VM/GPU passthrough
"amd_iommu=on"
"iommu=pt"
"nested=1"
# Virtualization nonsense
"transparent_hugepage=never"
# Isolate devices into IOMMU groups
"pcie_acs_override=downstream,multifunction"
"pci=routeirq"
];
in {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
# Set all boot options
boot = {
# Set a kernel version and load/blacklist drivers
kernelPackages = pkgs.unstable.linuxPackages_zen;
blacklistedKernelModules = [
"pcspkr"
];
kernel.sysctl."vm.max_map_count" = 2147483642;
kernelParams = commonKernelParams ++ [
"vfio-pci.ids=10de:1f82,10de:10fa"
];
initrd = {
availableKernelModules = [
"nvme"
"xhci_pci"
"ahci"
"usbhid"
"usb_storage"
"sd_mod"
];
kernelModules = [
"vfio"
"vfio_pci"
"vfio_iommu_type1"
"kvm-amd"
];
};
};
# Additional entry to boot from the second GPU
specialisation = {
gputwo.configuration = {
boot.kernelParams = commonKernelParams ++ ["vfio-pci.ids=10de:2504,10de:228e"];
};
};
# Mount everything as necessary
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/f0786b07-8303-416f-87ff-276bfd696387";
fsType = "bcachefs";
};
"/boot" = {
device = "/dev/disk/by-uuid/EF6D-9009";
fsType = "vfat";
};
"/etc/libvirt" = {
device = "/dev/disk/by-label/Qemu";
options = ["nosuid" "nodev" "nofail"];
};
"/var/lib/libvirt" = {
depends = ["/etc/libvirt"];
device = "/etc/libvirt/varlibvirt";
options = ["bind" "rw"];
};
"/mnt/Linux1" = {
device = "/dev/disk/by-label/Linux1";
options = ["nosuid" "nodev" "nofail" "x-gvfs-show"];
};
"/mnt/Linux2" = {
device = "/dev/disk/by-label/Linux2";
options = ["nosuid" "nodev" "nofail" "x-gvfs-show"];
};
"/mnt/Windows1" = {
device = "/dev/disk/by-label/Windows1";
options = ["nosuid" "nodev" "noauto"];
};
"/mnt/Windows2" = {
device = "/dev/disk/by-label/Windows2";
options = ["nosuid" "nodev" "noauto"];
};
"/home/jimbo/JimboNFS" = {
device = "${outputs.ips.server}:/export/JimboNFS";
fsType = "nfs4";
options = ["x-systemd.automount" "_netdev" "nofail" "noauto"];
};
};
# Set the swap partition
swapDevices = [
{device = "/dev/disk/by-uuid/2e4c5120-716d-4cdc-84a0-c9e6391760db";}
];
# Enables DHCP on each ethernet and wireless interface.
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -0,0 +1,45 @@
{
imports = [
# Base configs
./../../base.nix
# Import users and groups
./../../users/jimbo.nix
./../../users/groups.nix
# Desktop
./../../desktop/misc.nix
./../../desktop/sway.nix
./../../desktop/greetd-sway.nix
./../../desktop/printing.nix
./../../desktop/gaming.nix
./../../desktop/pipewire.nix
./../../desktop/bluetooth.nix
./../../desktop/firewall.nix
./../../desktop/fonts.nix
./../../desktop/qt.nix
# Laptop/Portable only
./../../modules/wireless.nix
# Modules
./../../modules/security.nix
# Hardware
./hardware-configuration.nix
./../../modules/systemdboot.nix
./../../modules/opengl.nix
# Services
./../../services/openssh.nix
./../../services/gnome-keyring.nix
./../../services/udev.nix
./../../services/mpd.nix
];
# Set hostname
networking.hostName = "JimLenovo";
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
system.stateVersion = "24.05";
}

View file

@ -0,0 +1,47 @@
{ config, lib, pkgs, modulesPath, ... }: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
# Set all boot options
boot = {
# Set a kernel version and load/blacklist drivers
kernelPackages = pkgs.linuxPackages_zen;
blacklistedKernelModules = [
"pcspkr"
];
kernel.sysctl."vm.max_map_count" = 2147483642;
initrd = {
availableKernelModules = [
"nvme"
"xhci_pci"
"usbhid"
"usb_storage"
"sd_mod"
"sdhci_pci"
];
kernelModules = [
"kvm-amd"
];
};
};
# Mount everything as necessary
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/c0fe8419-88f9-48a0-8c5b-acd4c11f8037";
fsType = "ext4";
};
"/boot" = {
device = "/dev/disk/by-uuid/BF2B-9AE0";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
};
# Enables DHCP on each ethernet and wireless interface.
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -0,0 +1,49 @@
{lib, outputs, ...}: {
imports = [
# Base configs
./../../base.nix
# Import users and groups
./../../users/jimbo.nix
./../../users/groups.nix
# Desktop
./../../desktop/misc.nix
./../../desktop/sway.nix
./../../desktop/greetd-sway.nix
./../../desktop/printing.nix
./../../desktop/pipewire.nix
./../../desktop/bluetooth.nix
./../../desktop/firewall.nix
./../../desktop/fonts.nix
./../../desktop/qt.nix
./../../desktop/wireguard.nix
# Modules
./../../modules/security.nix
# Hardware
./hardware-configuration.nix
./../../modules/extlinux.nix
./../../modules/opengl.nix
./../../modules/filesystems.nix
./../../modules/wireless.nix
# Services
./../../services/openssh.nix
./../../services/gnome-keyring.nix
./../../services/mpd.nix
];
# Set hostname
networking.hostName = "JimPine";
# Disable 32 bit graphics
hardware.opengl.driSupport32Bit = lib.mkForce false;
# Set the VPN IP per machine
networking.wireguard.interfaces."${outputs.ips.wgInt}".ips = [ "${outputs.ips.wgSpan}.17/24" ];
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
system.stateVersion = "24.05";
}

View file

@ -0,0 +1,48 @@
{ config, outputs, lib, pkgs, modulesPath, ... }:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot = {
initrd = {
availableKernelModules = [ ];
kernelModules = [ ];
};
blacklistedKernelModules = [
"pcspkr"
];
};
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/25738e24-385e-4bcf-bff5-d0e6274003b6";
fsType = "btrfs";
};
"/boot" = {
device = "/dev/disk/by-uuid/01D2-E962";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
"/home/jimbo/Downloads" = {
device = "/dev/disk/by-uuid/f0b6cf4e-9576-4ab5-96ae-2a7e57599a35";
fsType = "btrfs";
};
"/home/jimbo/JimboNFS" = {
device = "${outputs.ips.wgSpan}.1:/export/JimboNFS";
fsType = "nfs4";
options = ["x-systemd.automount" "_netdev" "nofail" "noauto"];
};
"/home/jimbo/FreecornNFS" = {
device = "${outputs.secrets.cornIP}:/export/freecornNFS";
fsType = "nfs4";
options = ["x-systemd.automount" "_netdev" "nofail" "noauto"];
};
};
swapDevices = [
{ device = "/dev/disk/by-uuid/95c43e5a-b53d-41fd-99a3-54181510070e"; }
];
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
}

View file

@ -0,0 +1,63 @@
{
imports = [
# Base configs
./../../base.nix
# Import users and groups
./../../users/jimbo.nix
./../../users/nextcloud.nix
./../../users/nginx.nix
./../../users/liquidsoap.nix
./../../users/groups.nix
# Modules
./../../modules/security.nix
# Hardware
./hardware-configuration.nix
./../../hardware/systemdboot.nix
# Services
./../../services/openssh.nix
./../../server/acme.nix
./../../server/ddclient.nix
./../../server/icecast.nix
./../../server/firewall.nix
./../../server/forgejo.nix
./../../server/mailserver.nix
./../../server/mariadb.nix
./../../server/nginx.nix
./../../server/owncast.nix
./../../server/photoprism.nix
./../../server/minecraft
./../../server/vaultwarden.nix
./../../server/transmission.nix
./../../server/wireguard.nix
./../../server/misc.nix
# File server
./../../server/nextcloud.nix
./../../server/nfs.nix
./../../server/samba.nix
# Matrix
./../../server/synapse.nix
./../../server/element.nix
./../../server/coturn.nix
./../../server/matrix-discord.nix
# Federation
./../../server/lemmy.nix
./../../server/mastodon.nix
./../../server/pixelfed.nix
];
# Set custom openssh port
services.openssh.ports = [ 2222 ];
# Set hostname
networking.hostName = "JimServer";
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
system.stateVersion = "24.05";
}

View file

@ -0,0 +1,110 @@
{ config, outputs, lib, pkgs, modulesPath, ... }:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
# Set all boot options
boot = {
blacklistedKernelModules = [
"pcspkr"
];
initrd = {
availableKernelModules = [
"xhci_pci"
"ehci_pci"
"ahci"
"nvme"
"usbhid"
"sd_mod"
"sr_mod"
];
kernelModules = [
"kvm-intel"
];
};
swraid.mdadmConf = ''
MAILADDR jimbo@${outputs.secrets.jimDomain}
'';
};
# Mounting options
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/8f81cab7-9381-4950-b77f-b85c5fdbad16";
fsType = "ext4";
};
"/boot" = {
device = "/dev/disk/by-uuid/2034-754A";
fsType = "vfat";
};
"/export/JimboNFS" = {
device = "/dev/disk/by-uuid/713fcd92-534c-4153-8e04-e0c6fe5f6a51";
fsType = "ext4";
noCheck = true;
};
"/home/jimbo/JimboNFS" = {
device = "/export/JimboNFS";
fsType = "none";
options = [ "bind" ];
};
# Atrocity of bindmounts
"/mnt/nextcloud/data/JimboNFS" = {
device = "/export/JimboNFS";
fsType = "none";
options = [ "bind" ];
};
"/var/lib/bitwarden_rs" = {
device = "/export/JimboNFS/System/var/lib/bitwarden_rs";
fsType = "none";
options = [ "bind" ];
};
"/var/lib/gitea" = {
device = "/export/JimboNFS/System/var/lib/gitea";
fsType = "none";
options = [ "bind" ];
};
"/var/lib/matrix-synapse" = {
device = "/export/JimboNFS/System/var/lib/matrix-synapse";
fsType = "none";
options = [ "bind" ];
};
"/var/lib/nextcloud" = {
device = "/export/JimboNFS/System/var/lib/nextcloud";
fsType = "none";
options = [ "bind" ];
};
"/var/lib/owncast" = {
device = "/export/JimboNFS/System/var/lib/owncast";
fsType = "none";
options = [ "bind" ];
};
"/var/lib/mastodon" = {
device = "/export/JimboNFS/System/var/lib/mastodon";
fsType = "none";
options = [ "bind" ];
};
"/srv/minecraft" = {
device = "/export/JimboNFS/System/srv/minecraft";
fsType = "none";
options = [ "bind" ];
};
"/var/lib/private/photoprism/originals" = {
device = "/export/JimboNFS/Photos/Galleries";
fsType = "none";
options = [ "bind" ];
};
};
swapDevices = [
{ device = "/dev/disk/by-uuid/ec422cad-bf93-4b15-b989-2c807f1073a4"; }
];
# Enables DHCP on each ethernet and wireless interface.
networking.useDHCP = lib.mkDefault true;
# Hardware settings
boot.swraid.enable = true;
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}