diff --git a/modules/home/default.nix b/modules/home/default.nix index 9efec08..339ff28 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -16,7 +16,7 @@ ./jujutsu ./langs-common.nix ./aerospace - ./macos.nix + ./macos ./dank-material-shell ./niri ./nushell.nix diff --git a/modules/home/macos/US-Fixed.keylayout b/modules/home/macos/US-Fixed.keylayout new file mode 100644 index 0000000..615bb80 --- /dev/null +++ b/modules/home/macos/US-Fixed.keylayout @@ -0,0 +1,757 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/home/macos.nix b/modules/home/macos/default.nix similarity index 71% rename from modules/home/macos.nix rename to modules/home/macos/default.nix index b38d793..e6be92c 100644 --- a/modules/home/macos.nix +++ b/modules/home/macos/default.nix @@ -10,6 +10,29 @@ if macos.scrollReverser.package == null then macos.scrollReverser.appPath else "${macos.scrollReverser.package}/Applications/Scroll Reverser.app"; + + keybinds = let + mkBind = lib.concatStrings; + home = "\\UF729"; + end = "\\UF72B"; + bksp = "\\b"; + del = "\\UF728"; + ctrl = "^"; + shift = "$"; + in '' + { + "${mkBind [home]}" = "moveToBeginningOfLine:"; + "${mkBind [end]}" = "moveToEndOfLine:"; + "${mkBind [shift home]}" = "moveToBeginningOfLineAndModifySelection:"; + "${mkBind [shift end]}" = "moveToEndOfLineAndModifySelection:"; + "${mkBind [ctrl home]}" = "moveToBeginningOfDocument:"; + "${mkBind [ctrl end]}" = "moveToEndOfDocument:"; + "${mkBind [ctrl shift home]}" = "moveToBeginningOfDocumentAndModifySelection:"; + "${mkBind [ctrl shift end]}" = "moveToEndOfDocumentAndModifySelection:"; + "${mkBind [ctrl bksp]}" = "deleteWordBackward:"; + "${mkBind [ctrl del]}" = "deleteWordForward:"; + } + ''; in { options.modules.home.macos = { configure = lib.mkEnableOption "macOS-specific configuration"; @@ -50,6 +73,9 @@ in { } ]; + home.file."Library/KeyBindings/DefaultKeyBinding.dict".text = keybinds; + home.file."Library/Keyboard Layouts/US-Fixed.keylayout".source = ./US-Fixed.keylayout; + targets.darwin.defaults.NSGlobalDomain."com.apple.swipescrolldirection" = macos.touchpad.natural; targets.darwin.defaults."com.pilotmoon.scroll-reverser" = {