nix/darwin: remove hammerspoon; just use k-e

anirudh.fi 14404dce 7e4b07cd

verified
Changed files
+46 -72
darwin
hammerspoon
hosts
-24
darwin/hammerspoon/init.lua
··· 1 - local function pressFn(mods, key) 2 - if key == nil then 3 - key = mods 4 - mods = {} 5 - end 6 - 7 - return function() hs.eventtap.keyStroke(mods, key, 1000) end 8 - end 9 - 10 - local function remap(mods, key, pressFn) 11 - hs.hotkey.bind(mods, key, pressFn, nil, pressFn) 12 - end 13 - 14 - remap({'ctrl'}, 'd', pressFn('pagedown')) 15 - remap({'ctrl'}, 'u', pressFn('pageup')) 16 - 17 - remap({'ctrl', 'shift'}, 'd', pressFn({'shift'}, 'pagedown')) 18 - remap({'ctrl', 'shift'}, 'u', pressFn({'shift'}, 'pageup')) 19 - 20 - remap({'ctrl'}, 'y', pressFn('left')) 21 - remap({'ctrl'}, 'n', pressFn('down')) 22 - remap({'ctrl'}, 'e', pressFn('up')) 23 - remap({'ctrl'}, 'o', pressFn('right')) 24 -
-5
darwin/home.nix
··· 22 22 }; 23 23 }; 24 24 25 - home.file.".hammerspoon" = { 26 - source = ./hammerspoon; 27 - recursive = true; 28 - }; 29 - 30 25 home.packages = with pkgs; [ 31 26 # prompt 32 27 tmux
+34 -17
flake.lock
··· 55 55 "darwin": { 56 56 "inputs": { 57 57 "nixpkgs": [ 58 - "nixpkgs" 58 + "nixpkgs-stable" 59 59 ] 60 60 }, 61 61 "locked": { 62 - "lastModified": 1740755725, 63 - "narHash": "sha256-amZbqP84H/ApugaT+TADXTB3NbjkVHI9Vac1saIk0kE=", 62 + "lastModified": 1739553546, 63 + "narHash": "sha256-L4ou3xfOr17EAe836djRoQ7auVkYOREMtiQa82wVGqU=", 64 64 "owner": "lnl7", 65 65 "repo": "nix-darwin", 66 - "rev": "5d6e0851b60508cffd66b4a6982440a40720338d", 66 + "rev": "353846417f985e74fdc060555f17939e4472ea2c", 67 67 "type": "github" 68 68 }, 69 69 "original": { 70 70 "owner": "lnl7", 71 - "ref": "master", 71 + "ref": "nix-darwin-24.11", 72 72 "repo": "nix-darwin", 73 73 "type": "github" 74 74 } ··· 95 95 ] 96 96 }, 97 97 "locked": { 98 - "lastModified": 1740699498, 99 - "narHash": "sha256-r9hkKzX99CGiP1ZqH0e+SWKK4CMsRNRLyotuwrUjhTI=", 98 + "lastModified": 1740840901, 99 + "narHash": "sha256-nAHSkQJ2J5W8rGSReohh4xZ1b2edkG2UIj/4tF+ARAQ=", 100 100 "owner": "nix-community", 101 101 "repo": "home-manager", 102 - "rev": "b71edac7a3167026aabea82a54d08b1794088c21", 102 + "rev": "30da4310935450ea38931abf775ffe1dfab15355", 103 103 "type": "github" 104 104 }, 105 105 "original": { ··· 148 148 }, 149 149 "nixpkgs": { 150 150 "locked": { 151 - "lastModified": 1740560979, 152 - "narHash": "sha256-Vr3Qi346M+8CjedtbyUevIGDZW8LcA1fTG0ugPY/Hic=", 151 + "lastModified": 1740695751, 152 + "narHash": "sha256-D+R+kFxy1KsheiIzkkx/6L63wEHBYX21OIwlFV8JvDs=", 153 153 "owner": "NixOS", 154 154 "repo": "nixpkgs", 155 - "rev": "5135c59491985879812717f4c9fea69604e7f26f", 155 + "rev": "6313551cd05425cd5b3e63fe47dbc324eabb15e4", 156 156 "type": "github" 157 157 }, 158 158 "original": { ··· 164 164 }, 165 165 "nixpkgs-master": { 166 166 "locked": { 167 - "lastModified": 1740777173, 168 - "narHash": "sha256-ARRPHieKOjlLigLL9/dYjoRv7Q9QLfgO7aPoq23Rgfo=", 167 + "lastModified": 1740840931, 168 + "narHash": "sha256-fSrHXYG8QOfMOQWnUvGe9xHm1U22uuRDkIBhJn05n8c=", 169 169 "owner": "NixOS", 170 170 "repo": "nixpkgs", 171 - "rev": "58af30abcdaa77eca425cac83b7e544e7502bf81", 171 + "rev": "05ed073ffc3e8c56b266fbbb9328f168ee235500", 172 172 "type": "github" 173 173 }, 174 174 "original": { ··· 178 178 "type": "github" 179 179 } 180 180 }, 181 + "nixpkgs-stable": { 182 + "locked": { 183 + "lastModified": 1740743217, 184 + "narHash": "sha256-brsCRzLqimpyhORma84c3W2xPbIidZlIc3JGIuQVSNI=", 185 + "owner": "NixOS", 186 + "repo": "nixpkgs", 187 + "rev": "b27ba4eb322d9d2bf2dc9ada9fd59442f50c8d7c", 188 + "type": "github" 189 + }, 190 + "original": { 191 + "owner": "NixOS", 192 + "ref": "nixos-24.11", 193 + "repo": "nixpkgs", 194 + "type": "github" 195 + } 196 + }, 181 197 "prompt": { 182 198 "inputs": { 183 199 "nixpkgs": [ ··· 207 223 "nixos-hardware": "nixos-hardware", 208 224 "nixpkgs": "nixpkgs", 209 225 "nixpkgs-master": "nixpkgs-master", 226 + "nixpkgs-stable": "nixpkgs-stable", 210 227 "prompt": "prompt", 211 228 "zed": "zed" 212 229 } ··· 257 274 "rust-overlay": "rust-overlay" 258 275 }, 259 276 "locked": { 260 - "lastModified": 1740776523, 261 - "narHash": "sha256-+47hkKLL5jntUmManU364Gd2lv3JzVoZc/Z8xFoOfBg=", 277 + "lastModified": 1740840190, 278 + "narHash": "sha256-J+nTPUGQSSq+ZHEtDhVy6gBK7DGdBenJUlHyD0sijzI=", 262 279 "owner": "zed-industries", 263 280 "repo": "zed", 264 - "rev": "71866d6314674819a0e42df53a4c39f050639720", 281 + "rev": "d115cb194401e56c1078613bcd11b4ccdab3a185", 265 282 "type": "github" 266 283 }, 267 284 "original": {
+4 -2
flake.nix
··· 3 3 4 4 inputs = { 5 5 nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; 6 + nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.11"; 6 7 nixpkgs-master.url = "github:NixOS/nixpkgs/master"; 8 + 7 9 8 10 nixos-hardware.url = "github:nixos/nixos-hardware"; 9 11 ··· 13 15 }; 14 16 15 17 darwin = { 16 - url = "github:lnl7/nix-darwin/master"; 17 - inputs.nixpkgs.follows = "nixpkgs"; 18 + url = "github:lnl7/nix-darwin/nix-darwin-24.11"; 19 + inputs.nixpkgs.follows = "nixpkgs-stable"; 18 20 }; 19 21 20 22 prompt = {
+8 -24
hosts/kvothe/configuration.nix
··· 16 16 }; 17 17 18 18 environment = { 19 + variables = { 20 + EDITOR = "nvim"; 21 + }; 19 22 shells = [ pkgs.bash ]; 20 23 }; 21 24 ··· 39 42 ]; 40 43 }; 41 44 42 - nix.enable = false; 43 - 44 - security.pam.services.sudo_local.touchIdAuth = true; 45 + # security.pam.services.sudo_local.touchIdAuth = true; 45 46 46 47 system = { 47 48 activationScripts.applications.text = pkgs.lib.mkForce ( 48 - # '' 49 - # echo "setting up ~/Applications..." >&2 50 - # rm -rf ~/Applications/Nix\ Apps 51 - # mkdir -p ~/Applications/Nix\ Apps 52 - # for app in $(find ${config.system.build.applications}/Applications -maxdepth 1 -type l); do 53 - # src="$(/usr/bin/stat -f%Y "$app")" 54 - # cp -r "$src" ~/Applications/Nix\ Apps 55 - # done 56 - # '' 57 - 58 49 '' 59 50 echo "setting up /Applications..." >&2 60 51 rm -rf /Applications/Nix\ Apps ··· 74 65 '' 75 66 ); 76 67 77 - 78 - keyboard = { 79 - enableKeyMapping = true; 80 - userKeyMapping = [ 81 - { 82 - HIDKeyboardModifierMappingSrc = 30064771129; 83 - HIDKeyboardModifierMappingDst = 30064771181; 84 - } 85 - ]; 68 + defaults = { 69 + screencapture.location = "/Users/icy/Pictures/Screenshots"; 86 70 }; 87 71 88 - stateVersion = 6; 72 + stateVersion = 5; 89 73 }; 90 74 91 75 homebrew = { ··· 95 79 cleanup = "uninstall"; 96 80 upgrade = true; 97 81 }; 98 - casks = [ "orion" ]; 82 + casks = [ "orion" "karabiner-elements" ]; 99 83 }; 100 84 }