Refactor NixOS configuration: Move GUI apps to desktop modules and create headless config

- Move GUI applications from users/jsutter.nix to appropriate desktop modules:
  * office.nix: slack, signal-desktop
  * gaming.nix: discord, stremio
  * plasma.nix: arc-theme, pinentry, tigervnc
  * dev.nix: putty
  * media.nix (new): vlc, deluge

- Create systems/common-headless.nix for server configurations:
  * Remove GUI dependencies (Flatpak, XDG portals, fonts, graphics drivers)
  * Include only essential CLI tools and server packages
  * Disable X server completely

- Simplify skip01 configuration:
  * Remove Intel graphics drivers and OpenGL support
  * Use headless common configuration
  * Keep unified users/jsutter.nix (no split files)

- Update flake.nix to include new media.nix module in desktop systems

Result: Clean separation between desktop and headless configurations
with improved modularity and maintainability.
This commit is contained in:
Julian Sutter 2025-07-30 23:17:03 -07:00
parent cb68b1cc02
commit 61c3722f5a
10 changed files with 194 additions and 42 deletions

View file

@ -6,6 +6,7 @@ environment.systemPackages = with pkgs; [
(python3.withPackages(ps: with ps; [ pandas requests python-dotenv pip uv ])) (python3.withPackages(ps: with ps; [ pandas requests python-dotenv pip uv ]))
nodejs nodejs
rpi-imager rpi-imager
putty # SSH/Telnet client
pkgs-unstable.windsurf # Use windsurf from unstable packages pkgs-unstable.windsurf # Use windsurf from unstable packages
]; ];

View file

@ -3,6 +3,8 @@
{ {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
discord # Gaming communication
stremio # Media streaming
# parsec-bin # parsec-bin
# bottles # bottles
]; ];

8
desktop/media.nix Normal file
View file

@ -0,0 +1,8 @@
{ config, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
vlc # Media player
deluge # BitTorrent client
];
}

View file

@ -1,11 +1,11 @@
{ config, pkgs, ... }: { config, pkgs, pkgs-unstable, ... }:
{ {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
libreoffice-qt libreoffice-qt
thunderbird thunderbird
slack # Team communication
pkgs-unstable.signal-desktop # Private messaging
# gimp # Temporarily commented out to avoid build errors # gimp # Temporarily commented out to avoid build errors
# calibre # calibre
]; ];

View file

@ -15,6 +15,9 @@
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
kdePackages.spectacle kdePackages.spectacle
arc-theme # Desktop theme
pinentry # GUI pinentry for GPG
tigervnc # VNC client/server
]; ];
# GNUPG Stuff # GNUPG Stuff

View file

