From 17841a26a5976ed49112f32fe3e5087f9be8184b Mon Sep 17 00:00:00 2001 From: Jonas Hahn Date: Thu, 20 Nov 2025 20:48:23 +0100 Subject: [PATCH] First test --- flake.lock | 670 +----------------------------------- flake.nix | 10 +- modules/hardware/config.kbd | 0 modules/hardware/xremap.nix | 38 +- 4 files changed, 26 insertions(+), 692 deletions(-) create mode 100644 modules/hardware/config.kbd diff --git a/flake.lock b/flake.lock index c41ab98..824280f 100644 --- a/flake.lock +++ b/flake.lock @@ -1,132 +1,5 @@ { "nodes": { - "aquamarine": { - "inputs": { - "hyprutils": [ - "xremap-flake", - "hyprland", - "hyprutils" - ], - "hyprwayland-scanner": [ - "xremap-flake", - "hyprland", - "hyprwayland-scanner" - ], - "nixpkgs": [ - "xremap-flake", - "hyprland", - "nixpkgs" - ], - "systems": [ - "xremap-flake", - "hyprland", - "systems" - ] - }, - "locked": { - "lastModified": 1751740947, - "narHash": "sha256-35040CHH7P3JGmhGVfEb2oJHL/A5mI2IXumhkxrBnao=", - "owner": "hyprwm", - "repo": "aquamarine", - "rev": "dfc1db15a08c4cd234288f66e1199c653495301f", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "aquamarine", - "type": "github" - } - }, - "crane": { - "locked": { - "lastModified": 1751562746, - "narHash": "sha256-smpugNIkmDeicNz301Ll1bD7nFOty97T79m4GUMUczA=", - "owner": "ipetkov", - "repo": "crane", - "rev": "aed2020fd3dc26e1e857d4107a5a67a33ab6c1fd", - "type": "github" - }, - "original": { - "owner": "ipetkov", - "repo": "crane", - "type": "github" - } - }, - "devshell": { - "inputs": { - "nixpkgs": "nixpkgs_2" - }, - "locked": { - "lastModified": 1741473158, - "narHash": "sha256-kWNaq6wQUbUMlPgw8Y+9/9wP0F8SHkjy24/mN3UAppg=", - "owner": "numtide", - "repo": "devshell", - "rev": "7c9e793ebe66bcba8292989a68c0419b737a22a0", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "devshell", - "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-parts": { - "inputs": { - "nixpkgs-lib": "nixpkgs-lib" - }, - "locked": { - "lastModified": 1751413152, - "narHash": "sha256-Tyw1RjYEsp5scoigs1384gIg6e0GoBVjms4aXFfRssQ=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "77826244401ea9de6e3bac47c2db46005e1f30b5", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, - "gitignore": { - "inputs": { - "nixpkgs": [ - "xremap-flake", - "hyprland", - "pre-commit-hooks", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1709087332, - "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", - "owner": "hercules-ci", - "repo": "gitignore.nix", - "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "gitignore.nix", - "type": "github" - } - }, "home-manager": { "inputs": { "nixpkgs": [ @@ -148,302 +21,25 @@ "type": "github" } }, - "home-manager_2": { + "kmonad": { "inputs": { - "nixpkgs": "nixpkgs_3" - }, - "locked": { - "lastModified": 1751990210, - "narHash": "sha256-krWErNDl9ggMLSfK00Q2BcoSk3+IRTSON/DiDgUzzMw=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "218da00bfa73f2a61682417efe74549416c16ba6", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "home-manager", - "type": "github" - } - }, - "hyprcursor": { - "inputs": { - "hyprlang": [ - "xremap-flake", - "hyprland", - "hyprlang" - ], "nixpkgs": [ - "xremap-flake", - "hyprland", "nixpkgs" - ], - "systems": [ - "xremap-flake", - "hyprland", - "systems" ] }, "locked": { - "lastModified": 1749155331, - "narHash": "sha256-XR9fsI0zwLiFWfqi/pdS/VD+YNorKb3XIykgTg4l1nA=", - "owner": "hyprwm", - "repo": "hyprcursor", - "rev": "45fcc10b4c282746d93ec406a740c43b48b4ef80", + "dir": "nix", + "lastModified": 1762117835, + "narHash": "sha256-1xcZ4TJWNnDo8yxrHVUZKv3V1fBWC383+HjPPeBAUf8=", + "owner": "kmonad", + "repo": "kmonad", + "rev": "52050528a1e45b3732ff476d1de1bef72e637a23", "type": "github" }, "original": { - "owner": "hyprwm", - "repo": "hyprcursor", - "type": "github" - } - }, - "hyprgraphics": { - "inputs": { - "hyprutils": [ - "xremap-flake", - "hyprland", - "hyprutils" - ], - "nixpkgs": [ - "xremap-flake", - "hyprland", - "nixpkgs" - ], - "systems": [ - "xremap-flake", - "hyprland", - "systems" - ] - }, - "locked": { - "lastModified": 1751808145, - "narHash": "sha256-OXgL0XaKMmfX2rRQkt9SkJw+QNfv0jExlySt1D6O72g=", - "owner": "hyprwm", - "repo": "hyprgraphics", - "rev": "b841473a0bd4a1a74a0b64f1ec2ab199035c349f", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprgraphics", - "type": "github" - } - }, - "hyprland": { - "inputs": { - "aquamarine": "aquamarine", - "hyprcursor": "hyprcursor", - "hyprgraphics": "hyprgraphics", - "hyprland-protocols": "hyprland-protocols", - "hyprland-qtutils": "hyprland-qtutils", - "hyprlang": "hyprlang", - "hyprutils": "hyprutils", - "hyprwayland-scanner": "hyprwayland-scanner", - "nixpkgs": "nixpkgs_4", - "pre-commit-hooks": "pre-commit-hooks", - "systems": "systems", - "xdph": "xdph" - }, - "locked": { - "lastModified": 1751995875, - "narHash": "sha256-ud9sl1RjmzAzalH2ocmGPs182xvr7GktjVIYvzJamwo=", - "owner": "hyprwm", - "repo": "Hyprland", - "rev": "9517d0eaa4ef93de67dc80fecca7a826f7ad556d", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "Hyprland", - "type": "github" - } - }, - "hyprland-protocols": { - "inputs": { - "nixpkgs": [ - "xremap-flake", - "hyprland", - "nixpkgs" - ], - "systems": [ - "xremap-flake", - "hyprland", - "systems" - ] - }, - "locked": { - "lastModified": 1749046714, - "narHash": "sha256-kymV5FMnddYGI+UjwIw8ceDjdeg7ToDVjbHCvUlhn14=", - "owner": "hyprwm", - "repo": "hyprland-protocols", - "rev": "613878cb6f459c5e323aaafe1e6f388ac8a36330", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprland-protocols", - "type": "github" - } - }, - "hyprland-qt-support": { - "inputs": { - "hyprlang": [ - "xremap-flake", - "hyprland", - "hyprland-qtutils", - "hyprlang" - ], - "nixpkgs": [ - "xremap-flake", - "hyprland", - "hyprland-qtutils", - "nixpkgs" - ], - "systems": [ - "xremap-flake", - "hyprland", - "hyprland-qtutils", - "systems" - ] - }, - "locked": { - "lastModified": 1749154592, - "narHash": "sha256-DO7z5CeT/ddSGDEnK9mAXm1qlGL47L3VAHLlLXoCjhE=", - "owner": "hyprwm", - "repo": "hyprland-qt-support", - "rev": "4c8053c3c888138a30c3a6c45c2e45f5484f2074", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprland-qt-support", - "type": "github" - } - }, - "hyprland-qtutils": { - "inputs": { - "hyprland-qt-support": "hyprland-qt-support", - "hyprlang": [ - "xremap-flake", - "hyprland", - "hyprlang" - ], - "hyprutils": [ - "xremap-flake", - "hyprland", - "hyprland-qtutils", - "hyprlang", - "hyprutils" - ], - "nixpkgs": [ - "xremap-flake", - "hyprland", - "nixpkgs" - ], - "systems": [ - "xremap-flake", - "hyprland", - "systems" - ] - }, - "locked": { - "lastModified": 1750371812, - "narHash": "sha256-D868K1dVEACw17elVxRgXC6hOxY+54wIEjURztDWLk8=", - "owner": "hyprwm", - "repo": "hyprland-qtutils", - "rev": "b13c7481e37856f322177010bdf75fccacd1adc8", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprland-qtutils", - "type": "github" - } - }, - "hyprlang": { - "inputs": { - "hyprutils": [ - "xremap-flake", - "hyprland", - "hyprutils" - ], - "nixpkgs": [ - "xremap-flake", - "hyprland", - "nixpkgs" - ], - "systems": [ - "xremap-flake", - "hyprland", - "systems" - ] - }, - "locked": { - "lastModified": 1750371198, - "narHash": "sha256-/iuJ1paQOBoSLqHflRNNGyroqfF/yvPNurxzcCT0cAE=", - "owner": "hyprwm", - "repo": "hyprlang", - "rev": "cee01452bca58d6cadb3224e21e370de8bc20f0b", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprlang", - "type": "github" - } - }, - "hyprutils": { - "inputs": { - "nixpkgs": [ - "xremap-flake", - "hyprland", - "nixpkgs" - ], - "systems": [ - "xremap-flake", - "hyprland", - "systems" - ] - }, - "locked": { - "lastModified": 1751888065, - "narHash": "sha256-F2SV9WGqgtRsXIdUrl3sRe0wXlQD+kRRZcSfbepjPJY=", - "owner": "hyprwm", - "repo": "hyprutils", - "rev": "a8229739cf36d159001cfc203871917b83fdf917", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprutils", - "type": "github" - } - }, - "hyprwayland-scanner": { - "inputs": { - "nixpkgs": [ - "xremap-flake", - "hyprland", - "nixpkgs" - ], - "systems": [ - "xremap-flake", - "hyprland", - "systems" - ] - }, - "locked": { - "lastModified": 1751881472, - "narHash": "sha256-meB0SnXbwIe2trD041MLKEv6R7NZ759QwBcVIhlSBfE=", - "owner": "hyprwm", - "repo": "hyprwayland-scanner", - "rev": "8fb426b3e5452fd9169453fd6c10f8c14ca37120", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprwayland-scanner", + "dir": "nix", + "owner": "kmonad", + "repo": "kmonad", "type": "github" } }, @@ -462,21 +58,6 @@ "type": "indirect" } }, - "nixpkgs-lib": { - "locked": { - "lastModified": 1751159883, - "narHash": "sha256-urW/Ylk9FIfvXfliA1ywh75yszAbiTEVgpPeinFyVZo=", - "owner": "nix-community", - "repo": "nixpkgs.lib", - "rev": "14a40a1d7fb9afa4739275ac642ed7301a9ba1ab", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nixpkgs.lib", - "type": "github" - } - }, "nixpkgs-unstable": { "locked": { "lastModified": 1760284886, @@ -492,117 +73,13 @@ "type": "indirect" } }, - "nixpkgs_2": { - "locked": { - "lastModified": 1722073938, - "narHash": "sha256-OpX0StkL8vpXyWOGUD6G+MA26wAXK6SpT94kLJXo6B4=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "e36e9f57337d0ff0cf77aceb58af4c805472bfae", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_3": { - "locked": { - "lastModified": 1751637120, - "narHash": "sha256-xVNy/XopSfIG9c46nRmPaKfH1Gn/56vQ8++xWA8itO4=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "5c724ed1388e53cc231ed98330a60eb2f7be4be3", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_4": { - "locked": { - "lastModified": 1751792365, - "narHash": "sha256-J1kI6oAj25IG4EdVlg2hQz8NZTBNYvIS0l4wpr9KcUo=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "1fd8bada0b6117e6c7eb54aad5813023eed37ccb", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_5": { - "locked": { - "lastModified": 1751949589, - "narHash": "sha256-mgFxAPLWw0Kq+C8P3dRrZrOYEQXOtKuYVlo9xvPntt8=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "9b008d60392981ad674e04016d25619281550a9d", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_6": { - "locked": { - "lastModified": 1747958103, - "narHash": "sha256-qmmFCrfBwSHoWw7cVK4Aj+fns+c54EBP8cGqp/yK410=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "fe51d34885f7b5e3e7b59572796e1bcb427eccb1", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "pre-commit-hooks": { - "inputs": { - "flake-compat": "flake-compat", - "gitignore": "gitignore", - "nixpkgs": [ - "xremap-flake", - "hyprland", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1750779888, - "narHash": "sha256-wibppH3g/E2lxU43ZQHC5yA/7kIKLGxVEnsnVK1BtRg=", - "owner": "cachix", - "repo": "git-hooks.nix", - "rev": "16ec914f6fb6f599ce988427d9d94efddf25fe6d", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "git-hooks.nix", - "type": "github" - } - }, "root": { "inputs": { "home-manager": "home-manager", + "kmonad": "kmonad", "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable", - "sops-nix": "sops-nix", - "xremap-flake": "xremap-flake" + "sops-nix": "sops-nix" } }, "sops-nix": { @@ -624,129 +101,6 @@ "repo": "sops-nix", "type": "github" } - }, - "systems": { - "locked": { - "lastModified": 1689347949, - "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", - "owner": "nix-systems", - "repo": "default-linux", - "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default-linux", - "type": "github" - } - }, - "treefmt-nix": { - "inputs": { - "nixpkgs": "nixpkgs_6" - }, - "locked": { - "lastModified": 1750931469, - "narHash": "sha256-0IEdQB1nS+uViQw4k3VGUXntjkDp7aAlqcxdewb/hAc=", - "owner": "numtide", - "repo": "treefmt-nix", - "rev": "ac8e6f32e11e9c7f153823abc3ab007f2a65d3e1", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "treefmt-nix", - "type": "github" - } - }, - "xdph": { - "inputs": { - "hyprland-protocols": [ - "xremap-flake", - "hyprland", - "hyprland-protocols" - ], - "hyprlang": [ - "xremap-flake", - "hyprland", - "hyprlang" - ], - "hyprutils": [ - "xremap-flake", - "hyprland", - "hyprutils" - ], - "hyprwayland-scanner": [ - "xremap-flake", - "hyprland", - "hyprwayland-scanner" - ], - "nixpkgs": [ - "xremap-flake", - "hyprland", - "nixpkgs" - ], - "systems": [ - "xremap-flake", - "hyprland", - "systems" - ] - }, - "locked": { - "lastModified": 1751300244, - "narHash": "sha256-PFuv1TZVYvQhha0ac53E3YgdtmLShrN0t4T6xqHl0jE=", - "owner": "hyprwm", - "repo": "xdg-desktop-portal-hyprland", - "rev": "6115f3fdcb2c1a57b4a80a69f3c797e47607b90a", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "xdg-desktop-portal-hyprland", - "type": "github" - } - }, - "xremap": { - "flake": false, - "locked": { - "lastModified": 1752020210, - "narHash": "sha256-yRYffVAqSriU3AebfL1JFIKP9gUSTq5OC8CyyBTx9KQ=", - "owner": "k0kubun", - "repo": "xremap", - "rev": "a00d6ad9e7a180f6b641b8188f53a8c66ae8379a", - "type": "github" - }, - "original": { - "owner": "k0kubun", - "ref": "v0.10.13", - "repo": "xremap", - "type": "github" - } - }, - "xremap-flake": { - "inputs": { - "crane": "crane", - "devshell": "devshell", - "flake-parts": "flake-parts", - "home-manager": "home-manager_2", - "hyprland": "hyprland", - "nixpkgs": "nixpkgs_5", - "treefmt-nix": "treefmt-nix", - "xremap": "xremap" - }, - "locked": { - "lastModified": 1752027487, - "narHash": "sha256-240ngBRC7SbAwpWqbkZzHXwc3wA3U4fLPJwjRg8+Fqg=", - "owner": "xremap", - "repo": "nix-flake", - "rev": "8001f37b1ffe86e76b62f36afadee2f4acf90e70", - "type": "github" - }, - "original": { - "owner": "xremap", - "repo": "nix-flake", - "rev": "8001f37b1ffe86e76b62f36afadee2f4acf90e70", - "type": "github" - } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 2e5c05a..d428b7c 100644 --- a/flake.nix +++ b/flake.nix @@ -14,14 +14,15 @@ url = "github:nix-community/home-manager/release-25.05"; inputs.nixpkgs.follows = "nixpkgs"; }; - - xremap-flake.url = - "github:xremap/nix-flake?rev=8001f37b1ffe86e76b62f36afadee2f4acf90e70"; # One commit behind head + kmonad = { + url = "github:kmonad/kmonad?dir=nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; # Understand what everything does outputs = - { self, nixpkgs, nixpkgs-unstable, sops-nix, home-manager, ... }@inputs: + { self, nixpkgs, nixpkgs-unstable, sops-nix, home-manager, kmonad, ... }@inputs: let system = "x86_64-linux"; @@ -31,6 +32,7 @@ helperModules = [ ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; }) + kmonad.nixosModules.default home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; diff --git a/modules/hardware/config.kbd b/modules/hardware/config.kbd new file mode 100644 index 0000000..e69de29 diff --git a/modules/hardware/xremap.nix b/modules/hardware/xremap.nix index 6cccb12..348786b 100644 --- a/modules/hardware/xremap.nix +++ b/modules/hardware/xremap.nix @@ -1,37 +1,15 @@ { inputs, ... }: { - imports = [ inputs.xremap-flake.nixosModules.default ]; + imports = [ inputs.kmonad.nixosModules.default ]; - services.xremap = { - withHypr = true; - userName = "jonas"; - config = { - modmap = [ - { - name = "Capslock to esc and ctrl"; - remap = { - "CAPSLOCK" = { - "alone" = "ESC"; - "held" = "CTRL_L"; - }; - "ESC" = "CAPSLOCK"; - }; - } - { - name = "Switch super and alt"; - remap = { - "SUPER_L" = { - "alone" = "ALT_L"; - "held" = "ALT_L"; - }; - "ALT_L" = { - "alone" = "SUPER_L"; - "held" = "SUPER_L"; - }; - }; - } - ]; + services.kmonad = { + enable = true; + keyboards = { + myKMonadOutput = { + device = "/dev/input/by-id/usb-HyperX_Alloy_Elite_RGB_HyperX_Alloy_Elite_RGB-event-kbd"; + config = builtins.readFile ./config.kbd; + }; }; }; }