diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-11-30 23:06:24 +0100 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-11-30 23:06:24 +0100 |
commit | 8e6783cb5881e970ef1a3d8b43a0445c8437c807 (patch) | |
tree | 83c3ca5ce82d845af9c9873cbfb4a964874b41d4 /modules/by-name/lf | |
parent | fix(tests/nvim-checkhealth): Increase the sleeptime after typing (diff) | |
download | nixos-config-8e6783cb5881e970ef1a3d8b43a0445c8437c807.tar.gz nixos-config-8e6783cb5881e970ef1a3d8b43a0445c8437c807.zip |
feat(modules/lf): Add a keymap for cd-ing to the download directory
Diffstat (limited to 'modules/by-name/lf')
-rw-r--r-- | modules/by-name/lf/lf/keybindings/default.nix | 6 | ||||
-rw-r--r-- | modules/by-name/lf/lf/module.nix | 24 |
2 files changed, 22 insertions, 8 deletions
diff --git a/modules/by-name/lf/lf/keybindings/default.nix b/modules/by-name/lf/lf/keybindings/default.nix index 7ae720e0..f624719f 100644 --- a/modules/by-name/lf/lf/keybindings/default.nix +++ b/modules/by-name/lf/lf/keybindings/default.nix @@ -1,4 +1,7 @@ -{uid}: { +{ + uid, + downloadDir, +}: { # Remove some defaults "'\"'" = null; ";" = null; @@ -87,6 +90,7 @@ gc = "cd ~/.config"; gl = "cd ~/.local"; gE = "cd /etc"; + gd = "cd ${downloadDir}"; "gU." = "cd /usr"; gUs = " cd /usr/share"; diff --git a/modules/by-name/lf/lf/module.nix b/modules/by-name/lf/lf/module.nix index 1c02092d..840ba492 100644 --- a/modules/by-name/lf/lf/module.nix +++ b/modules/by-name/lf/lf/module.nix @@ -8,18 +8,28 @@ ... }: let commands = import ./commands {inherit pkgs sysLib shell_library system;}; - keybindings = import ./keybindings {inherit (cfg.keymaps) uid;}; + keybindings = import ./keybindings {inherit (cfg.keymaps) uid downloadDir;}; cfg = config.soispha.programs.lf; in { options.soispha.programs.lf = { enable = lib.mkEnableOption "lf"; - keymaps.uid = lib.mkOption { - description = '' - The uid to use when constructing the `/run/user/''${uid}` path. - ''; - type = lib.types.ints.unsigned; - default = config.users.users.soispha.uid; + keymaps = { + downloadDir = lib.mkOption { + description = '' + The directory to cd to when the user wants to access the download dir. + ''; + type = lib.types.str; + default = config.home-manager.users.soispha.xdg.userDirs.download; + }; + + uid = lib.mkOption { + description = '' + The uid to use when constructing the `/run/user/''${uid}` path. + ''; + type = lib.types.ints.unsigned; + default = config.users.users.soispha.uid; + }; }; }; |