136 lines
3.8 KiB
Nix
136 lines
3.8 KiB
Nix
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||
# and may be overwritten by future invocations. Please make changes
|
||
# to /etc/nixos/configuration.nix instead.
|
||
{ config, lib, pkgs, modulesPath, ... }:
|
||
{
|
||
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||
|
||
boot.initrd.availableKernelModules =
|
||
[ "nvme" "xhci_pci" "thunderbolt" "uas" "sd_mod" ];
|
||
boot.initrd.kernelModules = [ ];
|
||
boot.kernelModules = [ "kvm-amd" ];
|
||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||
boot.kernelParams = [
|
||
"quiet"
|
||
"splash"
|
||
"boot.shell_on_fail"
|
||
"udev.log_priority=3"
|
||
"rd.systemd.show_status=auto"
|
||
# Improve s2idle sleep behavior on AMD
|
||
"rtc_cmos.use_acpi_alarm=1"
|
||
"acpi.prefer_microsoft_dsm_guid=1"
|
||
"amd_pstate=active"
|
||
];
|
||
boot.extraModulePackages = [ ];
|
||
boot.plymouth = {
|
||
enable = true;
|
||
};
|
||
boot.loader.systemd-boot.enable = true;
|
||
boot.loader.efi.canTouchEfiVariables = true;
|
||
boot.tmp.useTmpfs = true;
|
||
boot.consoleLogLevel = 3;
|
||
boot.initrd.verbose = false;
|
||
boot.extraModprobeConfig = ''
|
||
options snd_hda_intel power_save=0
|
||
'';
|
||
fileSystems."/" =
|
||
{
|
||
device = "/dev/disk/by-uuid/adaad601-f79c-4342-ba3a-9eab53ec4cd1";
|
||
fsType = "btrfs";
|
||
options = [ "subvol=@root" "compress=zstd" ];
|
||
};
|
||
|
||
fileSystems."/root-btrfs" =
|
||
{
|
||
device = "/dev/disk/by-uuid/adaad601-f79c-4342-ba3a-9eab53ec4cd1";
|
||
fsType = "btrfs";
|
||
};
|
||
|
||
fileSystems."/home" =
|
||
{
|
||
device = "/dev/disk/by-uuid/adaad601-f79c-4342-ba3a-9eab53ec4cd1";
|
||
fsType = "btrfs";
|
||
options = [ "subvol=@home" "compress=zstd" ];
|
||
};
|
||
|
||
fileSystems."/nix" =
|
||
{
|
||
device = "/dev/disk/by-uuid/adaad601-f79c-4342-ba3a-9eab53ec4cd1";
|
||
fsType = "btrfs";
|
||
options = [ "subvol=@nix" "compress=zstd" "noatime" ];
|
||
};
|
||
|
||
fileSystems."/swap" =
|
||
{
|
||
device = "/dev/disk/by-uuid/adaad601-f79c-4342-ba3a-9eab53ec4cd1";
|
||
fsType = "btrfs";
|
||
options = [ "subvol=@swap" "noatime" ];
|
||
};
|
||
|
||
fileSystems."/mnt/Data" = {
|
||
device = "/dev/disk/by-uuid/239db4ac-762d-4d76-8297-ccd37bcdfd8b";
|
||
fsType = "ext4";
|
||
options = [ "users" "exec" "nofail" "noauto" "x-systemd.automount" ];
|
||
};
|
||
fileSystems."/boot" =
|
||
{
|
||
device = "/dev/disk/by-uuid/0559-4C2D";
|
||
fsType = "vfat";
|
||
options = [ "fmask=0022" "dmask=0022" ];
|
||
};
|
||
# Disk swapfile on @swap is unused; zram is the only swap.
|
||
# After switch: `swapoff /swap/swapfile && rm /swap/swapfile` to reclaim 64G.
|
||
swapDevices = [ ];
|
||
zramSwap = {
|
||
enable = true;
|
||
algorithm = "zstd";
|
||
memoryPercent = 50;
|
||
};
|
||
boot.kernel.sysctl = {
|
||
"vm.swappiness" = 150;
|
||
"vm.page-cluster" = 0;
|
||
};
|
||
networking.useDHCP = lib.mkDefault true;
|
||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||
hardware.cpu.amd.updateMicrocode =
|
||
lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||
|
||
# BTRFS Stuff
|
||
services.btrfs.autoScrub.enable = true;
|
||
services.snapper = {
|
||
persistentTimer = true;
|
||
snapshotRootOnBoot = true;
|
||
configs =
|
||
let
|
||
defaultSettings = {
|
||
TIMELINE_CREATE = true;
|
||
TIMELINE_CLEANUP = true;
|
||
TIMELINE_LIMIT_HOURLY = "10";
|
||
TIMELINE_LIMIT_DAILY = "7";
|
||
TIMELINE_LIMIT_WEEKLY = "0";
|
||
TIMELINE_LIMIT_MONTHLY = "0";
|
||
TIMELINE_LIMIT_YEARLY = "0";
|
||
BACKGROUND_COMPARISON = "yes";
|
||
NUMBER_CLEANUP = "yes";
|
||
NUMBER_MIN_AGE = "1800";
|
||
NUMBER_LIMIT = "10";
|
||
NUMBER_LIMIT_IMPORTANT = "10";
|
||
EMPTY_PRE_POST_CLEANUP = "yes";
|
||
EMPTY_PRE_POST_MIN_AGE = "1800";
|
||
};
|
||
in
|
||
{
|
||
root = defaultSettings // {
|
||
SUBVOLUME = "/";
|
||
};
|
||
home = defaultSettings // {
|
||
SUBVOLUME = "/home";
|
||
};
|
||
};
|
||
};
|
||
environment.systemPackages = [
|
||
pkgs.snapper
|
||
pkgs.snapper-gui
|
||
];
|
||
}
|