Files
nixos/caesium.nixos.nix
Matthew Bessette 26fce9d3d3 stable?
2026-04-08 23:05:49 -04:00

196 lines
5.2 KiB
Nix

{ config, pkgs, ... }:
{
imports = [
./caesium.hardware.nix # Crucial: Imports your UUIDs
];
time.timeZone = "America/New_York";
nixpkgs.config.allowUnfree = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
# --- BOOTLOADER ---
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.kernelParams = [ "usbcore.autosuspend=-1" ];
networking.hostName = "caesium";
networking.networkmanager.enable = true;
networking.interfaces.enp13s0.wakeOnLan.enable = true;
# --- STORAGE & SSD OPTIMIZATION ---
# Enable TRIM for SSD longevity
services.fstrim.enable = true;
# Hard links duplicate files in the store to save space
nix.settings.auto-optimise-store = true;
# --- SWAP STRATEGY ---
systemd.targets.hibernate.enable = false;
systemd.targets.hybrid-sleep.enable = false;
# Primary Swap: Compressed RAM (Fastest)
zramSwap.enable = true;
zramSwap.memoryPercent = 25;
# Secondary Swap: 16GB File on Alpha (Safety Net)
swapDevices = [ {
device = "/var/lib/swapfile";
size = 16 * 1024; # 16GB
} ];
# --- USER & GROUPS ---
users.groups.storage = {};
users.users.mbessette = {
isNormalUser = true;
shell = pkgs.zsh;
extraGroups = [ "wheel" "networkmanager" "storage" "docker" ];
};
# --- FILE SYSTEMS (Overrides/Additions) ---
# Note: The UUIDs stay in hardware-configuration.nix.
# We only list them here if we want to add specific options like compression.
fileSystems."/nix".options = [ "subvol=@nix" "compress=zstd" "noatime" ];
fileSystems."/mnt/bottles" = {
device = "/dev/disk/by-uuid/9523b80b-8a1f-4784-9750-9b8fadf91b92"; # Use the same Alpha UUID
fsType = "btrfs";
options = [ "subvol=@bottles" "compress=zstd" "noatime" ];
};
fileSystems."/mnt/steam-games" = {
device = "/dev/disk/by-uuid/9523b80b-8a1f-4784-9750-9b8fadf91b92";
fsType = "btrfs";
options = [ "subvol=@steam" "compress=zstd" "noatime" ];
};
fileSystems."/mnt/Projects" = {
device = "/dev/disk/by-uuid/bd31dc44-4bc0-4080-95c7-faee9ebc2b79";
fsType = "ext4";
};
# --- SYSTEM PERMISSIONS ---
systemd.tmpfiles.rules = [
"d /mnt 0775 mbessette storage -"
"d /mnt/steam-games 0775 mbessette storage -"
"d /mnt/bottles 0775 mbessette storage -"
"d /mnt/Projects 0775 mbessette storage -"
"d /mnt/Projects/.docker-data 0770 root root -"
];
# --- VIRTUALIZATION ---
virtualisation.docker.enable = true;
virtualisation.docker.daemon.settings = {
data-root = "/mnt/Projects/.docker-data";
};
# --- AUDIO ---
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# Use pulse.rules to target specific apps or set global pulse defaults
extraConfig.pipewire-pulse."92-discord-fix" = {
"pulse.rules" = [
{
matches = [ { "application.name" = "~Discord*"; } ];
actions = {
update-props = {
"pulse.min.req" = "1024/48000";
"pulse.default.req" = "1024/48000";
"pulse.max.req" = "2048/48000";
"pulse.min.quantum" = "1024/48000";
};
};
}
];
};
};
# --- OS ---
# This stays 'true' to enable the graphical pipeline
services.xserver.enable = true;
services.xserver.videoDrivers = [ "amdgpu" ];
services.flatpak.enable = true;
# SDDM is the login manager; Plasma 6 is the desktop
services.displayManager.sddm.enable = true;
services.desktopManager.plasma6.enable = true;
# Tell SDDM to use Wayland for the login screen itself (Ultra Modern)
services.displayManager.sddm.wayland.enable = true;
fonts.packages = with pkgs; [
noto-fonts
noto-fonts-cjk-sans
noto-fonts-color-emoji
liberation_ttf
fira-code
fira-code-symbols
mplus-outline-fonts.githubRelease
dina-font
proggyfonts
];
# Ensure hardware acceleration is ready for Wayland
hardware.graphics = {
enable = true;
enable32Bit = true; # CRITICAL for Steam/Gaming
};
# --- PROGRAMS ---
programs.zsh.enable = true;
programs.steam = {
enable = true;
remotePlay.openFirewall = true;
extraPackages = with pkgs; [
gperftools
];
package = pkgs.steam.override {
extraBwrapArgs = [
"--bind /mnt/steam-games /mnt/steam-games"
];
};
};
programs._1password-gui = {
enable = true;
polkitPolicyOwners = [ "mbessette" ];
};
# Biome config
environment.etc."biome.json".source = ./config.biome.json;
environment.etc."oxlintrc.json".source = ./config.oxlintrc.json;
environment.systemPackages = with pkgs; [
ethtool
vim
git
wget
curl
firefox
discord
wowup-cf
spotify
faugus-launcher
];
services.flatpak.packages = [
# "io.github.Faugus.faugus-launcher"
];
services.flatpak.overrides = {
# "io.github.Faugus.faugus-launcher".Context.filesystems = [
# "/mtn/bottles"
# ];
};
programs.appimage = {
enable = true;
binfmt = true;
};
# --- SYSTEM VERSION ---
system.stateVersion = "24.11"; # Or current stable version
}