nix: add swapfile

This commit is contained in:
Julian Mutter 2023-08-31 10:15:26 +02:00
parent 8c800ed66e
commit a13984babc

View File

@ -4,46 +4,47 @@
{ config, lib, pkgs, modulesPath, ... }: { config, lib, pkgs, modulesPath, ... }:
{ {
imports = imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "ehci_pci" "ahci" "xhci_pci" "usbhid" "uas" "sd_mod" "sr_mod" ]; boot.initrd.availableKernelModules =
[ "ehci_pci" "ahci" "xhci_pci" "usbhid" "uas" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ]; boot.kernelModules = [ ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" = {
{ device = "/dev/disk/by-uuid/97a9342e-0be0-4193-9a25-03400fc7da94"; device = "/dev/disk/by-uuid/97a9342e-0be0-4193-9a25-03400fc7da94";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=root" "compress=zstd" ]; options = [ "subvol=root" "compress=zstd" ];
}; };
fileSystems."/home" = fileSystems."/home" = {
{ device = "/dev/disk/by-uuid/97a9342e-0be0-4193-9a25-03400fc7da94"; device = "/dev/disk/by-uuid/97a9342e-0be0-4193-9a25-03400fc7da94";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=home" "compress=zstd" ]; options = [ "subvol=home" "compress=zstd" ];
}; };
fileSystems."/nix" = fileSystems."/nix" = {
{ device = "/dev/disk/by-uuid/97a9342e-0be0-4193-9a25-03400fc7da94"; device = "/dev/disk/by-uuid/97a9342e-0be0-4193-9a25-03400fc7da94";
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=nix" "compress=zstd" "noatime" ]; options = [ "subvol=nix" "compress=zstd" "noatime" ];
}; };
# fileSystems."/swap" = fileSystems."/swap" = {
# { device = "/dev/disk/by-uuid/97a9342e-0be0-4193-9a25-03400fc7da94"; device = "/dev/disk/by-uuid/97a9342e-0be0-4193-9a25-03400fc7da94";
# fsType = "btrfs"; fsType = "btrfs";
# options = [ "subvol=swap" "noatime" ]; options = [ "subvol=swap" "noatime" ];
# }; };
fileSystems."/boot/efi" = fileSystems."/boot/efi" = {
{ device = "/dev/disk/by-uuid/7D48-A59C"; device = "/dev/disk/by-uuid/7D48-A59C";
fsType = "vfat"; fsType = "vfat";
}; };
swapDevices = [ ]; swapDevices = [{
# swapDevices = [ { device = "/swapfile"; } ]; device = "/swap/swapfile";
size = 16 * 1024;
}];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # 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 # (the default) this is the recommended approach. When using systemd-networkd it's
@ -54,5 +55,6 @@
# networking.interfaces.enp4s0.useDHCP = lib.mkDefault true; # networking.interfaces.enp4s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.intel.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
} }