├── .gitignore ├── LICENSE ├── README.md ├── flake.lock ├── flake.nix ├── lib.nix ├── module.nix └── plugins ├── bookmarks ├── hm-module.nix └── package.nix ├── bypass └── hm-module.nix ├── chmod └── hm-module.nix ├── copy-file-contents ├── hm-module.nix └── package.nix ├── exifaudio └── package.nix ├── full-border └── hm-module.nix ├── git └── hm-module.nix ├── glow └── hm-module.nix ├── hide-preview ├── hm-module.nix └── package.nix ├── jump-to-char └── hm-module.nix ├── max-preview ├── hm-module.nix └── package.nix ├── open-with-cmd ├── hm-module.nix └── package.nix ├── ouch └── package.nix ├── relative-motions └── hm-module.nix ├── rich-preview └── package.nix ├── smart-enter └── hm-module.nix ├── smart-filter └── hm-module.nix ├── starship └── hm-module.nix ├── system-clipboard └── package.nix └── yamb ├── hm-module.nix └── package.nix /.gitignore: -------------------------------------------------------------------------------- 1 | result 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Heinrich Preiser and contributors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # [Yazi](https://yazi-rs.github.io/) plugins, packaged for Nix 2 | This is a collection of nix packages containing plugins for the Yazi TUI file manager. 3 | 4 | ## Upstream Packages 5 | Quite Recently NixOS added yaziPlugins upstream. For this reason some packages were removed. 6 | The Home-Manager Integration (see below) prefers the upstream over this repositories packages, as it is assumed that nixpkgs is more stable 7 | 8 | ## Usage 9 | In your `flake.nix`, add an input like so: 10 | ```nix 11 | { 12 | inputs.nix-yazi-plugins = { 13 | url = "github:lordkekz/nix-yazi-plugins?ref=yazi-v0.2.5"; 14 | inputs.nixpkgs.follows = "nixpkgs"; 15 | }; 16 | ... 17 | } 18 | ``` 19 | 20 | You can use `nix flake show github:lordkekz/nix-yazi-plugins` or `nix search github:lordkekz/nix-yazi-plugins ^` to see the provided packages. 21 | There's also an overlay which will give you the packages under `pkgs.yaziPlugins.`. 22 | 23 | The plugin packages provided by this flake can be used with the home-manager module for Yazi, see [`programs.yazi.plugins`](https://nix-community.github.io/home-manager/options.xhtml#opt-programs.yazi.plugins). 24 | 25 | ### Home Manager Integration 26 | Easily enable plugins, a sensible default is already preconfigured. 27 | The init.lua, your keymaps, dependencies, plugins directory, ... are automatically managed for you 28 | example usage inside home-manager: 29 | ```nix 30 | imports = [ 31 | (inputs.nix-yazi-plugins.legacyPackages.x86_64-linux.homeManagerModules.default) 32 | ]; 33 | 34 | programs.yazi = { 35 | enable = true; 36 | }; 37 | 38 | programs.yazi.yaziPlugins = { 39 | enable = true; 40 | plugins = { 41 | starship.enable = true; 42 | jump-to-char = { 43 | enable = true; 44 | keys.toggle.on = [ "F" ]; 45 | }; 46 | relative-motions = { 47 | enable = true; 48 | show_numbers = "relative_absolute"; 49 | show_motion = true; 50 | }; 51 | }; 52 | }; 53 | ``` 54 | 55 | ## Branches & Compatibility 56 | I try to support the latest release and the latest git of Yazi. 57 | If you run the unstable version, use the `main` branch. 58 | If you run the release version, use the corresponding branch, for example `yazi-v0.2.5`. Note that I won't delete unsupported release branches, so that your configs will still build in the future. 59 | 60 | ## Plugin list 61 | 62 | | Attribute name | Short Description | Upstream repo | 63 | | --- | --- | --- | 64 | | `bookmarks` | A Yazi plugin that adds the basic functionality of vi-like marks | https://github.com/dedukun/bookmarks.yazi | 65 | | `bypass` | Skip directories with only a single sub-directory | https://github.com/Rolv-Apneseth/bypass.yazi | 66 | | `chmod` | Execute chmod on the selected files to change their mode | https://github.com/yazi-rs/plugins/tree/main/chmod.yazi | 67 | | `copy-file-contents` | Copy the contents of a file to clipboard directly from Yazi | https://github.com/AnirudhG07/plugins-yazi/tree/main/copy-file-contents.yazi | 68 | | `exifaudio` | Preview audio files metadata on yazi | https://github.com/Sonico98/exifaudio.yazi | 69 | | `full-border` | Add a full border to Yazi to make it look fancier | https://github.com/yazi-rs/plugins/tree/main/full-border.yazi| 70 | | `git` | Show the status of Git file changes as linemode in the file list | https://github.com/yazi-rs/plugins/tree/main/git.yazi| 71 | | `glow` | Plugin for Yazi to preview markdown files with glow | https://github.com/Reledia/glow.yazi | 72 | | `hide-preview` | Switch the preview pane between hidden and shown | https://github.com/yazi-rs/plugins/tree/main/hide-preview.yazi | 73 | | `jump-to-char` | Vim-like f, jump to the next file whose name starts with | https://github.com/yazi-rs/plugins/tree/main/jump-to-char.yazi | 74 | | `max-preview` | Maximize or restore the preview pane | https://github.com/yazi-rs/plugins/tree/main/max-preview.yazi | 75 | | `open-with-cmd` | This is a Yazi plugin for opening files with a prompted command. | https://github.com/Ape/open-with-cmd.yazi | 76 | | `ouch` | A Yazi plugin to preview archives | https://github.com/ndtoan96/ouch.yazi | 77 | | `relative-motions` | basic vim motions like 3k, 12j, 10gg | https://github.com/dedukun/relative-motions.yazi | 78 | | `rich-preview` | Rich preview plugin for yazi file manager | https://github.com/AnirudhG07/rich-preview.yazi | 79 | | `smart-enter` | Open files or enter directories all in one key! | https://github.com/yazi-rs/plugins/tree/main/smart-enter.yazi | 80 | | `smart-filter` | A Yazi plugin that makes filters smarter: continuous filtering, automatically enter unique directory, open file on submitting | https://github.com/yazi-rs/plugins/tree/main/smart-filter.yazi | 81 | | `starship` | Show starship prompt in header | https://github.com/Rolv-Apneseth/starship.yazi | 82 | | `system-clipboard` | Cross platform implementation of a simple system clipboard for yazi file manager | https://github.com/orhnk/system-clipboard.yazi | 83 | 84 | ## Contributing 85 | To request a new plugin or an update to an existing one, you can open an issue. 86 | Contributions are also welcome! Feel free to send PRs. 87 | 88 | Since plugins are written in Lua, you'll most likely only need to fetch a git repo and copy the plugin content to a derivation's `$out`. 89 | You can generate most of the code using a tool like [`nurl`](https://github.com/nix-community/nurl). 90 | You can also take inspiration from the existing packages. 91 | -------------------------------------------------------------------------------- /flake.lock: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": { 3 | "flake-utils": { 4 | "inputs": { 5 | "systems": [ 6 | "systems" 7 | ] 8 | }, 9 | "locked": { 10 | "lastModified": 1731533236, 11 | "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", 12 | "owner": "numtide", 13 | "repo": "flake-utils", 14 | "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", 15 | "type": "github" 16 | }, 17 | "original": { 18 | "owner": "numtide", 19 | "repo": "flake-utils", 20 | "type": "github" 21 | } 22 | }, 23 | "flake-utils-plus": { 24 | "inputs": { 25 | "flake-utils": [ 26 | "flake-utils" 27 | ] 28 | }, 29 | "locked": { 30 | "lastModified": 1696281284, 31 | "narHash": "sha256-xcmtTmoiiAOSk4abifbtqVZk0iwBcqJfg47iUbkwhcE=", 32 | "owner": "gytis-ivaskevicius", 33 | "repo": "flake-utils-plus", 34 | "rev": "6cf1e312fb259693c4930d07ca3cbe1d07ef4a48", 35 | "type": "github" 36 | }, 37 | "original": { 38 | "owner": "gytis-ivaskevicius", 39 | "ref": "v1.4.0", 40 | "repo": "flake-utils-plus", 41 | "type": "github" 42 | } 43 | }, 44 | "haumea": { 45 | "inputs": { 46 | "nixpkgs": [ 47 | "nixpkgs" 48 | ] 49 | }, 50 | "locked": { 51 | "lastModified": 1685133229, 52 | "narHash": "sha256-FePm/Gi9PBSNwiDFq3N+DWdfxFq0UKsVVTJS3cQPn94=", 53 | "owner": "nix-community", 54 | "repo": "haumea", 55 | "rev": "34dd58385092a23018748b50f9b23de6266dffc2", 56 | "type": "github" 57 | }, 58 | "original": { 59 | "owner": "nix-community", 60 | "ref": "v0.2.2", 61 | "repo": "haumea", 62 | "type": "github" 63 | } 64 | }, 65 | "nixpkgs": { 66 | "locked": { 67 | "lastModified": 1744932701, 68 | "narHash": "sha256-fusHbZCyv126cyArUwwKrLdCkgVAIaa/fQJYFlCEqiU=", 69 | "owner": "nixos", 70 | "repo": "nixpkgs", 71 | "rev": "b024ced1aac25639f8ca8fdfc2f8c4fbd66c48ef", 72 | "type": "github" 73 | }, 74 | "original": { 75 | "owner": "nixos", 76 | "ref": "nixos-unstable", 77 | "repo": "nixpkgs", 78 | "type": "github" 79 | } 80 | }, 81 | "root": { 82 | "inputs": { 83 | "flake-utils": "flake-utils", 84 | "flake-utils-plus": "flake-utils-plus", 85 | "haumea": "haumea", 86 | "nixpkgs": "nixpkgs", 87 | "systems": "systems" 88 | } 89 | }, 90 | "systems": { 91 | "locked": { 92 | "lastModified": 1681028828, 93 | "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 94 | "owner": "nix-systems", 95 | "repo": "default", 96 | "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 97 | "type": "github" 98 | }, 99 | "original": { 100 | "owner": "nix-systems", 101 | "repo": "default", 102 | "type": "github" 103 | } 104 | } 105 | }, 106 | "root": "root", 107 | "version": 7 108 | } 109 | -------------------------------------------------------------------------------- /flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "A collection of plugins for the Yazi file manager"; 3 | 4 | inputs = { 5 | nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; 6 | 7 | # Flake utils for stripping some boilerplate 8 | flake-utils.url = "github:numtide/flake-utils"; 9 | flake-utils.inputs.systems.follows = "systems"; 10 | flake-utils-plus.url = "github:gytis-ivaskevicius/flake-utils-plus/v1.4.0"; 11 | flake-utils-plus.inputs.flake-utils.follows = "flake-utils"; 12 | 13 | # The list of supported systems. 14 | systems.url = "github:nix-systems/default"; 15 | 16 | # Haumea for directory-defined attrset loading 17 | haumea.url = "github:nix-community/haumea/v0.2.2"; 18 | haumea.inputs.nixpkgs.follows = "nixpkgs"; 19 | }; 20 | 21 | outputs = 22 | inputs@{ 23 | self, 24 | nixpkgs, 25 | flake-utils-plus, 26 | systems, 27 | haumea, 28 | ... 29 | }: 30 | let 31 | inherit (self) outputs; 32 | instantiate_lib = lib: pkgs: rec { 33 | inherit (pkgs) callPackage; 34 | inherit (lib) 35 | mapAttrs 36 | mapAttrsToList 37 | listToAttrs 38 | filterAttrs 39 | mkMerge 40 | attrValues 41 | filter 42 | flatten 43 | attrByPath 44 | mkOption 45 | mkEnableOption 46 | ; 47 | # bypass.package = ... 48 | # -> bypass = ... 49 | CondRaiseAttrs = n: set: mapAttrs (_n: v: v."${n}") (filterAttrs (_n: v: v ? "${n}") set); 50 | 51 | packages = if (pkgs ? yaziPlugins) then pkgs.yaziPlugins // packagesOurs else packagesOurs; 52 | packagesOurs = (CondRaiseAttrs "package" YaziPlugins); 53 | 54 | homeManagerModulesRaised = (CondRaiseAttrs "hm-module" YaziPlugins); 55 | homeManagerModulesImports = ( 56 | map ( 57 | v: 58 | { config, lib, ... }: 59 | let 60 | cfg = config.programs.yazi.yaziPlugins.plugins.${v.name}; 61 | in 62 | { 63 | imports = ( 64 | filter (v: v != { }) [ 65 | ( 66 | { pkgs, ... }@inputs: 67 | lib.mkIf (cfg.enable && inputs.config.programs.yazi.yaziPlugins.enable) ( 68 | v.config ({ inherit cfg; } // (import ./lib.nix inputs)) inputs 69 | ) 70 | ) 71 | (_: { 72 | config = lib.mkIf (cfg.enable && cfg.package != null) { 73 | programs.yazi.plugins.${v.name} = cfg.package; 74 | }; 75 | }) 76 | (_: { 77 | config = lib.mkIf (cfg.enable && cfg ? "runtimeDeps") { 78 | programs.yazi.yaziPlugins.runtimeDeps = cfg.runtimeDeps; 79 | }; 80 | }) 81 | (_: { 82 | config = lib.mkIf (cfg.enable && cfg ? "require") { 83 | programs.yazi.yaziPlugins.require = cfg.require; 84 | }; 85 | }) 86 | (_: { 87 | config = lib.mkIf (cfg.enable && cfg ? "extraConfig" && cfg.extraConfig != "") { 88 | programs.yazi.yaziPlugins.extraConfig = cfg.extraConfig; 89 | }; 90 | }) 91 | ({ pkgs, ... }@inputs: (v.options ({ inherit cfg; } // (import ./lib.nix inputs))) inputs) 92 | ( 93 | { pkgs, ... }: 94 | { 95 | options.programs.yazi.yaziPlugins.plugins.${v.name} = { 96 | package = mkOption { 97 | type = lib.types.nullOr lib.types.package; 98 | description = "The ${v.name} package to use"; 99 | #TODO document this 100 | #default = (pkgs.yaziPlugins.${v.name} or self.packages.${pkgs.system}.${v.name}); 101 | default = 102 | inputs.nixpkgs.legacyPackages.${pkgs.system}.yaziPlugins.${v.name} 103 | or self.packages.${pkgs.system}.${v.name}; 104 | }; 105 | enable = mkEnableOption v.name; 106 | extraConfig = mkOption { 107 | type = lib.types.lines; 108 | description = "Extra configuration lines to add to ~/.config/yazi/init.lua for ${v.name}"; 109 | default = ''''; 110 | }; 111 | }; 112 | } 113 | ) 114 | ] 115 | ); 116 | } 117 | ) (attrValues homeManagerModulesRaised) 118 | ); 119 | 120 | YaziPlugins = 121 | let 122 | AttrName = path: builtins.baseNameOf (builtins.dirOf path); 123 | in 124 | haumea.lib.load { 125 | src = ./plugins; 126 | inputs = 127 | (removeAttrs pkgs [ 128 | "self" 129 | "super" 130 | "root" 131 | ]) 132 | // { 133 | flake = self; 134 | }; 135 | # Call files like with callPackage 136 | loader = [ 137 | { 138 | matches = str: str == "package.nix"; 139 | loader = inputs: path: (haumea.lib.loaders.callPackage inputs path); 140 | } 141 | { 142 | matches = str: str == "hm-module.nix"; 143 | loader = 144 | _: path: 145 | let 146 | value = haumea.lib.loaders.verbatim { } path; 147 | name = AttrName path; 148 | in 149 | { 150 | inherit name; 151 | options = 152 | if value ? "options" then 153 | (outer_inputs: inputs: { 154 | options.programs.yazi.yaziPlugins.plugins.${name} = value.options outer_inputs inputs; 155 | }) 156 | else 157 | _: _: { }; 158 | config = if value ? "config" then value.config else _: _: { }; 159 | }; 160 | } 161 | ]; 162 | }; 163 | }; 164 | 165 | in 166 | flake-utils-plus.lib.mkFlake { 167 | inherit self inputs; 168 | 169 | outputsBuilder = 170 | channels: 171 | let 172 | pkgs = channels.nixpkgs; 173 | lib = inputs.nixpkgs.lib; 174 | instance = (instantiate_lib lib pkgs); 175 | inherit (pkgs) system; 176 | in 177 | { 178 | formatter = pkgs.nixfmt-rfc-style; 179 | inherit (instance) packages; 180 | legacyPackages = { 181 | homeManagerModules = rec { 182 | yaziPlugins = 183 | { lib, ... }: 184 | { 185 | imports = 186 | ((instantiate_lib lib (inputs.nixpkgs.legacyPackages.${system})).homeManagerModulesImports) 187 | ++ [ ./module.nix ]; 188 | }; 189 | default = yaziPlugins; 190 | }; 191 | }; 192 | 193 | }; 194 | 195 | overlays.default = final: prev: { yaziPlugins = (instantiate_lib (final.lib) prev).packages; }; 196 | 197 | }; 198 | } 199 | -------------------------------------------------------------------------------- /lib.nix: -------------------------------------------------------------------------------- 1 | { lib, ... }: 2 | let 3 | inherit (lib) mkOption isList; 4 | inherit (lib.types) 5 | submodule 6 | str 7 | either 8 | listOf 9 | package 10 | ; 11 | in 12 | { 13 | setKeys = keys: { 14 | programs.yazi.keymap.manager.prepend_keymap = lib.mapAttrsToList (_: key: { 15 | inherit (key) on run desc; 16 | }) keys; 17 | }; 18 | mkRuntimeDeps = 19 | { pkgs }: 20 | mkOption { 21 | type = listOf package; 22 | description = '' 23 | Additional runtime packages to add 24 | to deactivate overlaying `lib.mkForce []` the parent option 25 | ''; 26 | default = pkgs; 27 | }; 28 | mkDisableOption = 29 | description: 30 | mkOption { 31 | default = true; 32 | type = lib.types.bool; 33 | inherit description; 34 | }; 35 | mkKeyOption = 36 | { 37 | on, 38 | run, 39 | desc, 40 | }: 41 | mkOption { 42 | description = desc; 43 | type = either (submodule { 44 | options = { 45 | on = mkOption { 46 | type = listOf str; 47 | default = on; 48 | }; 49 | run = mkOption { 50 | type = str; 51 | default = run; 52 | }; 53 | 54 | desc = mkOption { 55 | type = str; 56 | default = desc; 57 | }; 58 | }; 59 | }) (listOf str); 60 | default = { 61 | inherit on run desc; 62 | }; 63 | apply = 64 | old: 65 | if isList old then 66 | { 67 | on = old; 68 | run = run; 69 | } 70 | else 71 | old; 72 | }; 73 | 74 | } 75 | -------------------------------------------------------------------------------- /module.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | lib, 4 | config, 5 | ... 6 | }: 7 | let 8 | inherit (lib) mkEnableOption mkOption; 9 | cfg = config.programs.yazi.yaziPlugins; 10 | in 11 | { 12 | options.programs.yazi.yaziPlugins = { 13 | enable = mkEnableOption "yaziPlugins"; 14 | runtimeDeps = mkOption { 15 | type = lib.types.listOf (lib.types.either lib.types.package lib.types.str); 16 | description = '' 17 | Additional runtime packages to make available for yazi and plugins. 18 | To deactivate overlaying set this to `lib.mkForce []`. 19 | 20 | This gets set by some plugin modules. 21 | ''; 22 | default = [ ]; 23 | }; 24 | require = mkOption { 25 | type = with lib.types; attrsOf (nullOr attrs); 26 | description = '' 27 | Plugins that need to be `require`d in ~/.config/yazi/init.lua with optional setup settings. 28 | To deactivate automatically setting up applicable plugins, set this to `lib.mkForce []`. 29 | 30 | This gets set by some plugin modules. 31 | ''; 32 | default = { }; 33 | }; 34 | extraConfig = mkOption { 35 | type = lib.types.lines; 36 | description = "Extra configuration lines to add to ~/.config/yazi/init.lua"; 37 | default = ''''; 38 | }; 39 | }; 40 | config = { 41 | programs.yazi = { 42 | package = lib.mkIf (cfg.runtimeDeps != [ ]) ( 43 | pkgs.yazi.override { 44 | extraPackages = config.programs.yazi.yaziPlugins.runtimeDeps; 45 | } 46 | ); 47 | initLua = 48 | let 49 | luaFormat = lib.generators.toLua { }; 50 | requirePlugin = name: setup: '' 51 | require("${name}"):setup(${if setup != { } then luaFormat setup else ""}) 52 | ''; 53 | in 54 | lib.concatStrings [ 55 | (lib.concatStrings (lib.mapAttrsToList requirePlugin cfg.require)) 56 | cfg.extraConfig 57 | ]; 58 | }; 59 | }; 60 | } 61 | -------------------------------------------------------------------------------- /plugins/bookmarks/hm-module.nix: -------------------------------------------------------------------------------- 1 | { 2 | options = 3 | { 4 | cfg, 5 | mkKeyOption, 6 | ... 7 | }: 8 | { lib, ... }: 9 | { 10 | keys = { 11 | mark = mkKeyOption { 12 | on = [ "m" ]; 13 | run = "plugin bookmarks save"; 14 | desc = "Save current position as a bookmark"; 15 | }; 16 | jump = mkKeyOption { 17 | on = [ "'" ]; 18 | run = "plugin bookmarks jump"; 19 | desc = "Jump to a bookmark"; 20 | }; 21 | delete = mkKeyOption { 22 | on = [ 23 | "b" 24 | "d" 25 | ]; 26 | run = "plugin bookmarks delete"; 27 | desc = "Delete a bookmark"; 28 | }; 29 | delete_all = mkKeyOption { 30 | on = [ 31 | "b" 32 | "D" 33 | ]; 34 | run = "plugin bookmarks delete_all"; 35 | desc = "Delete all bookmarks"; 36 | }; 37 | }; 38 | last_directory = { 39 | enable = lib.mkEnableOption "When enabled, a new bookmark is automatically created in ' which allows the user to jump back to the last directory."; 40 | persist = lib.mkEnableOption "When enabled the bookmarks will persist, i.e. if you close and reopen Yazi they will still be present."; 41 | }; 42 | persist = lib.mkOption { 43 | type = 44 | with lib.types; 45 | nullOr (enum [ 46 | "none" 47 | "all" 48 | "vim" 49 | ]); 50 | default = "none"; 51 | description = "When enabled the bookmarks will persist, i.e. if you close and reopen Yazi they will still be present."; 52 | }; 53 | desc_format = lib.mkOption { 54 | type = 55 | with lib.types; 56 | nullOr (enum [ 57 | "full" 58 | "parent" 59 | ]); 60 | default = "full"; 61 | description = "The format for the bookmark description."; 62 | }; 63 | file_pick_mode = lib.mkOption { 64 | type = 65 | with lib.types; 66 | nullOr (enum [ 67 | "hover" 68 | "parent" 69 | ]); 70 | default = "hover"; 71 | description = "The mode for choosing which directory to bookmark."; 72 | }; 73 | notify = { 74 | enable = lib.mkEnableOption "When enabled, notifications will be shown when the user creates a new bookmark and deletes one or all saved bookmarks."; 75 | timeout = lib.mkOption { 76 | type = with lib.types; int; 77 | default = 1; 78 | description = "The time a notification is displayed (in seconds)"; 79 | }; 80 | message = { 81 | new = lib.mkOption { 82 | type = with lib.types; str; 83 | default = "New bookmark '' -> ''"; 84 | description = "The notification message when creating a new bookmark"; 85 | }; 86 | delete = lib.mkOption { 87 | type = with lib.types; str; 88 | default = "Deleted bookmark in ''"; 89 | description = "The notification message when deleting a bookmark"; 90 | }; 91 | delete_all = lib.mkOption { 92 | type = with lib.types; str; 93 | default = "Deleted all bookmarks"; 94 | description = "The notification message when deleting all bookmarks"; 95 | }; 96 | }; 97 | }; 98 | }; 99 | config = 100 | { 101 | cfg, 102 | setKeys, 103 | ... 104 | }: 105 | { lib, ... }: 106 | lib.mkMerge [ 107 | (setKeys cfg.keys) 108 | { 109 | programs.yazi.yaziPlugins.require.bookmarks = { 110 | inherit (cfg) 111 | persist 112 | desc_format 113 | file_pick_mode 114 | last_directory 115 | notify 116 | ; 117 | }; 118 | } 119 | ]; 120 | } 121 | -------------------------------------------------------------------------------- /plugins/bookmarks/package.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | stdenv, 4 | fetchFromGitHub, 5 | }: 6 | stdenv.mkDerivation { 7 | pname = "yaziPlugins-bookmarks"; 8 | version = "unstable-2025-02-18"; 9 | 10 | src = fetchFromGitHub { 11 | owner = "dedukun"; 12 | repo = "bookmarks.yazi"; 13 | rev = "fe0b1de939fa49068ac6b35da8d6680799931f1c"; 14 | hash = "sha256-5ZW73yHKEfKmN/JsZUINUVyEwvK4bA4DlufRgdT1toI="; 15 | }; 16 | 17 | buildPhase = '' 18 | mkdir $out 19 | cp $src/* $out 20 | ''; 21 | 22 | meta = with lib; { 23 | description = "A Yazi plugin that adds the basic functionality of vi-like marks."; 24 | homepage = "https://github.com/dedukun/bookmarks.yazi"; 25 | license = licenses.mit; 26 | maintainers = [ ]; 27 | platforms = platforms.all; 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /plugins/bypass/hm-module.nix: -------------------------------------------------------------------------------- 1 | { 2 | options = 3 | { cfg, mkKeyOption, ... }: 4 | { lib, ... }: 5 | { 6 | keys = { 7 | left = mkKeyOption { 8 | on = [ "l" ]; 9 | run = "plugin bypass smart_enter"; 10 | desc = "Open a file, or recursively enter child directory, skipping children with only a single subdirectory"; 11 | }; 12 | right = mkKeyOption { 13 | on = [ "h" ]; 14 | run = "plugin bypass reverse"; 15 | desc = "Recursively enter parent directory, skipping parents with only a single subdirectory"; 16 | }; 17 | }; 18 | }; 19 | config = { cfg, setKeys, ... }: { config, lib, ... }: { } // (setKeys cfg.keys); 20 | } 21 | -------------------------------------------------------------------------------- /plugins/chmod/hm-module.nix: -------------------------------------------------------------------------------- 1 | { 2 | options = 3 | { cfg, mkKeyOption, ... }: 4 | { lib, ... }: 5 | { 6 | keys = { 7 | mod = mkKeyOption { 8 | on = [ 9 | "c" 10 | "m" 11 | ]; 12 | run = "plugin chmod"; 13 | desc = "Chmod on selected files"; 14 | }; 15 | }; 16 | }; 17 | config = { cfg, setKeys, ... }: { config, lib, ... }: { } // (setKeys cfg.keys); 18 | } 19 | -------------------------------------------------------------------------------- /plugins/copy-file-contents/hm-module.nix: -------------------------------------------------------------------------------- 1 | { 2 | options = 3 | { 4 | mkKeyOption, 5 | mkDisableOption, 6 | ... 7 | }: 8 | { lib, ... }: 9 | { 10 | keys = { 11 | mod = mkKeyOption { 12 | on = [ 13 | "c" 14 | "C" 15 | ]; 16 | run = "plugin copy-file-contents"; 17 | desc = "Copy contents of file"; 18 | }; 19 | }; 20 | append_char = lib.mkOption { 21 | type = lib.types.str; 22 | default = "\n"; 23 | description = "Append character at the end of each file content"; 24 | }; 25 | notification = mkDisableOption "Set to false to disable notification after copying the contents"; 26 | }; 27 | config = 28 | { cfg, setKeys, ... }: 29 | { lib, ... }: 30 | lib.mkMerge [ 31 | (setKeys cfg.keys) 32 | { 33 | programs.yazi.yaziPlugins.require."copy-file-contents" = { 34 | inherit (cfg) append_char notification; 35 | }; 36 | } 37 | ]; 38 | } 39 | -------------------------------------------------------------------------------- /plugins/copy-file-contents/package.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | stdenv, 4 | fetchFromGitHub, 5 | }: 6 | 7 | stdenv.mkDerivation { 8 | pname = "yaziPlugins-copy-file-contents"; 9 | version = "unstable-2025-02-18"; 10 | 11 | src = fetchFromGitHub { 12 | owner = "AnirudhG07"; 13 | repo = "plugins-yazi"; 14 | rev = "524c52c7e433834e36a502abd1e31a6a65c8caf0"; 15 | hash = "sha256-GrPqcHYG+qHNi80U+EJJd1JjdAOexiE6sQxsqdeCSMg="; 16 | }; 17 | 18 | buildPhase = '' 19 | mkdir $out 20 | cp $src/copy-file-contents.yazi/* $out 21 | ''; 22 | 23 | meta = with lib; { 24 | description = "Copy the contents of a file to clipboard directly from Yazi."; 25 | homepage = "https://github.com/AnirudhG07/plugins-yazi/tree/main/copy-file-contents.yazi"; 26 | license = licenses.mit; 27 | maintainers = [ ]; 28 | platforms = platforms.all; 29 | }; 30 | } 31 | -------------------------------------------------------------------------------- /plugins/exifaudio/package.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | stdenv, 4 | fetchFromGitHub, 5 | }: 6 | 7 | stdenv.mkDerivation { 8 | pname = "yaziPlugins-exifaudio"; 9 | version = "unstable-2025-02-18"; 10 | 11 | src = fetchFromGitHub { 12 | owner = "Sonico98"; 13 | repo = "exifaudio.yazi"; 14 | rev = "4379fcfa2dbe0b81fde2dd67b9ac2e0e48331419"; 15 | hash = "sha256-CIimJU4KaKyaKBuiBvcRJUJqTG8pkGyytT6bPf/x8j8="; 16 | }; 17 | buildPhase = '' 18 | mkdir $out 19 | cp $src/* $out 20 | ''; 21 | 22 | meta = with lib; { 23 | description = "Preview audio files metadata on yazi "; 24 | homepage = "Preview audio files metadata on yazi "; 25 | license = licenses.mit; 26 | maintainers = [ ]; 27 | platforms = platforms.all; 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /plugins/full-border/hm-module.nix: -------------------------------------------------------------------------------- 1 | { 2 | config = _: _: { 3 | programs.yazi.yaziPlugins.require."full-border" = { }; 4 | }; 5 | } 6 | -------------------------------------------------------------------------------- /plugins/git/hm-module.nix: -------------------------------------------------------------------------------- 1 | { 2 | config = 3 | _: 4 | { pkgs, ... }: 5 | { 6 | programs.yazi = { 7 | yaziPlugins = { 8 | require.git = { }; 9 | runtimeDeps = [ pkgs.git ]; 10 | }; 11 | settings.plugin = { 12 | prepend_fetchers = [ 13 | { 14 | id = "git"; 15 | name = "*"; 16 | run = "git"; 17 | } 18 | { 19 | id = "git"; 20 | name = "*/"; 21 | run = "git"; 22 | } 23 | ]; 24 | }; 25 | }; 26 | }; 27 | } 28 | -------------------------------------------------------------------------------- /plugins/glow/hm-module.nix: -------------------------------------------------------------------------------- 1 | { 2 | options = 3 | { cfg, mkKeyOption, ... }: 4 | { lib, ... }: 5 | { 6 | keys = { 7 | up = mkKeyOption { 8 | on = [ "" ]; 9 | run = "seek -5"; 10 | desc = "go up in file"; 11 | }; 12 | down = mkKeyOption { 13 | on = [ "" ]; 14 | run = "seek 5"; 15 | desc = "go down in file"; 16 | }; 17 | }; 18 | }; 19 | config = 20 | { cfg, setKeys, ... }: 21 | { 22 | config, 23 | lib, 24 | pkgs, 25 | ... 26 | }: 27 | lib.mkMerge [ 28 | { 29 | programs.yazi = { 30 | settings.plugin.prepend_previewers = [ 31 | { 32 | name = "*.md"; 33 | run = "glow"; 34 | } 35 | ]; 36 | 37 | yaziPlugins = { 38 | runtimeDeps = [ pkgs.glow ]; 39 | }; 40 | }; 41 | } 42 | (setKeys cfg.keys) 43 | ]; 44 | } 45 | -------------------------------------------------------------------------------- /plugins/hide-preview/hm-module.nix: -------------------------------------------------------------------------------- 1 | { 2 | options = 3 | { mkKeyOption, ... }: 4 | _: { 5 | keys = { 6 | toggle = mkKeyOption { 7 | on = [ "T" ]; 8 | run = "plugin hide-preview"; 9 | desc = "Hide or show preview"; 10 | }; 11 | }; 12 | }; 13 | config = { cfg, setKeys, ... }: _: (setKeys cfg.keys); 14 | } 15 | -------------------------------------------------------------------------------- /plugins/hide-preview/package.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | stdenv, 4 | fetchFromGitHub, 5 | }: 6 | 7 | stdenv.mkDerivation { 8 | pname = "yaziPlugins-hide-preview"; 9 | version = "unstable-2025-02-18"; 10 | 11 | src = fetchFromGitHub { 12 | owner = "yazi-rs"; 13 | repo = "plugins"; 14 | rev = "beb586aed0d41e6fdec5bba7816337fdad905a33"; 15 | sha256 = "sha256-enIt79UvQnKJalBtzSEdUkjNHjNJuKUWC4L6QFb3Ou4="; 16 | }; 17 | 18 | buildPhase = '' 19 | mkdir $out 20 | cp $src/hide-preview.yazi/* $out 21 | ''; 22 | 23 | meta = with lib; { 24 | description = "Switch the preview pane between hidden and shown."; 25 | homepage = "https://github.com/yazi-rs/plugins/tree/main/hide-preview.yazi"; 26 | license = licenses.mit; 27 | maintainers = [ ]; 28 | platforms = platforms.all; 29 | }; 30 | } 31 | -------------------------------------------------------------------------------- /plugins/jump-to-char/hm-module.nix: -------------------------------------------------------------------------------- 1 | { 2 | options = 3 | { mkKeyOption, ... }: 4 | _: { 5 | keys = { 6 | toggle = mkKeyOption { 7 | on = [ "f" ]; 8 | run = "plugin jump-to-char"; 9 | desc = "Jump to char"; 10 | }; 11 | }; 12 | }; 13 | config = { cfg, setKeys, ... }: _: (setKeys cfg.keys); 14 | } 15 | -------------------------------------------------------------------------------- /plugins/max-preview/hm-module.nix: -------------------------------------------------------------------------------- 1 | { 2 | options = 3 | { mkKeyOption, ... }: 4 | _: { 5 | keys = { 6 | toggle = mkKeyOption { 7 | on = [ "R" ]; 8 | run = "plugin max-preview"; 9 | desc = "Maximize or restore preview"; 10 | }; 11 | }; 12 | }; 13 | config = { cfg, setKeys, ... }: _: (setKeys cfg.keys); 14 | } 15 | -------------------------------------------------------------------------------- /plugins/max-preview/package.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | stdenv, 4 | fetchFromGitHub, 5 | }: 6 | 7 | stdenv.mkDerivation { 8 | pname = "yaziPlugins-max-preview"; 9 | version = "unstable-2025-02-18"; 10 | 11 | src = fetchFromGitHub { 12 | owner = "yazi-rs"; 13 | repo = "plugins"; 14 | rev = "beb586aed0d41e6fdec5bba7816337fdad905a33"; 15 | sha256 = "sha256-enIt79UvQnKJalBtzSEdUkjNHjNJuKUWC4L6QFb3Ou4="; 16 | }; 17 | 18 | buildPhase = '' 19 | mkdir $out 20 | cp $src/max-preview.yazi/* $out 21 | ''; 22 | 23 | meta = with lib; { 24 | description = "Maximize or restore the preview pane."; 25 | homepage = "https://github.com/yazi-rs/plugins/tree/main/max-preview.yazi"; 26 | license = licenses.mit; 27 | maintainers = [ ]; 28 | platforms = platforms.all; 29 | }; 30 | } 31 | -------------------------------------------------------------------------------- /plugins/open-with-cmd/hm-module.nix: -------------------------------------------------------------------------------- 1 | { 2 | options = 3 | { mkKeyOption, ... }: 4 | _: { 5 | keys = { 6 | open_terminal = mkKeyOption { 7 | on = [ "o" ]; 8 | run = "plugin open-with-cmd block"; 9 | desc = "Open with command in the terminal"; 10 | }; 11 | open = mkKeyOption { 12 | on = [ "O" ]; 13 | run = "plugin open-with-cmd"; 14 | desc = "Open with command"; 15 | }; 16 | }; 17 | }; 18 | config = 19 | { 20 | cfg, 21 | setKeys, 22 | ... 23 | }: 24 | _: (setKeys cfg.keys); 25 | } 26 | -------------------------------------------------------------------------------- /plugins/open-with-cmd/package.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | stdenv, 4 | fetchFromGitHub, 5 | }: 6 | stdenv.mkDerivation { 7 | pname = "yaziPlugins-open-with-cmd"; 8 | version = "unstable-2025-02-18"; 9 | 10 | src = fetchFromGitHub { 11 | owner = "Ape"; 12 | repo = "open-with-cmd.yazi"; 13 | rev = "433cf301c36882c31032d3280ab0c94825fc5e9f"; 14 | hash = "sha256-QazKfNEPFdkHwMrH4D+VMwj8fGXM8KHDdSvm1tik3dQ="; 15 | }; 16 | 17 | buildPhase = '' 18 | mkdir $out 19 | cp $src/* $out 20 | ''; 21 | meta = with lib; { 22 | description = "This is a Yazi plugin for opening files with a prompted command."; 23 | homepage = "https://github.com/Ape/open-with-cmd.yazi"; 24 | license = licenses.mit; 25 | maintainers = [ ]; 26 | platforms = platforms.all; 27 | }; 28 | } 29 | -------------------------------------------------------------------------------- /plugins/ouch/package.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | stdenv, 4 | fetchFromGitHub, 5 | }: 6 | 7 | stdenv.mkDerivation { 8 | pname = "yaziPlugins-ouch"; 9 | version = "unstable-2025-02-18"; 10 | 11 | src = fetchFromGitHub { 12 | owner = "ndtoan96"; 13 | repo = "ouch.yazi"; 14 | rev = "ce6fb75431b9d0d88efc6ae92e8a8ebb9bc1864a"; 15 | hash = "sha256-oUEUGgeVbljQICB43v9DeEM3XWMAKt3Ll11IcLCS/PA="; 16 | }; 17 | 18 | buildPhase = '' 19 | mkdir $out 20 | cp $src/* $out 21 | ''; 22 | 23 | meta = with lib; { 24 | description = "A Yazi plugin to preview archives"; 25 | homepage = "https://github.com/ndtoan96/ouch.yazi"; 26 | license = licenses.mit; 27 | maintainers = [ ]; 28 | platforms = platforms.all; 29 | }; 30 | } 31 | -------------------------------------------------------------------------------- /plugins/relative-motions/hm-module.nix: -------------------------------------------------------------------------------- 1 | { 2 | options = 3 | { cfg, mkKeyOption, ... }: 4 | { lib, ... }: 5 | { 6 | keys = lib.listToAttrs ( 7 | lib.genList ( 8 | idx_n: 9 | let 10 | idx = builtins.toString (idx_n + 1); 11 | in 12 | { 13 | name = idx; 14 | value = mkKeyOption { 15 | on = [ idx ]; 16 | run = "plugin relative-motions ${idx}"; 17 | desc = "Move in relative steps"; 18 | }; 19 | } 20 | ) 9 21 | ); 22 | show_numbers = lib.mkOption { 23 | type = 24 | with lib.types; 25 | nullOr (enum [ 26 | "relative" 27 | "absolute" 28 | "relative_absolute" 29 | ]); 30 | default = null; 31 | description = "Shows relative or absolute numbers before the file icon"; 32 | }; 33 | show_motion = lib.mkEnableOption "Shows current motion in Status bar"; 34 | only_motions = lib.mkEnableOption '' 35 | If true, only the motion movements will be enabled, 36 | i.e., the commands for delete, cut, yank and visual selection will be disabled''; 37 | }; 38 | config = 39 | { cfg, setKeys, ... }: 40 | { lib, ... }: 41 | lib.mkMerge [ 42 | (setKeys cfg.keys) 43 | { 44 | programs.yazi.yaziPlugins.require."relative-motions" = { 45 | inherit (cfg) show_numbers show_motion only_motions; 46 | }; 47 | } 48 | ]; 49 | } 50 | -------------------------------------------------------------------------------- /plugins/rich-preview/package.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | stdenv, 4 | fetchFromGitHub, 5 | }: 6 | stdenv.mkDerivation { 7 | pname = "yaziPlugins-rich-preview"; 8 | version = "unstable-2025-02-18"; 9 | 10 | src = fetchFromGitHub { 11 | owner = "AnirudhG07"; 12 | repo = "rich-preview.yazi"; 13 | rev = "2559e5fa7c1651dbe7c5615ef6f3b5291347d81a"; 14 | hash = "sha256-dW2gAAv173MTcQdqMV32urzfrsEX6STR+oCJoRVGGpA="; 15 | }; 16 | 17 | buildPhase = '' 18 | mkdir -p $out 19 | cp -r $src/* $out/ 20 | ''; 21 | 22 | meta = with lib; { 23 | description = "Rich preview plugin for yazi file manager"; 24 | homepage = "https://github.com/AnirudhG07/rich-preview.yazi"; 25 | license = licenses.mit; 26 | maintainers = [ ]; 27 | platforms = platforms.all; 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /plugins/smart-enter/hm-module.nix: -------------------------------------------------------------------------------- 1 | { 2 | options = 3 | { mkKeyOption, ... }: 4 | _: { 5 | keys = { 6 | toggle = mkKeyOption { 7 | on = [ "l" ]; 8 | run = "plugin smart-enter"; 9 | desc = "Enter the child directory, or open the file"; 10 | }; 11 | }; 12 | }; 13 | config = { cfg, setKeys, ... }: _: (setKeys cfg.keys); 14 | } 15 | -------------------------------------------------------------------------------- /plugins/smart-filter/hm-module.nix: -------------------------------------------------------------------------------- 1 | { 2 | options = 3 | { mkKeyOption, ... }: 4 | _: { 5 | keys = { 6 | toggle = mkKeyOption { 7 | on = [ "F" ]; 8 | run = "plugin smart-filter"; 9 | desc = "Smart filter"; 10 | }; 11 | }; 12 | }; 13 | config = { cfg, setKeys, ... }: _: (setKeys cfg.keys); 14 | } 15 | -------------------------------------------------------------------------------- /plugins/starship/hm-module.nix: -------------------------------------------------------------------------------- 1 | { 2 | options = 3 | { mkDisableOption, ... }: 4 | _: { 5 | enableStarship = mkDisableOption "wether to enable starship in home-manager"; 6 | }; 7 | config = 8 | { cfg, ... }: 9 | { lib, ... }: 10 | { 11 | programs.yazi.yaziPlugins.require.starship = { }; 12 | programs.starship.enable = lib.mkIf cfg.enableStarship true; 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /plugins/system-clipboard/package.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | stdenv, 4 | fetchFromGitHub, 5 | }: 6 | 7 | stdenv.mkDerivation { 8 | pname = "yaziPlugins-system-clipboard"; 9 | version = "unstable-2025-02-18"; 10 | 11 | src = fetchFromGitHub { 12 | owner = "orhnk"; 13 | repo = "system-clipboard.yazi"; 14 | rev = "efb8f03e632adcdc6677fd5f471c74f4c71fdf9a"; 15 | hash = "sha256-zOQQvbkXq71t2E4x45oM4MzVRlZ4hhe6RkvgcP8tdYE="; 16 | }; 17 | 18 | buildPhase = '' 19 | mkdir $out 20 | cp $src/* $out 21 | ''; 22 | 23 | meta = with lib; { 24 | description = "Cross platform implementation of a simple system clipboard for yazi file manager"; 25 | homepage = "https://github.com/orhnk/system-clipboard.yazi"; 26 | license = licenses.mit; 27 | maintainers = [ ]; 28 | platforms = platforms.all; 29 | }; 30 | } 31 | -------------------------------------------------------------------------------- /plugins/yamb/hm-module.nix: -------------------------------------------------------------------------------- 1 | { 2 | options = 3 | { 4 | cfg, 5 | mkKeyOption, 6 | ... 7 | }: 8 | { 9 | config, 10 | lib, 11 | pkgs, 12 | ... 13 | }: 14 | { 15 | hotkeys = { 16 | 17 | save = mkKeyOption { 18 | on = [ 19 | "u" 20 | "a" 21 | ]; 22 | run = "plugin yamb save"; 23 | desc = "Add bookmark"; 24 | }; 25 | jump = mkKeyOption { 26 | on = [ 27 | "u" 28 | "g" 29 | ]; 30 | run = "plugin yamb jump_by_key"; 31 | desc = "Jump bookmark by key"; 32 | }; 33 | jumpByFzf = mkKeyOption { 34 | on = [ 35 | "u" 36 | "G" 37 | ]; 38 | run = "plugin yamb jump_by_fzf"; 39 | desc = "Jump bookmark by fzf"; 40 | }; 41 | delete = mkKeyOption { 42 | on = [ 43 | "u" 44 | "d" 45 | ]; 46 | run = "plugin yamb delete_by_key"; 47 | desc = "Delete bookmark by key"; 48 | }; 49 | deleteByFzf = mkKeyOption { 50 | on = [ 51 | "u" 52 | "D" 53 | ]; 54 | run = "plugin yamb delete_by_fzf"; 55 | desc = "Delete bookmark by fzf"; 56 | }; 57 | deleteAll = mkKeyOption { 58 | on = [ 59 | "u" 60 | "A" 61 | ]; 62 | run = "plugin yamb delete_all"; 63 | desc = "Delete all bookmarks"; 64 | }; 65 | rename = mkKeyOption { 66 | on = [ 67 | "u" 68 | "r" 69 | ]; 70 | run = "plugin yamb rename_by_key"; 71 | desc = "Rename bookmark by key"; 72 | }; 73 | renameByFzf = mkKeyOption { 74 | on = [ 75 | "u" 76 | "R" 77 | ]; 78 | run = "plugin yamb rename_by_fzf"; 79 | desc = "Rename bookmark by fzf"; 80 | }; 81 | }; 82 | bookmarks = lib.mkOption { 83 | type = 84 | with lib.types; 85 | listOf (submodule { 86 | options = { 87 | tag = lib.mkOption { 88 | type = with lib.types; str; 89 | description = "A Tag / Name for a bookmark"; 90 | }; 91 | path = lib.mkOption { 92 | type = with lib.types; either str path; 93 | description = "The path of the bookmarked item"; 94 | }; 95 | key = lib.mkOption { 96 | type = with lib.types; strMatching "^.$"; # single char 97 | description = "A shortcut to jump to the bookmarks quickly"; 98 | }; 99 | }; 100 | }); 101 | description = "Declarative bookmarks for yamb"; 102 | example = [ 103 | { 104 | tag = "Desktop"; 105 | path = "$HOME/Deskop"; 106 | key = "d"; 107 | } 108 | ]; 109 | default = [ ]; 110 | }; 111 | jump_notify = lib.mkOption { 112 | type = with lib.types; bool; 113 | description = "Recieve notification everytime you jump."; 114 | default = true; 115 | }; 116 | cli = lib.mkOption { 117 | type = with lib.types; either package str; 118 | description = "The CLI for fzf: either a string containing the command to be executed, or package containing an executable. If this option is a package, the package will be included as a runtime dependancy for yamb and the executable in the package will be used as the CLI command."; 119 | example = [ 120 | "fzf" 121 | pkgs.fzf 122 | ]; 123 | default = pkgs.fzf; 124 | }; 125 | keys = lib.mkOption { 126 | type = with lib.types; separatedString ""; 127 | description = "A string used for randomly generating keys, where the preceding characters have higher priority"; 128 | default = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; 129 | }; 130 | path = lib.mkOption { 131 | type = with lib.types; nullOr str; 132 | description = "The path of bookmarks"; 133 | default = "${config.home.homeDirectory}/.config/yazi/bookmark"; 134 | }; 135 | }; 136 | config = 137 | { 138 | cfg, 139 | setKeys, 140 | ... 141 | }: 142 | { lib, pkgs, ... }: 143 | let 144 | yambConfig = lib.attrsets.filterAttrs (name: val: val != null && name != "hotkeys") cfg; 145 | in 146 | lib.mkMerge [ 147 | (setKeys cfg.hotkeys) 148 | { 149 | programs.yazi.yaziPlugins = { 150 | # yambConfig.cli is either string or package: 151 | # if string, just insert the option 152 | # if package, add it to runtimeDeps and get the executable from the package 153 | require.yamb = yambConfig // { 154 | cli = if builtins.isString yambConfig.cli then yambConfig.cli else lib.getExe yambConfig.cli; 155 | }; 156 | runtimeDeps = if builtins.isString yambConfig.cli then [ ] else [ yambConfig.cli ]; 157 | }; 158 | } 159 | ]; 160 | } 161 | -------------------------------------------------------------------------------- /plugins/yamb/package.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | stdenv, 4 | fetchFromGitHub, 5 | }: 6 | stdenv.mkDerivation { 7 | pname = "yaziPlugins-yamb"; 8 | version = "unstable-2025-02-28"; 9 | 10 | src = fetchFromGitHub { 11 | owner = "h-hg"; 12 | repo = "yamb.yazi"; 13 | rev = "22af0033be18eead7b04c2768767d38ccfbaa05b"; 14 | hash = "sha256-NMxZ8/7HQgs+BsZeH4nEglWsRH2ibAzq7hRSyrtFDTA="; 15 | }; 16 | 17 | buildPhase = '' 18 | mkdir $out 19 | cp $src/* $out 20 | ''; 21 | 22 | meta = with lib; { 23 | description = "A Yazi plugin for bookmark management."; 24 | homepage = "https://github.com/dedukun/bookmarks.yazi"; 25 | license = licenses.mit; 26 | maintainers = [ ]; 27 | platforms = platforms.all; 28 | }; 29 | } 30 | --------------------------------------------------------------------------------