70 lines
2.0 KiB
Nix
70 lines
2.0 KiB
Nix
{ config, pkgs, ... }:
|
|
|
|
{
|
|
imports = [
|
|
./hardware-configuration.nix # Crucial: Imports your UUIDs
|
|
];
|
|
|
|
# --- BOOTLOADER ---
|
|
boot.loader.systemd-boot.enable = true;
|
|
boot.loader.efi.canTouchEfiVariables = true;
|
|
|
|
networking.hostName = "caesium";
|
|
networking.networkmanager.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 ---
|
|
# 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;
|
|
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."/usr/local/bottles" = {
|
|
device = "/dev/disk/by-uuid/9523b80b-8a1f-4784-9750-9b8fadf91b92"; # Use the same Alpha UUID
|
|
fsType = "btrfs";
|
|
options = [ "subvol=@bottles" "compress=zstd" "noatime" ];
|
|
};
|
|
|
|
# --- SYSTEM PERMISSIONS ---
|
|
systemd.tmpfiles.rules = [
|
|
"d /usr/local/steam-games 0775 mbessette storage -"
|
|
"d /usr/local/bottles 0775 mbessette storage -"
|
|
"d /usr/local/Projects 0775 mbessette storage -"
|
|
"d /usr/local/docker-data 0770 root root -"
|
|
];
|
|
|
|
# --- VIRTUALIZATION ---
|
|
virtualisation.docker.enable = true;
|
|
virtualisation.docker.daemon.settings = {
|
|
data-root = "/usr/local/docker-data";
|
|
};
|
|
|
|
# --- NETWORKING ---
|
|
networking.hostName = "nixos-alpha";
|
|
networking.networkmanager.enable = true;
|
|
|
|
# --- SYSTEM VERSION ---
|
|
system.stateVersion = "24.11"; # Or current stable version
|
|
} |