monolith: compress btrfs volumes

This commit is contained in:
Leonardo Eugênio 2022-10-31 13:31:37 -03:00
parent 4b4c393567
commit b1a7366eb4

View file

@ -1,7 +1,9 @@
# Do not modify this file! It was generated by nixos-generate-config # Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes # and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead. # to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }: { { config, lib, pkgs, modulesPath, ... }: let
btrfs_options = [ "compress=zstd:3" "noatime" ];
in {
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = boot.initrd.availableKernelModules =
[ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ]; [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
@ -39,17 +41,17 @@
fileSystems."/home" = { fileSystems."/home" = {
device = "/dev/disk/by-label/BTRFS_ROOT"; device = "/dev/disk/by-label/BTRFS_ROOT";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=home" ]; options = [ "subvol=home" ] ++ btrfs_options;
}; };
fileSystems."/home/lelgenio/Games" = { fileSystems."/home/lelgenio/Games" = {
device = "/dev/disk/by-label/BTRFS_DATA"; device = "/dev/disk/by-label/BTRFS_DATA";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=@games" "nofail" ]; options = [ "subvol=@games" "nofail" ] ++ btrfs_options;
}; };
fileSystems."/home/lelgenio/Downloads/Torrents" = { fileSystems."/home/lelgenio/Downloads/Torrents" = {
device = "/dev/disk/by-label/BTRFS_DATA"; device = "/dev/disk/by-label/BTRFS_DATA";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=@torrents" "nofail" ]; options = [ "subvol=@torrents" "nofail" ] ++ btrfs_options;
}; };
services.udev.extraRules = '' services.udev.extraRules = ''
ACTION=="add", SUBSYSTEM=="pci", DRIVER=="pcieport", ATTR{power/wakeup}="disabled" ACTION=="add", SUBSYSTEM=="pci", DRIVER=="pcieport", ATTR{power/wakeup}="disabled"