This repository has been archived on 2026-03-10. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
nixos/hosts/gunter/configuration.nix
Torjus Håkestad 7c200468f8
All checks were successful
Run nix flake check / flake-check (push) Successful in 2m12s
system: replace host detection with capabilities module
Replace scattered osConfig.system.name comparisons with a declarative
host.capabilities module. This improves maintainability and semantic
clarity by expressing what capabilities a host has rather than checking
its name.

Changes:
- Add system/host-capabilities.nix with options for hardware, form factor,
  UI behavior, services, and backup configuration
- Configure capabilities in hosts/gunter and hosts/magicman
- Migrate 6 files to use capabilities: packages, waybar, ssh, backup-home
- Remove redundant host name check for pciutils in gunter config
- Make backup-home service conditionally enabled based on capabilities

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-31 10:16:19 +01:00

155 lines
3.8 KiB
Nix

{
config,
lib,
inputs,
pkgs,
...
}:
{
imports = [
./hardware-configuration.nix
../../system/monitoring
];
# Sops stuff
sops.defaultSopsFile = ../../secrets/gunter/secrets.yaml;
sops.age.keyFile = "/var/lib/sops-nix/key.txt";
sops.age.generateKey = true;
sops.secrets."gotify_tokens/backup-home" = { };
# Enable microcode updates
hardware.enableRedistributableFirmware = true;
# Bootloader stuff
boot = {
blacklistedKernelModules = [
"mt7921e"
"mt7921_common"
"mt792x_lib"
"mt76_connac_lib"
"mt76"
];
# Kernel stuff
# kernelPackages = lib.warn "Pinned to kernel 6.12 due to issues" pkgs.linuxPackages_6_12;
kernelParams = [ "module_blacklist=amdgpu" ];
kernel.sysctl = {
"vm.max_map_count" = 262144;
};
extraModprobeConfig = ''
options v4l2loopback exclusive_caps=1 card_label="Virtual Camera"
'';
# Bootloader stuff
loader.systemd-boot = {
configurationLimit = 10;
memtest86.enable = true;
};
supportedFilesystems = [ "nfs" ];
};
# Networking stuff
networking.hostName = "gunter"; # Define your hostname.
networking.firewall.allowedTCPPorts = [ 8989 ];
# Additional nix caches for homelab and CUDA
nix.settings = {
substituters = [
"https://nix-cache.home.2rjus.net"
"https://cuda-maintainers.cachix.org"
];
trusted-substituters = [
"https://nix-cache.home.2rjus.net"
"https://cuda-maintainers.cachix.org"
];
trusted-public-keys = [
"nix-cache.home.2rjus.net-1:2kowZOG6pvhoK4AHVO3alBlvcghH20wchzoR0V86UWI="
"cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E="
];
};
# Enable graphics
hardware.graphics = {
enable = true;
extraPackages = with pkgs; [
libva-vdpau-driver
nvidia-vaapi-driver
];
};
# Nvidia stuff
hardware.nvidia = {
modesetting.enable = true;
powerManagement.enable = false;
powerManagement.finegrained = false;
open = true;
nvidiaSettings = false;
package = config.boot.kernelPackages.nvidiaPackages.beta;
# package =
# lib.warn "nvidia driver override to use 580.82.07"
# config.boot.kernelPackages.nvidiaPackages.mkDriver
# {
# version = "580.82.07";
# sha256_64bit = "sha256-Bh5I4R/lUiMglYEdCxzqm3GLolQNYFB0/yJ/zgYoeYw=";
# sha256_aarch64 = lib.fakeHash;
# openSha256 = "sha256-8/7ZrcwBMgrBtxebYtCcH5A51u3lAxXTCY00LElZz08=";
# settingsSha256 = lib.fakeHash;
# persistencedSha256 = lib.fakeSha256;
# };
};
# Setup nvidia video drivers
# nixpkgs.overlays = [
# (self: super: {
# hyprland = super.hyprland.override {
# debug = true;
# };
# })
# ];
services.xserver.videoDrivers = [ "nvidia" ];
# Host capabilities
host.capabilities = {
hasCuda = true;
hasNvidia = true;
hasBattery = false;
formFactor = "desktop";
volumeScrollStep = 5;
enableArrhist = true;
hasEduroamAccess = false;
backupRepository = "rest:http://10.69.12.52:8000/gunter.home.2rjus.net";
backupPassword = "gunter.home.2rjus.net";
};
# Install system-wide packages
environment.systemPackages = with pkgs; [
curl
git
libnotify
usbutils
vim
wget
v4l-utils
nmap
pciutils
# X shit
# xorg.xorgserver
# xorg.xinit
# xorg.xf86inputevdev
# xorg.xf86inputlibinput
# xorg.xinit
];
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
# and migrated your data accordingly.
#
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
system.stateVersion = "23.11"; # Did you read the comment?
}