From 984e56ba678a2878f884576229c9af6037b87a5f Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Mon, 26 Oct 2020 23:43:18 -0500 Subject: [PATCH] Setup laptop hibernation and nix dotfiles alias --- apps/shell/fish/aliases.fish | 1 + env/nix/machines/third.nix | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/apps/shell/fish/aliases.fish b/apps/shell/fish/aliases.fish index eaa0899..9730e6b 100755 --- a/apps/shell/fish/aliases.fish +++ b/apps/shell/fish/aliases.fish @@ -77,6 +77,7 @@ alias cdc "d $XDG_CONFIG_HOME" # go to ~/.config alias cdn "d $NOTES_PATH" alias cdl "d $NICE_HOME/dl" alias cdg "d $NICE_HOME/games" +alias cdnx "d $DOTFILES_PATH/env/nix" # quick parent-directory aliases alias .. "d .." diff --git a/env/nix/machines/third.nix b/env/nix/machines/third.nix index f0e614c..4698cbd 100644 --- a/env/nix/machines/third.nix +++ b/env/nix/machines/third.nix @@ -31,6 +31,16 @@ xft-dpi=260 ''; + swapDevices = [ { device = "/swapfile"; size = (1024*16); } ]; + + boot = { + # fallocate -l 16G /swapfile + resumeDevice = "/dev/disk/by-uuid/d1d92974-c0c0-4566-8131-c3dda9b21122"; + # sudo filefrag -v /swapfile | head -n 4 | tail -n 1 | \ + # tr -s "[:blank:]" | field 5 | tr -d ":" + kernelParams = [ "resume_offset=874496" ]; + }; + # services.upower = { # enable = true; # criticalPowerAction = "Hibernate";