From 4f19d4970fcd90cf5a1d3a8d29034f6826a136af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyryl=20P=C5=82otnicki?= Date: Sat, 11 Jul 2020 21:02:36 +0100 Subject: [PATCH] More swap usage on foureighty --- nixos/boot.nix | 1 - nixos/boxes/foureighty/configuration.nix | 6 ++++- .../foureighty/hardware-configuration.nix | 22 +++++++++++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 nixos/boxes/foureighty/hardware-configuration.nix diff --git a/nixos/boot.nix b/nixos/boot.nix index 8dcc125c..c7af2aa9 100644 --- a/nixos/boot.nix +++ b/nixos/boot.nix @@ -4,7 +4,6 @@ boot = { kernel.sysctl = { - "vm.swappiness" = 1; "max_user_watches" = 524288; "kernel.dmesg_restrict" = true; "kernel.unprivileged_bpf_disabled" = true; diff --git a/nixos/boxes/foureighty/configuration.nix b/nixos/boxes/foureighty/configuration.nix index 750eabfa..14acb9f1 100644 --- a/nixos/boxes/foureighty/configuration.nix +++ b/nixos/boxes/foureighty/configuration.nix @@ -24,13 +24,17 @@ time.timeZone = "Europe/London"; hardware.trackpoint.enable = true; + zramSwap = { + enable = true; + algorithm = "zstd"; + }; services.hardware.bolt.enable = true; services.fprintd = { enable = true; }; imports = [ - /etc/nixos/hardware-configuration.nix + ./hardware-configuration.nix ../../boot.nix ../../common.nix ../../gfx-nvidia-optimus.nix diff --git a/nixos/boxes/foureighty/hardware-configuration.nix b/nixos/boxes/foureighty/hardware-configuration.nix new file mode 100644 index 00000000..4d3dba46 --- /dev/null +++ b/nixos/boxes/foureighty/hardware-configuration.nix @@ -0,0 +1,22 @@ +{ config, lib, pkgs, ... }: + +{ + imports = [ ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ "dm-snapshot" ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + boot.kernel.sysctl = { + "vm.swappiness" = 50; + }; + + fileSystems."/" = { device = "/dev/disk/by-uuid/7ae9348d-604e-4196-a27b-24a7495438c3"; fsType = "ext4"; }; + + fileSystems."/boot" = { device = "/dev/disk/by-uuid/C4DD-2374"; fsType = "vfat"; }; + + swapDevices = [ ]; + + nix.maxJobs = lib.mkDefault 8; +}