2022-06-05 01:43:16 -03:00
|
|
|
|
# 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.
|
2024-05-30 16:54:58 -03:00
|
|
|
|
{
|
|
|
|
|
config,
|
|
|
|
|
lib,
|
|
|
|
|
pkgs,
|
|
|
|
|
modulesPath,
|
|
|
|
|
...
|
|
|
|
|
}:
|
2022-12-14 12:40:56 -03:00
|
|
|
|
let
|
2024-05-30 16:54:58 -03:00
|
|
|
|
btrfs_options = [
|
|
|
|
|
"compress=zstd:3"
|
|
|
|
|
"noatime"
|
|
|
|
|
"x-systemd.device-timeout=0"
|
|
|
|
|
];
|
|
|
|
|
btrfs_ssd = [
|
|
|
|
|
"ssd"
|
|
|
|
|
"discard=async"
|
|
|
|
|
];
|
2023-01-22 18:12:04 -03:00
|
|
|
|
in
|
|
|
|
|
{
|
2024-06-13 22:43:42 -03:00
|
|
|
|
imports = [
|
|
|
|
|
(modulesPath + "/installer/scan/not-detected.nix")
|
|
|
|
|
./partition.nix
|
2024-10-28 12:02:31 -03:00
|
|
|
|
./amdgpu.nix
|
2024-10-30 20:51:43 -03:00
|
|
|
|
./factorio-server.nix
|
2024-06-13 22:43:42 -03:00
|
|
|
|
];
|
2024-05-30 16:54:58 -03:00
|
|
|
|
boot.initrd.availableKernelModules = [
|
|
|
|
|
"nvme"
|
|
|
|
|
"xhci_pci"
|
|
|
|
|
"ahci"
|
|
|
|
|
"usb_storage"
|
|
|
|
|
"usbhid"
|
|
|
|
|
"sd_mod"
|
|
|
|
|
];
|
2023-11-28 12:01:23 -03:00
|
|
|
|
|
2024-01-24 21:59:57 -03:00
|
|
|
|
hardware.opentabletdriver.enable = true;
|
|
|
|
|
|
2024-08-30 19:25:36 -03:00
|
|
|
|
boot.kernelPackages = pkgs.linuxPackages_latest;
|
|
|
|
|
|
2024-10-31 01:40:13 -03:00
|
|
|
|
boot.extraModulePackages = with config.boot.kernelPackages; [ zenpower ];
|
2024-10-18 00:01:43 -03:00
|
|
|
|
|
2022-12-21 23:23:16 -03:00
|
|
|
|
boot.initrd.kernelModules = [ "amdgpu" ];
|
2022-08-30 22:01:06 -03:00
|
|
|
|
boot.kernelModules = [
|
|
|
|
|
"kvm-amd"
|
2022-12-21 23:23:16 -03:00
|
|
|
|
"amdgpu"
|
2023-11-28 12:01:23 -03:00
|
|
|
|
"zenpower"
|
2022-12-21 23:23:16 -03:00
|
|
|
|
];
|
2024-10-28 12:02:31 -03:00
|
|
|
|
|
2023-08-20 17:46:27 -03:00
|
|
|
|
systemd.sleep.extraConfig = ''
|
2023-08-20 17:46:49 -03:00
|
|
|
|
HibernateDelaySec=30s
|
2023-08-20 17:46:27 -03:00
|
|
|
|
SuspendState=mem
|
|
|
|
|
'';
|
2022-08-04 11:58:56 -03:00
|
|
|
|
|
2024-06-16 13:55:06 -03:00
|
|
|
|
fileSystems."/mnt/old" = {
|
|
|
|
|
device = "/dev/disk/by-label/BTRFS_ROOT";
|
|
|
|
|
fsType = "btrfs";
|
|
|
|
|
options = [ "nofail" ] ++ btrfs_options ++ btrfs_ssd;
|
|
|
|
|
};
|
|
|
|
|
# boot.initrd.luks.reusePassphrases = true;
|
|
|
|
|
boot.initrd.luks.devices = {
|
|
|
|
|
"old" = {
|
|
|
|
|
bypassWorkqueues = true;
|
|
|
|
|
device = "/dev/disk/by-label/CRYPT_ROOT";
|
|
|
|
|
};
|
|
|
|
|
"data" = {
|
|
|
|
|
bypassWorkqueues = true;
|
|
|
|
|
device = "/dev/disk/by-label/CRYPT_DATA";
|
|
|
|
|
};
|
|
|
|
|
# "bigboy" = {
|
|
|
|
|
# bypassWorkqueues = true;
|
|
|
|
|
# device = "/dev/disk/by-label/CRYPT_BIGBOY";
|
|
|
|
|
# };
|
|
|
|
|
};
|
2024-06-13 22:43:42 -03:00
|
|
|
|
# boot.loader.efi.efiSysMountPoint = "/boot/efi";
|
|
|
|
|
# fileSystems."/boot/efi" = {
|
|
|
|
|
# device = "/dev/disk/by-label/NIXBOOT";
|
|
|
|
|
# fsType = "vfat";
|
|
|
|
|
# };
|
|
|
|
|
# fileSystems."/home" = {
|
|
|
|
|
# device = "/dev/disk/by-label/BTRFS_ROOT";
|
|
|
|
|
# fsType = "btrfs";
|
|
|
|
|
# options = [ "subvol=home" ] ++ btrfs_options ++ btrfs_ssd;
|
|
|
|
|
# };
|
2024-06-16 13:55:06 -03:00
|
|
|
|
fileSystems."/home/lelgenio/Games" = {
|
|
|
|
|
device = "/dev/disk/by-label/BTRFS_DATA";
|
|
|
|
|
fsType = "btrfs";
|
|
|
|
|
options = [
|
|
|
|
|
"subvol=@games"
|
|
|
|
|
"nofail"
|
|
|
|
|
] ++ btrfs_options;
|
|
|
|
|
};
|
|
|
|
|
fileSystems."/home/lelgenio/Downloads/Torrents" = {
|
|
|
|
|
device = "/dev/disk/by-label/BTRFS_DATA";
|
|
|
|
|
fsType = "btrfs";
|
|
|
|
|
options = [
|
|
|
|
|
"subvol=@torrents"
|
|
|
|
|
"nofail"
|
|
|
|
|
] ++ btrfs_options;
|
|
|
|
|
};
|
|
|
|
|
fileSystems."/home/lelgenio/Música" = {
|
|
|
|
|
device = "/dev/disk/by-label/BTRFS_DATA";
|
|
|
|
|
fsType = "btrfs";
|
|
|
|
|
options = [
|
|
|
|
|
"subvol=@music"
|
|
|
|
|
"nofail"
|
|
|
|
|
] ++ btrfs_options;
|
|
|
|
|
};
|
|
|
|
|
fileSystems."/home/lelgenio/.local/mount/data" = {
|
|
|
|
|
device = "/dev/disk/by-label/BTRFS_DATA";
|
|
|
|
|
fsType = "btrfs";
|
|
|
|
|
options = [
|
|
|
|
|
"subvol=@data"
|
|
|
|
|
"nofail"
|
|
|
|
|
] ++ btrfs_options;
|
|
|
|
|
};
|
2024-06-29 01:52:05 -03:00
|
|
|
|
fileSystems."/home/lelgenio/.local/mount/old" = {
|
|
|
|
|
device = "/dev/disk/by-label/BTRFS_ROOT";
|
|
|
|
|
fsType = "btrfs";
|
|
|
|
|
options = [ "nofail" ] ++ btrfs_options ++ btrfs_ssd;
|
|
|
|
|
};
|
2024-05-30 16:53:51 -03:00
|
|
|
|
|
2022-06-05 01:43:16 -03:00
|
|
|
|
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
|
|
|
|
# (the default) this is the recommended approach. When using systemd-networkd it's
|
|
|
|
|
# still possible to use this option, but it's recommended to use it in conjunction
|
|
|
|
|
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
|
|
|
|
networking.useDHCP = lib.mkDefault true;
|
2022-07-11 21:34:04 -03:00
|
|
|
|
# networking.interfaces.enp4s0.useDHCP = lib.mkDefault true;
|
2022-12-09 22:42:52 -03:00
|
|
|
|
powerManagement.cpuFreqGovernor = "ondemand";
|
2024-05-30 16:54:58 -03:00
|
|
|
|
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
2022-07-15 22:03:57 -03:00
|
|
|
|
networking.hostName = "monolith"; # Define your hostname.
|
2022-08-07 13:59:05 -03:00
|
|
|
|
|
2024-08-14 22:01:27 -03:00
|
|
|
|
virtualisation.virtualbox.host.enable = true;
|
|
|
|
|
|
2023-09-11 00:24:27 -03:00
|
|
|
|
services.udev.extraRules = ''
|
2024-05-31 22:09:29 -03:00
|
|
|
|
# Fix broken suspend with Logitech USB dongle
|
|
|
|
|
# `lsusb | grep Logitech` will return "vendor:product"
|
2023-09-20 02:21:37 -03:00
|
|
|
|
ACTION=="add" SUBSYSTEM=="usb" ATTR{idVendor}=="046d" ATTR{idProduct}=="c547" ATTR{power/wakeup}="disabled"
|
2024-05-31 22:09:29 -03:00
|
|
|
|
# Force all disks to use mq-deadline scheduler
|
|
|
|
|
# For some reason "noop" is used by default which is kinda bad when io is saturated
|
|
|
|
|
ACTION=="add|change", KERNEL=="sd[a-z]*[0-9]*|mmcblk[0-9]*p[0-9]*|nvme[0-9]*n[0-9]*p[0-9]*", ATTR{../queue/scheduler}="mq-deadline"
|
2023-09-11 00:24:27 -03:00
|
|
|
|
'';
|
|
|
|
|
|
2024-06-21 00:29:33 -03:00
|
|
|
|
boot.tmp = {
|
|
|
|
|
cleanOnBoot = true;
|
|
|
|
|
useTmpfs = true;
|
|
|
|
|
};
|
|
|
|
|
|
2022-08-07 13:59:05 -03:00
|
|
|
|
# swap
|
2024-06-13 22:43:42 -03:00
|
|
|
|
# fileSystems."/swap" = {
|
|
|
|
|
# device = "/dev/disk/by-label/BTRFS_ROOT";
|
|
|
|
|
# fsType = "btrfs";
|
|
|
|
|
# # Note these options effect the entire BTRFS filesystem and not just this volume,
|
|
|
|
|
# # with the exception of `"subvol=swap"`, the other options are repeated in my other `fileSystem` mounts
|
|
|
|
|
# options = [ "subvol=swap" ] ++ btrfs_options ++ btrfs_ssd;
|
|
|
|
|
# };
|
|
|
|
|
# swapDevices = [
|
|
|
|
|
# {
|
|
|
|
|
# device = "/swap/swapfile";
|
|
|
|
|
# size = (1024 * 16) + (1024 * 2); # RAM size + 2 GB
|
|
|
|
|
# }
|
|
|
|
|
# ];
|
2022-07-21 00:32:09 -03:00
|
|
|
|
}
|