Nix configurations for my personal machines (Linux & macOS)

karabiner: add conditions for rules

ovyerus.com 178ca29c cd692190

verified
Changed files
+32 -3
files
modules
+26 -2
files/karabiner/meh.json files/karabiner/keybind-helpers.json
···
{
-
"title": "Backspace → Meh (⌃⌥⇧) Z",
"rules": [
{
"description": "Caps Lock to Backspace",
"manipulators": [
{
"from": {
"key_code": "caps_lock",
"modifiers": {
···
"description": "Backspace → Meh (⌃⌥⇧) Z",
"manipulators": [
{
"from": {
"key_code": "delete_or_backspace",
"modifiers": {
···
]
}
]
-
}
···
{
+
"title": "Colemak & Keybind Helpers",
"rules": [
{
"description": "Caps Lock to Backspace",
"manipulators": [
{
+
"conditions": [
+
{
+
"type": "device_if",
+
"identifiers": [
+
{
+
"description": "MacBook internal keyboard",
+
"vendor_id": 1452,
+
"product_id": 641
+
}
+
]
+
}
+
],
"from": {
"key_code": "caps_lock",
"modifiers": {
···
"description": "Backspace → Meh (⌃⌥⇧) Z",
"manipulators": [
{
+
"conditions": [
+
{
+
"type": "device_if",
+
"identifiers": [
+
{
+
"description": "MacBook internal keyboard",
+
"vendor_id": 1452,
+
"product_id": 641
+
}
+
]
+
}
+
],
"from": {
"key_code": "delete_or_backspace",
"modifiers": {
···
]
}
]
+
}
+4
flake.nix
···
system = "aarch64-darwin";
pkgs = nixpkgs.legacyPackages.${system};
in {
homeConfigurations."ovy" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
···
system = "aarch64-darwin";
pkgs = nixpkgs.legacyPackages.${system};
in {
+
# TODO: options to have
+
# desktop - target is desktop environment, include gui apps and stuff (os-specific stuff limited behind system)
+
# minimal - mostly just shell utils only
+
homeConfigurations."ovy" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
+2 -1
modules/config.nix
···
...
}: {
xdg.configFile = {
-
"karabiner/assets/complex_modifications/meh.json".source = ../files/karabiner/meh.json;
};
}
···
...
}: {
xdg.configFile = {
+
# TODO: replace with the full karabiner config instead of needing to manually set complex mods
+
"karabiner/assets/complex_modifications/keybind-helpers.json".source = ../files/karabiner/keybind-helpers.json;
};
}