Compare commits

...
Author SHA1 Message Date
nixos-install.sh 4c8ae96253 Replace gnome with xfce 2025-12-29 17:11:56 +00:00
nixos-install.sh 2e6c44dad6 Give qitech user serial permissions 2025-12-29 17:11:56 +00:00
nixos-install.sh 4de5df45d6 Enable 6GB swap 2025-12-29 17:11:56 +00:00
nixos-install.sh 8c8c5c664c Have development specific settings 2025-12-29 17:11:56 +00:00
3 changed files with 138 additions and 157 deletions

No files matched your search

+72 -56
View File
@@ -18,8 +18,6 @@ in
boot.kernelPackages = pkgs.linuxPackages_6_13;
boot.kernelModules = [ "i915" ];
boot.kernelParams = [
# Realtime Preemption
"preempt=full"
@@ -70,10 +68,56 @@ in
boot.kernel.sysctl = {
"kernel.panic_on_oops" = 1; # Reboot on kernel oops
"kernel.panic" = 10; # Reboot after 10 seconds on panic
"vm.swappiness" = 10; # Reduce swap usage
# "vm.swappiness" = 10; # Reduce swap usage
"kernel.sysrq" = 1; # Enable SysRq for emergency control
};
# Create a 6 GiB swapfile at /swapfile
systemd.tmpfiles.rules = [
# Ensure parent directory exists with proper perms (root dir already exists)
# Create the swapfile with exact size: 6G
"f /swapfile - - - - -"
];
# Custom service to allocate and format the swapfile early in boot
systemd.services.create-swapfile = {
description = "Create and enable /swapfile swap";
wants = [ "local-fs.target" ];
before = [ "swap.target" ];
path = [ pkgs.coreutils pkgs.util-linux pkgs.systemd ];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = "yes";
};
script = ''
set -e
# If swapfile already exists and is a swap, enable it
if swapon --show=NAME | grep -q '^/swapfile$'; then
exit 0
fi
# If file exists but not swap, remove it to recreate
if [ -f /swapfile ]; then
swapuuid=$(/sbin/blkid -o value -s UUID /swapfile 2>/dev/null || true)
if [ -n "$swapuui