summaryrefslogtreecommitdiff
path: root/modules/hosts
diff options
context:
space:
mode:
authorTim Keller <tjk@tjkeller.xyz>2025-08-21 12:27:51 -0500
committerTim Keller <tjk@tjkeller.xyz>2025-08-21 12:27:51 -0500
commit86fb7036cb4279abfc4ffc2bfa6b3a432c8700b5 (patch)
treebcde8a15f5cec938d3f4653863b0f6309bc65626 /modules/hosts
parent078e8ea33d29af21bad55313d75d716db8d5a617 (diff)
downloadnixos-86fb7036cb4279abfc4ffc2bfa6b3a432c8700b5.tar.xz
nixos-86fb7036cb4279abfc4ffc2bfa6b3a432c8700b5.zip
refactor project to prioritize correctness. place custom nixos options into existing 'modules' and prefix them with '_'. use _archetypes module for software collections, system profiles, etc. personal configs moved to _archetypes.tjkeller. probably changed or fixed or broke a few other things in the process
Diffstat (limited to 'modules/hosts')
-rw-r--r--modules/hosts/T430/configuration.nix17
-rw-r--r--modules/hosts/T430/hardware-configuration.nix33
-rw-r--r--modules/hosts/T430/home.nix5
-rw-r--r--modules/hosts/T495/configuration.nix71
-rw-r--r--modules/hosts/T495/games.nix7
-rw-r--r--modules/hosts/T495/input-leap.nix11
-rw-r--r--modules/hosts/X230/configuration.nix27
-rw-r--r--modules/hosts/hp-envy-office/configuration.nix75
-rw-r--r--modules/hosts/libreX60/configuration.nix9
-rw-r--r--modules/hosts/optiplex/configuration.nix74
10 files changed, 168 insertions, 161 deletions
diff --git a/modules/hosts/T430/configuration.nix b/modules/hosts/T430/configuration.nix
deleted file mode 100644
index 7910275..0000000
--- a/modules/hosts/T430/configuration.nix
+++ /dev/null
@@ -1,17 +0,0 @@
-{ config, lib, pkgs, ... }: {
- imports = [ ./hardware-configuration.nix ];
-
- # TODO this does not function
- #boot.initrd.systemd.extraBin = {
- # sh = "${pkgs.dash}/bin/dash";
- # vim = "${pkgs.neovim}/bin/nvim";
- #};
-
- # Open ports in the firewall.
- # networking.firewall.allowedTCPPorts = [ ... ];
- # networking.firewall.allowedUDPPorts = [ ... ];
- # Or disable the firewall altogether.
- # networking.firewall.enable = false;
-
- system.stateVersion = "24.05";
-}
diff --git a/modules/hosts/T430/hardware-configuration.nix b/modules/hosts/T430/hardware-configuration.nix
deleted file mode 100644
index 206a525..0000000
--- a/modules/hosts/T430/hardware-configuration.nix
+++ /dev/null
@@ -1,33 +0,0 @@
-# Do not modify this file! It was generated by ‘nixos-generate-config’
-# and may be overwritten by future invocations. Please make changes
-# to /etc/nixos/configuration.nix instead.
-{ config, lib, pkgs, modulesPath, ... }:
-
-{
- imports =
- [ (modulesPath + "/installer/scan/not-detected.nix")
- ];
-
- boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "sd_mod" "sr_mod" "sdhci_pci" ];
- boot.initrd.kernelModules = [ ];
- boot.kernelModules = [ ];
- boot.extraModulePackages = [ ];
-
- fileSystems."/" =
- { device = "/dev/disk/by-uuid/b991914b-3a4c-4248-9472-b5403729601a";
- fsType = "btrfs";
- };
-
- swapDevices = [ ];
-
- # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
- # (the default) this is the recommended approach. When using systemd-networkd it's
- # still possible to use this option, but it's recommended to use it in conjunction
- # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
- networking.useDHCP = lib.mkDefault true;
- # networking.interfaces.enp0s25.useDHCP = lib.mkDefault true;
- # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true;
-
- nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
- hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
-}
diff --git a/modules/hosts/T430/home.nix b/modules/hosts/T430/home.nix
deleted file mode 100644
index 15df79a..0000000
--- a/modules/hosts/T430/home.nix
+++ /dev/null
@@ -1,5 +0,0 @@
-{ ... }: {
- imports = [ ../../home ];
-
- wallpapers.enable = true;
-}
diff --git a/modules/hosts/T495/configuration.nix b/modules/hosts/T495/configuration.nix
index 6ee62e9..171f746 100644
--- a/modules/hosts/T495/configuration.nix
+++ b/modules/hosts/T495/configuration.nix
@@ -1,35 +1,64 @@
{ config, lib, pkgs, ... }: {
imports = [
./hardware-configuration.nix
- ./games.nix
- #./input-leap.nix
./wg.nix
+ ../../nixos/archetypes/tjkeller
];
- bootloader.mode = "efi";
- # Enable extra software pkgs
- software.desktop = {
- chromium.enable = true;
- cad.enable = true;
- crypto.enable = true;
- graphics.enable = true;
- office.enable = true;
- utilities.enable = true;
- };
- software.development = {
- docker.enable = true;
+ # Setup bootloader
+ boot._loader.enable = true;
+
+ # Enable common options
+ _archetypes = {
+ # Use desktop profile
+ profiles.desktop.enable = true;
+ # Install software
+ collections = {
+ desktop = {
+ extraUtilities.enable = true;
+ cad.enable = true;
+ chromium.enable = true;
+ crypto.enable = true;
+ graphics.enable = true;
+ office.enable = true;
+ };
+ development = {
+ android.enable = true;
+ c.enable = true;
+ docker.enable = true;
+ lua.enable = true;
+ web = {
+ hugo = {
+ enable = true;
+ openFirewall = true;
+ };
+ node.enable = true;
+ };
+ };
+ bluetooth.enable = true;
+ };
+ # Setup user
+ users.primary = {
+ enable = true;
+ autologin.enable = true;
+ };
+ # Enable network drives
+ tjkeller = {
+ nas = {
+ enable = true;
+ office.enable = true;
+ };
+ };
};
- # Enable network drives
- nas.enable = true;
- nas.office.enable = true;
- nas.office.automount = false;
+ # Install spotify
+ nixpkgs.config.allowUnfree = true;
+ environment.systemPackages = with pkgs; [
+ spotify
+ ];
# Use amdgpu driver for x11
services.xserver.videoDrivers = [ "amdgpu" ];
- # Enable bluetooth
- bluetooth.enable = true;
-
system.stateVersion = "24.05";
}
diff --git a/modules/hosts/T495/games.nix b/modules/hosts/T495/games.nix
deleted file mode 100644
index 419d854..0000000
--- a/modules/hosts/T495/games.nix
+++ /dev/null
@@ -1,7 +0,0 @@
-{ pkgs, ... }: {
- nixpkgs.config.allowUnfree = true;
- environment.systemPackages = with pkgs; [
- #vintagestory
- prismlauncher
- ];
-}
diff --git a/modules/hosts/T495/input-leap.nix b/modules/hosts/T495/input-leap.nix
deleted file mode 100644
index cf6d018..0000000
--- a/modules/hosts/T495/input-leap.nix
+++ /dev/null
@@ -1,11 +0,0 @@
-{ pkgs, ... }: {
- environment.systemPackages = with pkgs; [
- input-leap
- ];
-
- networking.firewall = {
- allowedTCPPorts = [
- 24800 # input-leaps
- ];
- };
-}
diff --git a/modules/hosts/X230/configuration.nix b/modules/hosts/X230/configuration.nix
index 9a8e6b4..accbb1c 100644
--- a/modules/hosts/X230/configuration.nix
+++ b/modules/hosts/X230/configuration.nix
@@ -1,14 +1,29 @@
{ config, lib, pkgs, ... }: {
imports = [
./hardware-configuration.nix
+ ../../nixos/archetypes/tjkeller
];
- bootloader.mode = "efi";
- # Enable extra software pkgs
- software.desktop = {
- crypto.enable = true;
- graphics.enable = true;
- office.enable = true;
+ # Setup bootloader
+ boot._loader.enable = true;
+
+ # Enable common options
+ _archetypes = {
+ # Use desktop profile
+ profiles.desktop.enable = true;
+ # Install software
+ collections = {
+ desktop = {
+ crypto.enable = true;
+ graphics.enable = true;
+ office.enable = true;
+ };
+ };
+ # Setup user
+ users.primary = {
+ enable = true;
+ autologin.enable = true;
+ };
};
system.stateVersion = "24.05";
diff --git a/modules/hosts/hp-envy-office/configuration.nix b/modules/hosts/hp-envy-office/configuration.nix
index 9b3e173..89c5da4 100644
--- a/modules/hosts/hp-envy-office/configuration.nix
+++ b/modules/hosts/hp-envy-office/configuration.nix
@@ -1,42 +1,55 @@
{ config, lib, pkgs, ... }: {
- imports = [ ./hardware-configuration.nix ];
-
- # Show bootloader for longer since it usually doesn't show
- boot.loader.timeout = 15;
-
- # Enable extra software pkgs
- software.desktop = {
- chromium.enable = true;
- cad.enable = false;
- crypto.enable = false;
- graphics.enable = true;
- office.enable = true;
- utilities.enable = true;
- };
- software.development = {
- docker.enable = true;
+ imports = [
+ ./hardware-configuration.nix
+ ../../nixos/archetypes/tjkeller
+ ];
+
+ # Setup bootloader
+ boot._loader.enable = true;
+ boot.loader.timeout = 15; # Show for longer since it's usually skipped
+
+ # Enable common options
+ _archetypes = {
+ # Use desktop profile
+ profiles.desktop.enable = true;
+ # Install software
+ collections = {
+ desktop = {
+ extraUtilities.enable = true;
+ chromium.enable = true;
+ graphics.enable = true;
+ office.enable = true;
+ };
+ development = {
+ docker.enable = true;
+ web = {
+ node.enable = true;
+ };
+ };
+ virtualization.enable = true;
+ bluetooth.enable = true;
+ };
+ # Setup user
+ users.primary = {
+ enable = true;
+ };
+ tjkeller = {
+ nas = {
+ enable = true;
+ office.enable = true;
+ office.automount = true;
+ };
+ };
};
+ # Disable suspend
+ systemd._suspend.disable = true;
+
# Enable virtualization
virtualization.enable = true;
- # Enable network drives
- nas.enable = true;
- nas.office.enable = true;
- nas.home.enable = false;
-
- networking.hosts = {
- "192.168.77.3" = [ "devel" ];
- };
-
# Use amdgpu driver for x11
services.xserver.videoDrivers = [ "amdgpu" ];
- # Enable bluetooth
- bluetooth.enable = true;
-
- # Disable autologin
- autologin.enable = false;
-
system.stateVersion = "24.11";
}
diff --git a/modules/hosts/libreX60/configuration.nix b/modules/hosts/libreX60/configuration.nix
index 55f1774..9c83a42 100644
--- a/modules/hosts/libreX60/configuration.nix
+++ b/modules/hosts/libreX60/configuration.nix
@@ -2,23 +2,22 @@
imports = [
./hardware-configuration.nix
./powertop-auto-tune.nix
+ ../../nixos/archetypes/tjkeller
# Uncomment this module and reboot to enable bios flashing
#./bios-flashing.nix
];
# Use grub
- bootloader = {
+ boot._loader = {
+ enable = true;
loader = "grub";
mode = "bios";
grub.biosDevice = "/dev/sda";
};
- # Use bootloader
+ # Use libre kernel
boot.kernelPackages = pkgs.linuxPackages-libre;
- # Enable network drives
- nas.enable = true;
-
# i915 Gpu requires intel driver
services.xserver.videoDrivers = [ "intel" ];
diff --git a/modules/hosts/optiplex/configuration.nix b/modules/hosts/optiplex/configuration.nix
index 16ba475..36241a8 100644
--- a/modules/hosts/optiplex/configuration.nix
+++ b/modules/hosts/optiplex/configuration.nix
@@ -1,36 +1,63 @@
{ config, lib, pkgs, ... }: {
- imports = [ ./hardware-configuration.nix ];
- bootloader.mode = "efi";
+ imports = [
+ ./hardware-configuration.nix
+ ../../nixos/archetypes/tjkeller
+ ];
- # Allow unfree for nvidia + others
- nixpkgs.config.allowUnfree = true;
+ # Setup bootloader
+ boot._loader.enable = true;
- # Enable extra software pkgs
- software.desktop = {
- chromium.enable = true;
- cad.enable = true;
- crypto.enable = true;
- graphics.enable = true;
- office.enable = true;
- utilities.enable = true;
- };
- software.development = {
- docker.enable = true;
+ # Enable common options
+ _archetypes = {
+ # Use desktop profile
+ profiles.desktop.enable = true;
+ # Install software
+ collections = {
+ desktop = {
+ extraUtilities.enable = true;
+ cad.enable = true;
+ chromium.enable = true;
+ crypto.enable = true;
+ graphics.enable = true;
+ office.enable = true;
+ };
+ development = {
+ android.enable = true;
+ c.enable = true;
+ docker.enable = true;
+ lua.enable = true;
+ web = {
+ hugo = {
+ enable = true;
+ openFirewall = true;
+ };
+ node.enable = true;
+ };
+ };
+ };
+ # Setup user
+ users.primary = {
+ enable = true;
+ autologin.enable = true;
+ };
+ tjkeller = {
+ nas.enable = true;
+ };
};
- # Install more programs
+ # Disable suspend
+ systemd._suspend.disable = true;
+
+ # Allow unfree for nvidia + others
+ nixpkgs.config.allowUnfree = true;
+
+ # Install more software
environment.systemPackages = with pkgs; [
prismlauncher
spotify
#vintagestory
];
- # Enable network drives
- nas.enable = true;
-
- # Disable wifi
- wifi.enable = false;
-
# Use nvidia driver
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia = {
@@ -42,8 +69,5 @@
forceFullCompositionPipeline = true; # Enables vsync
};
- # Disable suspend
- suspend.enable = false;
-
system.stateVersion = "24.11";
}