Initial NixOS flake: Hyprland (end-4 illogical-impulse), NVIDIA, gaming, dev tools

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C5ydBQk68JYw8HXzUDLAyV
This commit is contained in:
2026-07-18 15:41:54 +01:00
commit d14196dcde
10 changed files with 368 additions and 0 deletions

47
modules/core.nix Normal file
View File

@@ -0,0 +1,47 @@
{ pkgs, ... }:
{
nix.settings = {
experimental-features = [ "nix-command" "flakes" ];
auto-optimise-store = true;
trusted-users = [ "root" "@wheel" ];
};
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 14d";
};
nixpkgs.config.allowUnfree = true;
networking.networkmanager.enable = true; # required by illogical-flake
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
};
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
security.rtkit.enable = true;
services.fstrim.enable = true;
# Read the Windows/data partitions when needed
boot.supportedFilesystems = [ "ntfs" ];
environment.systemPackages = with pkgs; [
wget
curl
file
unzip
p7zip
pciutils
usbutils
efibootmgr # check/fix boot order so rEFInd stays first
];
}

31
modules/desktop.nix Normal file
View File

@@ -0,0 +1,31 @@
{ pkgs, ... }:
{
# System-side requirements of illogical-flake (the HM module does the rest)
programs.hyprland.enable = true;
services.geoclue2.enable = true; # QtPositioning — weather / night light widgets
services.displayManager.sddm = {
enable = true;
wayland.enable = true;
};
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; # file pickers etc.
security.polkit.enable = true;
programs.dconf.enable = true;
services.gvfs.enable = true;
services.udisks2.enable = true;
services.upower.enable = true;
fonts.packages = with pkgs; [
# named by the illogical-flake README
rubik
nerd-fonts.ubuntu
nerd-fonts.jetbrains-mono
material-symbols
noto-fonts
noto-fonts-cjk-sans
noto-fonts-color-emoji
];
}

19
modules/gaming.nix Normal file
View File

@@ -0,0 +1,19 @@
{ pkgs, ... }:
{
programs.steam = {
enable = true;
remotePlay.openFirewall = true;
gamescopeSession.enable = true; # "Steam (gamescope)" session in SDDM
extraCompatPackages = [ pkgs.proton-ge-bin ];
};
programs.gamemode.enable = true;
programs.gamescope.enable = true;
# programs.gamescope.capSysNice = true; # left off — known to break gamescope under Steam
environment.systemPackages = with pkgs; [
mangohud
protonup-qt
];
}

30
modules/nvidia.nix Normal file
View File

@@ -0,0 +1,30 @@
{ config, ... }:
{
services.xserver.videoDrivers = [ "nvidia" ];
hardware.graphics = {
enable = true;
enable32Bit = true; # Steam/Proton
};
hardware.nvidia = {
modesetting.enable = true; # nvidia-drm.modeset=1 — mandatory for Wayland
open = true; # RTX 3080 (Ampere): NVIDIA-recommended on driver >= 560
nvidiaSettings = true;
powerManagement.enable = true; # preserves VRAM across suspend — avoids Wayland resume corruption
powerManagement.finegrained = false; # desktop GPU
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
boot.kernelParams = [ "nvidia_drm.fbdev=1" ];
environment.sessionVariables = {
LIBVA_DRIVER_NAME = "nvidia";
NVD_BACKEND = "direct";
ELECTRON_OZONE_PLATFORM_HINT = "auto";
# Fallbacks — only if symptoms appear (should be unnecessary with driver 560+ / explicit sync):
# WLR_NO_HARDWARE_CURSORS = "1"; # invisible/glitchy cursor
# __GLX_VENDOR_LIBRARY_NAME = "nvidia"; # Xwayland picks wrong GL vendor
};
}