desktop: no more tmpfs and add swap

This commit is contained in:
Kabbone 2023-09-22 19:22:19 +02:00
parent b72a3eb24c
commit a10dfba82d
Signed by: Kabbone
SSH Key Fingerprint: SHA256:A5zPB5I6u5V78V51c362BBdCwhDhfDUVbt7NfKdjWBY
2 changed files with 26 additions and 2 deletions

View File

@ -21,7 +21,8 @@
boot.initrd.kernelModules = [ "vfio_pci" "vfio" "vfio_iommu_type1" ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
boot.tmp.useTmpfs = true;
boot.tmp.useTmpfs = false;
boot.tmp.cleanOnBoot = true;
zramSwap.enable = true;
services.btrfs.autoScrub = {
@ -82,6 +83,12 @@
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@nix,discard=async" ];
};
fileSystems."/swap" =
{ device = "/dev/disk/by-label/NIXROOT";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@swap,discard=async" ];
};
fileSystems."/mnt/snapshots/root" =
{ device = "/dev/disk/by-label/NIXROOT";
fsType = "btrfs";
@ -106,7 +113,7 @@
};
swapDevices = [ ];
swapDevices = [ { device = "/swap/swapfile"; } ];
networking = {
vswitches = {

17
hosts/fix-nfs4-kernel.nix Normal file
View File

@ -0,0 +1,17 @@
{ lib, config, pkgs, ... }:
# NFSv4 fix for 6.5.3 and 6.1.53, remove asap
let
version = config.boot.kernelPackages.kernel.version;
badVersions = [ "6.5.3" "6.1.53" ];
in
lib.mkIf (lib.any (v: v == version) badVersions) {
boot.kernelPatches = [{
name = "nfs4-patch";
patch = pkgs.fetchpatch {
url = "https://patchwork.kernel.org/project/selinux/patch/20230911142358.883728-1-omosnace@redhat.com/raw/";
hash = "sha256-m947t39xr4VqJBZ2mYTFq9Up/NWlwueH8aXFZRQwA7c=";
};
}];
}