From 5a9932ad9414abeff6f3ff0bc7903b49ba983e9e Mon Sep 17 00:00:00 2001 From: xenia Date: Sun, 23 Jun 2024 22:46:52 +0200 Subject: [PATCH] Bring fox keyboard layout from upstream, remove rachel dependency. Split fox layout into one file for symbols, one for types, switch alt and alt-gr --- flake.lock | 233 +------------------------------- flake.nix | 8 +- nixos/graphical.nix | 4 +- nixos/kblayouts/fox-symbols.xkb | 55 ++++++++ nixos/kblayouts/fox-types.xkb | 16 +++ 5 files changed, 79 insertions(+), 237 deletions(-) create mode 100644 nixos/kblayouts/fox-symbols.xkb create mode 100644 nixos/kblayouts/fox-types.xkb diff --git a/flake.lock b/flake.lock index 202f1701..0d8f9ad2 100644 --- a/flake.lock +++ b/flake.lock @@ -1,28 +1,5 @@ { "nodes": { - "agda": { - "inputs": { - "flake-utils": "flake-utils_6", - "nixpkgs": [ - "rachel", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1701366566, - "narHash": "sha256-B8Jmjld0gGbkVO08GsovVqrUXCs8VfJ8UdM3sjHnzgM=", - "owner": "agda", - "repo": "agda", - "rev": "4293e0a94d15acac915ab9088b2ec028f78d14a9", - "type": "github" - }, - "original": { - "owner": "agda", - "ref": "v2.6.4.1", - "repo": "agda", - "type": "github" - } - }, "ansi-utils": { "inputs": { "flake-utils": "flake-utils", @@ -44,45 +21,6 @@ "url": "https://git@githug.xyz/xenia/ansi-utils" } }, - "cornelis": { - "inputs": { - "flake-compat": "flake-compat", - "flake-utils": "flake-utils_7", - "nixpkgs": [ - "rachel", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1712595875, - "narHash": "sha256-KaAhKeESwOQ0R0vxeAO/CDPiPimiemoARyr0uIVTQ4w=", - "owner": "isovector", - "repo": "cornelis", - "rev": "9d3347e7d8589a28bcdd283001367d60bacf6b05", - "type": "github" - }, - "original": { - "owner": "isovector", - "repo": "cornelis", - "type": "github" - } - }, - "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1696426674, - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, "flake-utils": { "inputs": { "systems": "systems" @@ -174,42 +112,9 @@ } }, "flake-utils_6": { - "locked": { - "lastModified": 1678901627, - "narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_7": { "inputs": { "systems": "systems_6" }, - "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_8": { - "inputs": { - "systems": "systems_7" - }, "locked": { "lastModified": 1694529238, "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", @@ -224,9 +129,9 @@ "type": "github" } }, - "flake-utils_9": { + "flake-utils_7": { "inputs": { - "systems": "systems_8" + "systems": "systems_7" }, "locked": { "lastModified": 1694529238, @@ -263,28 +168,6 @@ "type": "github" } }, - "home-manager_2": { - "inputs": { - "nixpkgs": [ - "rachel", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1712386041, - "narHash": "sha256-dA82pOMQNnCJMAsPG7AXG35VmCSMZsJHTFlTHizpKWQ=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "d6bb9f934f2870e5cbc5b94c79e9db22246141ff", - "type": "github" - }, - "original": { - "owner": "nix-community", - "ref": "release-23.11", - "repo": "home-manager", - "type": "github" - } - }, "kak": { "inputs": { "flake-utils": "flake-utils_2", @@ -365,22 +248,6 @@ "type": "github" } }, - "nixpkgs-unstable": { - "locked": { - "lastModified": 1713297878, - "narHash": "sha256-hOkzkhLT59wR8VaMbh1ESjtZLbGi+XNaBN6h49SPqEc=", - "owner": "NixOs", - "repo": "nixpkgs", - "rev": "66adc1e47f8784803f2deb6cacd5e07264ec2d5c", - "type": "github" - }, - "original": { - "owner": "NixOs", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "nixpkgs_2": { "locked": { "lastModified": 1697009197, @@ -411,47 +278,6 @@ "type": "github" } }, - "nixpkgs_4": { - "locked": { - "lastModified": 1711703276, - "narHash": "sha256-iMUFArF0WCatKK6RzfUJknjem0H9m4KgorO/p3Dopkk=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "d8fe5e6c92d0d190646fb9f1056741a229980089", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "rachel": { - "inputs": { - "agda": "agda", - "cornelis": "cornelis", - "home-manager": "home-manager_2", - "nixpkgs": [ - "nixpkgs" - ], - "nixpkgs-unstable": "nixpkgs-unstable", - "ssbm-nix": "ssbm-nix" - }, - "locked": { - "lastModified": 1717095319, - "narHash": "sha256-CdOAT2MhNtxLf0Ki4d/mT9jQQZaIOfrCBZXHwJRgWYg=", - "ref": "refs/heads/master", - "rev": "7f19d4efe9fc7977b85a1f51b396e63ff8102b87", - "revCount": 137, - "type": "git", - "url": "https://git@githug.xyz/rachel/nixos-config" - }, - "original": { - "type": "git", - "url": "https://git@githug.xyz/rachel/nixos-config" - } - }, "root": { "inputs": { "ansi-utils": "ansi-utils", @@ -460,7 +286,6 @@ "kak-tree": "kak-tree", "nix-darwin": "nix-darwin", "nixpkgs": "nixpkgs_3", - "rachel": "rachel", "unambig-path": "unambig-path", "unispect": "unispect" } @@ -484,41 +309,6 @@ "type": "github" } }, - "slippi-desktop": { - "flake": false, - "locked": { - "lastModified": 1711346593, - "narHash": "sha256-WWgGRT58w1a4UcEe924hqa4ZVodQtsbXC44aCOEj528=", - "owner": "project-slippi", - "repo": "slippi-desktop-app", - "rev": "02f3f007cd03c6e2b0da57db65c90646efc04a86", - "type": "github" - }, - "original": { - "owner": "project-slippi", - "repo": "slippi-desktop-app", - "type": "github" - } - }, - "ssbm-nix": { - "inputs": { - "nixpkgs": "nixpkgs_4", - "slippi-desktop": "slippi-desktop" - }, - "locked": { - "lastModified": 1712071998, - "narHash": "sha256-k95NCkXJ61PGMFuqyMtfvP3yTLozED/7DkN+lBWK0gs=", - "owner": "lytedev", - "repo": "ssbm-nix", - "rev": "eff966a97287d1d86b189d59a14bf744d86836b0", - "type": "github" - }, - "original": { - "owner": "lytedev", - "repo": "ssbm-nix", - "type": "github" - } - }, "systems": { "locked": { "lastModified": 1681028828, @@ -624,21 +414,6 @@ "type": "github" } }, - "systems_8": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "tree-sitters": { "inputs": { "flake-utils": "flake-utils_5", @@ -660,7 +435,7 @@ }, "unambig-path": { "inputs": { - "flake-utils": "flake-utils_8", + "flake-utils": "flake-utils_6", "nixpkgs": [ "nixpkgs" ] @@ -681,7 +456,7 @@ }, "unispect": { "inputs": { - "flake-utils": "flake-utils_9", + "flake-utils": "flake-utils_7", "nixpkgs": [ "nixpkgs" ] diff --git a/flake.nix b/flake.nix index 6816e099..0267ed87 100644 --- a/flake.nix +++ b/flake.nix @@ -33,13 +33,9 @@ url = "git+https://git@githug.xyz/xenia/unambig-path"; inputs.nixpkgs.follows = "nixpkgs"; }; - rachel = { - url = "git+https://git@githug.xyz/rachel/nixos-config"; - inputs.nixpkgs.follows = "nixpkgs"; - }; }; - outputs = { self, nixpkgs, home-manager, nix-darwin, kak, kak-tree, unispect, ansi-utils, unambig-path, rachel }: + outputs = { self, nixpkgs, home-manager, nix-darwin, kak, kak-tree, unispect, ansi-utils, unambig-path }: let xdg-runtime-dir = "/tmp/xdg-rt"; @@ -66,7 +62,7 @@ }; mkNixOsBase = opts: import ./nixos/base.nix (opts // { nixpkgs-flake = nixpkgs; }); - mkNixOsGraphical = opts: import ./nixos/graphical.nix (opts // { fox-layout = rachel.keyboardLayouts.fox; }); + mkNixOsGraphical = opts: import ./nixos/graphical.nix opts; mkNixOsNetworking = opts: import ./nixos/networking.nix opts; in { homeConfigurations."xenia@Joe-Bidens-MacBook-Pro" = diff --git a/nixos/graphical.nix b/nixos/graphical.nix index 685622ce..d22c2057 100644 --- a/nixos/graphical.nix +++ b/nixos/graphical.nix @@ -1,6 +1,5 @@ { pkgs, - fox-layout, background-image ? "pan-wire-3.png", ... }: @@ -29,7 +28,8 @@ extraLayouts.fox = { description = "Layout suitable to be used by a fox"; languages = ["se"]; - symbolsFile = fox-layout; + symbolsFile = ./kblayouts/fox-symbols.xkb; + typesFile = ./kblayouts/fox-types.xkb; }; }; }; diff --git a/nixos/kblayouts/fox-symbols.xkb b/nixos/kblayouts/fox-symbols.xkb new file mode 100644 index 00000000..db3aac22 --- /dev/null +++ b/nixos/kblayouts/fox-symbols.xkb @@ -0,0 +1,55 @@ +xkb_symbols "fox" { + key {[ U1F408, U1F431, U1F408, U1F431 ]}; + key {[ 1, ampersand, VoidSymbol, VoidSymbol ]}; + key {[ 2, quotedbl, at, VoidSymbol ]}; + key {[ 3, numbersign, VoidSymbol, VoidSymbol ]}; + key {[ 4, dollar, VoidSymbol, VoidSymbol ]}; + key {[ 5, percent, infinity, VoidSymbol ]}; + key {[ 6, asciitilde, VoidSymbol, VoidSymbol ]}; + key {[ 7, notsign, U21D0, because ]}; + key {[ 8, U1F449, ifonlyif, U1F97A ]}; + key {[ 9, U1F448, implies, therefore ]}; + key {[ 0, equal, notequal, approximate ]}; + key {[ plus, asterisk, asciicircum, underscore ]}; + key {[ minus, slash, bar, backslash ]}; + + key {[ aring, Aring, U1F4EE, Sinh_ng2 ]}; + key {[ odiaeresis, Odiaeresis, VoidSymbol, VoidSymbol ]}; + key {[ adiaeresis, Adiaeresis, VoidSymbol, VoidSymbol ]}; + key {[ p, P, VoidSymbol, VoidSymbol ]}; + key {[ y, Y, VoidSymbol, VoidSymbol ]}; + key {[ f, F, VoidSymbol, VoidSymbol ]}; + key {[ g, G, VoidSymbol, VoidSymbol ]}; + key {[ c, C, VoidSymbol, VoidSymbol ]}; + key {[ r, R, VoidSymbol, VoidSymbol ]}; + key {[ l, L, VoidSymbol, VoidSymbol ]}; + key {[ parenleft, less, bracketleft, braceleft ]}; + key {[ parenright, greater, bracketright, braceright ]}; + + key {[ a, A, VoidSymbol, VoidSymbol ]}; + key {[ o, O, VoidSymbol, VoidSymbol ]}; + key {[ e, E, VoidSymbol, VoidSymbol ]}; + key {[ u, U, VoidSymbol, VoidSymbol ]}; + key {[ i, I, VoidSymbol, VoidSymbol ]}; + key {[ d, D, VoidSymbol, VoidSymbol ]}; + key {[ h, H, VoidSymbol, VoidSymbol ]}; + key {[ t, T, VoidSymbol, VoidSymbol ]}; + key {[ n, N, VoidSymbol, VoidSymbol ]}; + key {[ s, S, VoidSymbol, VoidSymbol ]}; + key {[ exclam, question, exclamdown, questiondown ]}; + key {[ apostrophe, grave, emdash, VoidSymbol ]}; + + key {[ comma, semicolon, VoidSymbol, VoidSymbol ]}; + key {[ period, colon, comma, semicolon ]}; + key {[ q, Q, VoidSymbol, VoidSymbol ]}; + key {[ j, J, VoidSymbol, VoidSymbol ]}; + key {[ k, K, VoidSymbol, VoidSymbol ]}; + key {[ x, X, VoidSymbol, VoidSymbol ]}; + key {[ b, B, VoidSymbol, VoidSymbol ]}; + key {[ m, M, VoidSymbol, VoidSymbol ]}; + key {[ w, W, VoidSymbol, VoidSymbol ]}; + key {[ v, V, VoidSymbol, VoidSymbol ]}; + key {[ z, Z, VoidSymbol, VoidSymbol ]}; + + key {[ space, space, space, space ]}; +}; diff --git a/nixos/kblayouts/fox-types.xkb b/nixos/kblayouts/fox-types.xkb new file mode 100644 index 00000000..61bb0b43 --- /dev/null +++ b/nixos/kblayouts/fox-types.xkb @@ -0,0 +1,16 @@ +xkb_types "noaltgr" { + virtual_modifiers Shift, Alt; + + type "CTRL+ALT" { + modifiers = Shift + Alt; + map[None] = Level1; + map[Shift] = Level2; + map[Alt] = Level3; + map[Shift+Alt] = Level4; + level_name[Level1] = "Base"; + level_name[Level2] = "Shift"; + level_name[Level3] = "Alt"; + level_name[Level4] = "Shift Alt"; + }; +}; +