@ -45,6 +45,7 @@
./desktop/dev.nix ./desktop/dev.nix
./desktop/office.nix ./desktop/office.nix
./desktop/gaming.nix ./desktop/gaming.nix
./desktop/media.nix
./desktop/virtualization.nix ./desktop/virtualization.nix
./desktop/crypto.nix ./desktop/crypto.nix
]; ];
@ -77,7 +78,7 @@
}; };
skip01 = mkSystem { skip01 = mkSystem {
modules = [ modules = [
./systems/common.nix ./systems/common-headless.nix
./systems/skip01.nix ./systems/skip01.nix
./users/jsutter.nix ./users/jsutter.nix
./servers/common.nix ./servers/common.nix

View file

@ -1,4 +1,9 @@
{ config, pkgs, ... }:
{
virtualisation = { virtualisation = {
docker = { docker = {
enable = true; enable = true;
}; };
};
}

153
systems/common-headless.nix Normal file
View file

@ -0,0 +1,153 @@
{ config, pkgs, ... }:
{
fileSystems."/" =
{ device = "/dev/disk/by-partlabel/primary";
fsType = "btrfs";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-partlabel/ESP";
fsType = "vfat";
};
# hardware
hardware.enableRedistributableFirmware = true;
services.fwupd.enable = true;
# Network
networking = {
extraHosts = "";
networkmanager = {
enable = true;
plugins = with pkgs; [
networkmanager-openvpn
networkmanager-openconnect
];
};
useDHCP = false; # Depreciated
};
# Bootloader
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# Kernel
boot.kernelPackages = pkgs.linuxPackages_latest;
# Nix
nix = {
# Automate garbage collection
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 7d";
};
package = pkgs.nixVersions.stable;
settings = {
auto-optimise-store = true;
trusted-users = [ "root" "jsutter" ];
experimental-features = [ "nix-command" "flakes" ];
};
};
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# Set your time zone.
time.timeZone = "America/Los_Angeles";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "en_US.UTF-8";
LC_IDENTIFICATION = "en_US.UTF-8";
LC_MEASUREMENT = "en_US.UTF-8";
LC_MONETARY = "en_US.UTF-8";
LC_NAME = "en_US.UTF-8";
LC_NUMERIC = "en_US.UTF-8";
LC_PAPER = "en_US.UTF-8";
LC_TELEPHONE = "en_US.UTF-8";
LC_TIME = "en_US.UTF-8";
};
# Enable CUPS to print documents (disabled for headless)
# services.printing.enable = true;
# Enable sound (disabled for headless)
# sound.enable = true;
# hardware.pulseaudio.enable = false;
# security.rtkit.enable = true;
# services.pipewire = {
# enable = true;
# alsa.enable = true;
# alsa.support32Bit = true;
# pulse.enable = true;
# };
# Define a user account. Don't forget to set a password with 'passwd'.
users.defaultUserShell = pkgs.zsh;
programs.zsh.enable = true;
# System state version
system.stateVersion = "24.05";
# List packages installed in system profile
environment.systemPackages = with pkgs; [
# Essential CLI tools for server management
vim
git
curl
wget
htop
iotop
nethogs
ncdu
tree
unzip
zip
jq
yq
tmux
screen
lsof
netcat
nmap
tcpdump
iftop
dnsutils
whois
rsync
pciutils
sysstat
powertop
gnupg
p7zip
openssl
gnumake
kopia
dig
python3
pv
stress
s-tui
clinfo
fwupd
];
# No GUI services for headless
# services.flatpak.enable = false; # Explicitly disabled
# No fonts needed for headless
# fonts.packages = []; # No GUI fonts needed
# Disable X server completely for headless
services.xserver.enable = false;
# Disable documentation to save space
documentation.nixos.enable = false;
# Network optimizations
systemd.network.wait-online.enable = false;
boot.initrd.systemd.network.wait-online.enable = false;
}

View file

@ -6,13 +6,12 @@
# Boot and kernel modules for Intel NUC # Boot and kernel modules for Intel NUC
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" ]; boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ "i915" ]; # Intel integrated graphics boot.initrd.kernelModules = [ ]; # No graphics drivers needed for headless
boot.kernelModules = [ "kvm-intel" ]; # Intel virtualization support boot.kernelModules = [ "kvm-intel" ]; # Intel virtualization support
boot.extraModulePackages = []; boot.extraModulePackages = [];
# Intel-specific kernel parameters # Server-specific kernel parameters
boot.kernelParams = [ boot.kernelParams = [
"i915.enable_guc=2" # Enable GuC and HuC for better power management
"intel_iommu=on" # Enable IOMMU for virtualization "intel_iommu=on" # Enable IOMMU for virtualization
]; ];
@ -20,18 +19,7 @@
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
# Intel graphics support # No graphics support needed for headless server
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
extraPackages = with pkgs; [
intel-media-driver # VAAPI driver for newer Intel GPUs
vaapiIntel # VAAPI driver for older Intel GPUs
vaapiVdpau
libvdpau-va-gl
];
};
# Power management optimized for server use # Power management optimized for server use
powerManagement = { powerManagement = {
@ -61,7 +49,7 @@
} }
]; ];
# Enable hardware monitoring # Enable hardware monitoring (CLI only)
hardware.sensor.iio.enable = true; hardware.sensor.iio.enable = true;
# Network performance tuning for server use # Network performance tuning for server use

View file

@ -10,20 +10,11 @@
hashedPassword = "$6$tvkhGd24G6pVOsWr$j8ZAqSnXPTGwMGmIulU5Puzqd4iKdu8eAMSFis/cPqTW6u2xGQMqPHH1W9IZwKSL6.nS7Jc/NR2VwpPosyXDH/"; hashedPassword = "$6$tvkhGd24G6pVOsWr$j8ZAqSnXPTGwMGmIulU5Puzqd4iKdu8eAMSFis/cPqTW6u2xGQMqPHH1W9IZwKSL6.nS7Jc/NR2VwpPosyXDH/";
openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBNVUh+RrcOSMRV6qysnsdPs5AyK8dSm4QhhnwgpikyI jsutter@symbiotrip.com" ]; openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBNVUh+RrcOSMRV6qysnsdPs5AyK8dSm4QhhnwgpikyI jsutter@symbiotrip.com" ];
packages = with pkgs; [ packages = with pkgs; [
vlc # Essential CLI tools and user utilities only
pinentry # GUI applications have been moved to appropriate desktop modules
arc-theme direnv # Development environment management
slack appimage-run # System utility for AppImages
direnv cloudflared # Cloudflare tunnel CLI
deluge
pkgs-unstable.signal-desktop
putty
rpi-imager
discord
stremio
tigervnc
appimage-run
cloudflared
]; ];
}; };