feat(wl-kbptr): package wl-kbptr for NixOS as home module
This commit is contained in:
37
users/modules/desktop/wl-kbptr.nix
Normal file
37
users/modules/desktop/wl-kbptr.nix
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
configDir = config.xdg.configHome;
|
||||
cfg = config.home.desktop.wl-kbptr;
|
||||
iniFormat = pkgs.formats.ini {};
|
||||
in {
|
||||
options.home.desktop.wl-kbptr = {
|
||||
enable = mkEnableOption "enable wl-kbptr";
|
||||
config = mkOption {
|
||||
inherit (iniFormat) type;
|
||||
default = {};
|
||||
description = ''
|
||||
Options to add to the {file}`config` file. See
|
||||
<https://github.com/moverest/wl-kbptr/blob/main/config.example>
|
||||
for options.
|
||||
'';
|
||||
example = {
|
||||
general = {
|
||||
home_row_keys = "abcd";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
home = {
|
||||
packages = [pkgs.wl-kbptr];
|
||||
file."${configDir}/wl-kbptr/config" = mkIf (cfg.config != {}) {
|
||||
source = iniFormat.generate "wl-kbptr-config" cfg.config;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user