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.
|
2022-11-07 11:24:40 -03:00
|
|
|
|
{ config, lib, pkgs, modulesPath, ... }:
|
2022-12-14 12:40:56 -03:00
|
|
|
|
let
|
2023-05-07 22:19:23 -03:00
|
|
|
|
btrfs_options = [ "compress=zstd:3" "noatime" "x-systemd.device-timeout=0" ];
|
2022-12-14 12:40:56 -03:00
|
|
|
|
btrfs_ssd = [ "ssd" "discard=async" ];
|
2023-01-22 18:12:04 -03:00
|
|
|
|
in
|
|
|
|
|
{
|
2022-07-21 00:32:09 -03:00
|
|
|
|
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
|
|
|
|
boot.initrd.availableKernelModules =
|
|
|
|
|
[ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
|
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"
|
|
|
|
|
];
|
|
|
|
|
boot.kernelParams = [
|
|
|
|
|
"video=DP-1:1920x1080@144"
|
2022-08-30 22:01:06 -03:00
|
|
|
|
];
|
2022-08-04 11:58:56 -03:00
|
|
|
|
|
|
|
|
|
hardware.opengl.driSupport = true;
|
2022-08-30 22:01:06 -03:00
|
|
|
|
# # For 32 bit applications
|
2022-08-04 11:58:56 -03:00
|
|
|
|
hardware.opengl.driSupport32Bit = true;
|
2022-08-30 22:01:06 -03:00
|
|
|
|
|
2023-06-17 21:29:45 -03:00
|
|
|
|
hardware.opengl.extraPackages = with pkgs; [
|
|
|
|
|
libva
|
|
|
|
|
libvdpau
|
|
|
|
|
vaapiVdpau
|
|
|
|
|
rocm-opencl-icd
|
|
|
|
|
rocm-opencl-runtime
|
|
|
|
|
];
|
|
|
|
|
|
2022-08-30 22:01:06 -03:00
|
|
|
|
# hardware.opengl.extraPackages = with pkgs; [ amdvlk ];
|
|
|
|
|
# # For 32 bit applications
|
|
|
|
|
# # Only available on unstable
|
|
|
|
|
# hardware.opengl.extraPackages32 = with pkgs; [ driversi686Linux.amdvlk ];
|
|
|
|
|
# environment.variables = { AMD_VULKAN_ICD = "RADV"; };
|
2022-08-04 11:58:56 -03:00
|
|
|
|
|
2022-07-21 00:32:09 -03:00
|
|
|
|
fileSystems."/" = {
|
|
|
|
|
device = "/dev/disk/by-label/BTRFS_ROOT";
|
|
|
|
|
fsType = "btrfs";
|
2022-12-14 12:40:56 -03:00
|
|
|
|
options = [ "subvol=nixos" ] ++ btrfs_options ++ btrfs_ssd;
|
2022-07-21 00:32:09 -03:00
|
|
|
|
};
|
2022-12-14 01:05:27 -03:00
|
|
|
|
# boot.initrd.luks.reusePassphrases = true;
|
2022-07-19 20:57:18 -03:00
|
|
|
|
boot.initrd.luks.devices = {
|
2022-12-14 12:40:56 -03:00
|
|
|
|
"main" = {
|
|
|
|
|
bypassWorkqueues = true;
|
|
|
|
|
device = "/dev/disk/by-label/CRYPT_ROOT";
|
|
|
|
|
};
|
|
|
|
|
"data" = {
|
|
|
|
|
bypassWorkqueues = true;
|
|
|
|
|
device = "/dev/disk/by-label/CRYPT_DATA";
|
|
|
|
|
};
|
2022-07-19 20:57:18 -03:00
|
|
|
|
};
|
2022-12-21 23:19:36 -03:00
|
|
|
|
boot.loader.efi.efiSysMountPoint = "/boot/efi";
|
2022-07-21 00:32:09 -03:00
|
|
|
|
fileSystems."/boot/efi" = {
|
|
|
|
|
device = "/dev/disk/by-label/NIXBOOT";
|
|
|
|
|
fsType = "vfat";
|
|
|
|
|
};
|
|
|
|
|
fileSystems."/home" = {
|
|
|
|
|
device = "/dev/disk/by-label/BTRFS_ROOT";
|
|
|
|
|
fsType = "btrfs";
|
2022-12-14 12:40:56 -03:00
|
|
|
|
options = [ "subvol=home" ] ++ btrfs_options ++ btrfs_ssd;
|
2022-07-21 00:32:09 -03:00
|
|
|
|
};
|
|
|
|
|
fileSystems."/home/lelgenio/Games" = {
|
|
|
|
|
device = "/dev/disk/by-label/BTRFS_DATA";
|
|
|
|
|
fsType = "btrfs";
|
2022-10-31 13:31:37 -03:00
|
|
|
|
options = [ "subvol=@games" "nofail" ] ++ btrfs_options;
|
2022-07-21 00:32:09 -03:00
|
|
|
|
};
|
|
|
|
|
fileSystems."/home/lelgenio/Downloads/Torrents" = {
|
|
|
|
|
device = "/dev/disk/by-label/BTRFS_DATA";
|
|
|
|
|
fsType = "btrfs";
|
2022-10-31 13:31:37 -03:00
|
|
|
|
options = [ "subvol=@torrents" "nofail" ] ++ btrfs_options;
|
2022-07-21 00:32:09 -03:00
|
|
|
|
};
|
2022-11-29 15:48:23 -03:00
|
|
|
|
fileSystems."/home/lelgenio/Música" = {
|
|
|
|
|
device = "/dev/disk/by-label/BTRFS_DATA";
|
|
|
|
|
fsType = "btrfs";
|
|
|
|
|
options = [ "subvol=@music" "nofail" ] ++ btrfs_options;
|
|
|
|
|
};
|
2022-07-19 20:19:10 -03:00
|
|
|
|
services.udev.extraRules = ''
|
|
|
|
|
ACTION=="add", SUBSYSTEM=="pci", DRIVER=="pcieport", ATTR{power/wakeup}="disabled"
|
|
|
|
|
'';
|
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";
|
2022-07-21 00:32:09 -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
|
|
|
|
|
|
|
|
|
# swap
|
|
|
|
|
fileSystems."/swap" = {
|
|
|
|
|
device = "/dev/disk/by-label/BTRFS_ROOT";
|
|
|
|
|
fsType = "btrfs";
|
2022-12-14 12:40:56 -03:00
|
|
|
|
# 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;
|
2022-08-07 13:59:05 -03:00
|
|
|
|
};
|
|
|
|
|
swapDevices = [{
|
|
|
|
|
device = "/swap/swapfile";
|
|
|
|
|
size = (1024 * 16) + (1024 * 2); # RAM size + 2 GB
|
|
|
|
|
}];
|
2022-07-21 00:32:09 -03:00
|
|
|
|
}
|