From 5570ab7cfc7a0c3c5b1b8999c1e95a5989de8a57 Mon Sep 17 00:00:00 2001 From: yunfachi Date: Sat, 16 Dec 2023 16:34:54 +0000 Subject: [PATCH] feat(home): add canary keyboard layout --- flake.lock | 6 +++--- home/hyprland/default.nix | 6 +++++- nixos/canary.nix | 23 +++++++++++++++++++++++ options/home/hardware.nix | 1 + 4 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 nixos/canary.nix diff --git a/flake.lock b/flake.lock index 75fc847..80f52a1 100644 --- a/flake.lock +++ b/flake.lock @@ -150,11 +150,11 @@ ] }, "locked": { - "lastModified": 1702579239, - "narHash": "sha256-6KNjHLEExVxyPwAAHwINbn7J20ie3aZugkINZCAk8js=", + "lastModified": 1702744308, + "narHash": "sha256-DtWTbLOVclB1vNTtPrdZH+CFllh97VnVvFzi7KnZ6JA=", "owner": "yunfachi", "repo": "nixpkgs-yunfachi", - "rev": "636e063938acb0d07bf0cdf4589eb075f3cc4eb3", + "rev": "f7c12de5d033b1810bf2eba784038de313052578", "type": "github" }, "original": { diff --git a/home/hyprland/default.nix b/home/hyprland/default.nix index c0c4d35..cedbf0a 100644 --- a/home/hyprland/default.nix +++ b/home/hyprland/default.nix @@ -27,7 +27,11 @@ in { ) (config.yunfachi.monitors); input = { - kb_layout = "us,ru"; + kb_layout = "${ + if config.yunfachi.canary.enable + then "canary" + else "us" + },ru"; kb_options = "grp:win_space_toggle"; follow_mouse = 1; }; diff --git a/nixos/canary.nix b/nixos/canary.nix new file mode 100644 index 0000000..dc8a294 --- /dev/null +++ b/nixos/canary.nix @@ -0,0 +1,23 @@ +{ + config, + lib, + pkgs-yunfachi, + ... +}: let + cfg = config.hm.yunfachi.canary; +in { + config = lib.mkIf cfg.enable { + services.xserver = { + enable = true; + xkb = { + extraLayouts.canary = { + symbolsFile = pkgs-yunfachi.canary + "/share/X11/xkb/symbols/canary"; + description = "Canary keyboard layout"; + languages = ["eng"]; + }; + layout = "canary,ru"; + }; + }; + console.useXkbConfig = true; + }; +} diff --git a/options/home/hardware.nix b/options/home/hardware.nix index 9986448..80500be 100644 --- a/options/home/hardware.nix +++ b/options/home/hardware.nix @@ -8,6 +8,7 @@ cfg = config.yunfachi; in { options.yunfachi = { + canary.enable = lib.mkEnableOption "canary" // {default = type == "desktop";}; monitors = mkOption { type = types.listOf (types.submodule { options = {