Modularize htop and dual-function-keys

This commit is contained in:
Donovan Glover 2023-05-16 17:18:06 -04:00
parent 537357307e
commit 8c027300e6
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65
3 changed files with 38 additions and 29 deletions

View File

@ -7,6 +7,8 @@
./modules/fish.nix
./modules/fonts.nix
./modules/stylix
./modules/htop.nix
./modules/dual-function-keys.nix
];
boot.loader.systemd-boot.enable = true;
@ -87,11 +89,6 @@
programs.thunar.enable = true;
programs.neovim.enable = true;
programs.htop = {
enable = true;
package = pkgs."htop-vim";
settings = { tree_view = 1; };
};
programs.firejail.enable = true;
nix.package = pkgs.nixFlakes;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
@ -186,29 +183,5 @@
networking.nat.internalInterfaces = [ "ve-+" ];
networking.nat.externalInterface = "wg-mullvad";
services.interception-tools = {
enable = true;
plugins = [ pkgs.interception-tools-plugins.dual-function-keys ];
udevmonConfig = ''
- JOB: "${pkgs.interception-tools}/bin/intercept -g $DEVNODE | ${pkgs.interception-tools-plugins.dual-function-keys}/bin/dual-function-keys -c /etc/dual-function-keys.yaml | ${pkgs.interception-tools}/bin/uinput -d $DEVNODE"
DEVICE:
EVENTS:
EV_KEY: [KEY_CAPSLOCK, KEY_ESC]
'';
};
environment.etc."dual-function-keys.yaml".text = ''
TIMING:
- TAP_MILLISEC: 1000
- DOUBLE_TAP_MILLISEC: 0
MAPPINGS:
- KEY: KEY_CAPSLOCK
TAP: KEY_ESC
HOLD: KEY_LEFTCTRL
- KEY: KEY_SYSRQ
TAP: KEY_SYSRQ
HOLD: KEY_RIGHTMETA
'';
system.stateVersion = "22.11";
}

View File

@ -0,0 +1,27 @@
{ pkgs, ... }:
{
services.interception-tools = {
enable = true;
plugins = [ pkgs.interception-tools-plugins.dual-function-keys ];
udevmonConfig = ''
- JOB: "${pkgs.interception-tools}/bin/intercept -g $DEVNODE | ${pkgs.interception-tools-plugins.dual-function-keys}/bin/dual-function-keys -c /etc/dual-function-keys.yaml | ${pkgs.interception-tools}/bin/uinput -d $DEVNODE"
DEVICE:
EVENTS:
EV_KEY: [KEY_CAPSLOCK, KEY_ESC]
'';
};
environment.etc."dual-function-keys.yaml".text = ''
TIMING:
- TAP_MILLISEC: 1000
- DOUBLE_TAP_MILLISEC: 0
MAPPINGS:
- KEY: KEY_CAPSLOCK
TAP: KEY_ESC
HOLD: KEY_LEFTCTRL
- KEY: KEY_SYSRQ
TAP: KEY_SYSRQ
HOLD: KEY_RIGHTMETA
'';
}

9
modules/htop.nix Normal file
View File

@ -0,0 +1,9 @@
{ pkgs, ... }:
{
programs.htop = {
enable = true;
package = pkgs."htop-vim";
settings = { tree_view = 1; };
};
}