integrate htpc and associated configuration

This commit is contained in:
k3t
2026-06-01 20:33:57 -06:00
parent 8209672944
commit db7a8a3f6e
21 changed files with 289 additions and 33 deletions
+7
View File
@@ -1,6 +1,13 @@
{ pkgs, lib, ... }:
{
environment.systemPackages = with pkgs; [
pavucontrol
pwvucontrol
qpwgraph
easyeffects
];
# Enable sound with pipewire.
security.rtkit.enable = true;
services.pipewire = {
+17
View File
@@ -0,0 +1,17 @@
{ pkgs, ... }:
{
programs.steam = {
enable = true;
gamescopeSession.enable = true;
extraCompatPackages = with pkgs; [
proton-ge-bin
];
localNetworkGameTransfers.openFirewall = true;
};
programs.gamemode.enable = true;
programs.gamescope = {
enable = true;
capSysNice = true;
};
}
+6
View File
@@ -0,0 +1,6 @@
{
programs.fcast-receiver = {
enable = true;
openFirewall = true;
};
}
+6 -1
View File
@@ -1,3 +1,8 @@
{ pkgs, ... }:
{
xdg.portal.enable = true;
xdg.portal = {
enable = true;
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
};
}
+5
View File
@@ -1,6 +1,11 @@
{ pkgs, ... }:
{
boot.kernelParams = [
"split_lock_detect=off"
"scsi_mod.use_blk_mq=1"
"transparent_hugepage=madvise" # CachyOS default
];
boot.loader.limine.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.extraModulePackages = [ ];
+1
View File
@@ -1,6 +1,7 @@
{ pkgs, ... }:
{
hardware.cpu.amd.updateMicrocode = true;
boot.kernelPackages = pkgs.linuxPackages_xanmod_latest;
boot.binfmt.preferStaticEmulators = true;
boot.binfmt.emulatedSystems = [ "aarch64-linux" "x86_64-windows" ];
+1
View File
@@ -1,6 +1,7 @@
{ pkgs, ... }:
{
hardware.cpu.intel.updateMicrocode = true;
boot.kernelPackages = pkgs.linuxPackages_xanmod_latest;
boot.binfmt.preferStaticEmulators = true;
boot.binfmt.emulatedSystems = [ "aarch64-linux" "x86_64-windows" ];
+10 -1
View File
@@ -1,3 +1,12 @@
{ pkgs, ... }:
{
# Graphics
hardware.enableRedistributableFirmware = true;
hardware.graphics = {
enable = true;
enable32Bit = true;
extraPackages = with pkgs; [
vkbasalt
];
};
}
+2 -1
View File
@@ -14,7 +14,8 @@
# Optional (compute / tooling):
intel-compute-runtime # OpenCL (NEO) + Level Zero for Arc/Xe
# NOTE: 'intel-ocl' also exists as a legacy package; not recommended for Arc/Xe.
# libvdpau-va-gl # Only if you must run VDPAU-only apps
libvdpau-va-gl # Only if you must run VDPAU-only apps
vkbasalt
];
};
}
+18 -2
View File
@@ -1,8 +1,24 @@
{
services.beesd.filesystems = {
root = {
spec = "LABEL=NixOS";
hashTableSizeMB = 128;
verbosity = "crit";
extraOptions = [ "--loadavg-target" "1.5" ];
};
};
services.fstrim.enable = true;
services.system76-scheduler.enable = true;
#services.thermald.enable = true;
services.power-profiles-daemon.enable = true;
systemd.coredump.enable = false;
zramSwap.enable = true;
zramSwap.memoryPercent = 80;
zramSwap = {
enable = true;
algorithm = "zstd";
memoryPercent = 90;
};
services.udev.extraRules = ''
ACTION=="add|change", KERNEL=="nvme[0-9]*", ATTR{queue/scheduler}="kyber"
ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="kyber"
'';
}
+8 -1
View File
@@ -9,7 +9,14 @@
htop
mosh
btop
wget2
python314
wget2
dnsutils
fastfetch
peazip
p7zip
whois
ffmpeg
playerctl
];
}
+3
View File
@@ -1,6 +1,9 @@
{ pkgs, lib, ... }:
{
environment.systemPackages = with pkgs; [
openrgb-with-all-plugins
];
# OpenRGB
services.hardware.openrgb = {
enable = true;
+5 -1
View File
@@ -1,5 +1,9 @@
{
security.polkit.enable = true;
security = {
sudo.execWheelOnly = true;
polkit.enable = true;
protectKernelImage = true;
};
system.autoUpgrade = {
enable = true;
flake = "git+https://k3t.dev/git/nixconf.git?ref=main";
+18
View File
@@ -0,0 +1,18 @@
{
# Transparent Hugepages for better memory performance
boot.kernel.sysctl = {
"vm.max_map_count" = 1048576; # For some games that need it
"vm.swappiness" = 200; # Reduce swapping
# BBR congestion control
"net.core.default_qdisc" = "fq";
"net.ipv4.tcp_congestion_control" = "bbr";
"kernel.sysrq" = 1; # Enable SysRq for emergency recovery
# CachyOS performance tweaks
"kernel.nmi_watchdog" = 0; # Disable NMI watchdog (reduces overhead)
"vm.vfs_cache_pressure" = 50; # Better file cache retention
"vm.dirty_ratio" = 10; # Faster writes to disk
"vm.dirty_background_ratio" = 5; # Background write threshold
"kernel.sched_autogroup_enabled" = 0; # Better CPU scheduling for gaming
};
}
@@ -1,4 +1,19 @@
{
# NTP configuration - NIST atomic clocks
services.timesyncd = {
enable = true;
servers = [
"192.168.0.1"
];
fallbackServers = [
"time-a-g.nist.gov"
"time-a.nist.gov"
"time-b.nist.gov"
"time-c.nist.gov"
"time.cloudflare.com"
"0.pool.ntp.org"
];
};
time.timeZone = "America/Denver";
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
+11
View File
@@ -0,0 +1,11 @@
{ pkgs, ... }:
{
virtualisation.libvirtd = {
enable = true;
qemu = {
package = pkgs.qemu_kvm;
swtpm.enable = true; # This enables TPM support
};
};
}