diff --git a/hosts/pinwheel/configuration.nix b/hosts/pinwheel/configuration.nix index 0ecf2d9..d40f207 100644 --- a/hosts/pinwheel/configuration.nix +++ b/hosts/pinwheel/configuration.nix @@ -7,6 +7,7 @@ ./hardware-configuration.nix ./modules/light ./modules/sound + ./modules/keyboard ./modules/age ./modules/ssh ./modules/git @@ -89,9 +90,6 @@ hardware.opengl.enable = true; programs.dconf.enable = true; - # Configure console keymap - console.keyMap = "sv-latin1"; - # Define a user account. Don't forget to set a password with ‘passwd’. users.users.alex = { isNormalUser = true; @@ -131,6 +129,7 @@ git.enable = true; openvpn.enable = true; go.enable = true; + keyboard.enable = true; }; # This value determines the NixOS release from which the default diff --git a/hosts/pinwheel/home.nix b/hosts/pinwheel/home.nix index a7f0ea4..b241204 100644 --- a/hosts/pinwheel/home.nix +++ b/hosts/pinwheel/home.nix @@ -13,7 +13,6 @@ home.packages = with pkgs; [ tig onlyoffice-bin - qmk ]; home.stateVersion = "23.05"; diff --git a/hosts/pinwheel/modules/keyboard/default.nix b/hosts/pinwheel/modules/keyboard/default.nix new file mode 100644 index 0000000..f33e5de --- /dev/null +++ b/hosts/pinwheel/modules/keyboard/default.nix @@ -0,0 +1,25 @@ +{ pkgs, lib, config, ... }: +let + enabled = config.mod.keyboard.enable; +in +{ + options = { + mod.keyboard = { + enable = lib.mkEnableOption "add keyboard module"; + }; + }; + + config = lib.mkIf enabled { + console.keyMap = "sv-latin1"; + + hardware.keyboard.qmk.enable = true; + hardware.keyboard.zsa.enable = true; + + home-manager.users.alex = { + home.packages = [ + pkgs.qmk + pkgs.wally-cli + ]; + }; + }; +}