Yazi: Difference between revisions

m Fixed a incorrect usage of the word "Afterwords", which is normally used to mean "epilogue" / "postsript" / "appendix", see https://en.wiktionary.org/wiki/afterword. The correct word in this context is "Afterwards", see https://en.wiktionary.org/wiki/afterwards.
Eydee (talk | contribs)
m remove duplicate schema in URL
 
(5 intermediate revisions by 4 users not shown)
Line 5: Line 5:
== Installation ==
== Installation ==


==== Using nix-shell ====
There are several ways to install Yazi on NixOS.
<syntaxhighlight lang="bash" start="3">
 
=== Temporary Shell ===
To temporarily use Yazi in your current shell session, run:
<syntaxhighlight lang="bash">
nix-shell -p yazi
nix-shell -p yazi
</syntaxhighlight>
</syntaxhighlight>


==== Using global configuration ====
=== System-wide ===
<syntaxhighlight lang="text">
To install Yazi for all users on the system, add it to your {{ic|configuration.nix}}:
environment.systemPackages = [
<syntaxhighlight lang="nix">
  pkgs.yazi
programs.yazi.enable = true;
];
</syntaxhighlight>
</syntaxhighlight>After modifying your configuration, apply the changes by running:<syntaxhighlight lang="bash">
 
After adding the option, rebuild your system:
<syntaxhighlight lang="bash">
sudo nixos-rebuild switch
sudo nixos-rebuild switch
</syntaxhighlight>
</syntaxhighlight>


==== Using home configuration ====
=== Home Manager ===
<syntaxhighlight lang="text">
To install Yazi for a single user, add it to your Home Manager configuration:
home.packages = [
<syntaxhighlight lang="nix">
  pkgs.yazi
programs.yazi.enable = true;
];
</syntaxhighlight>
</syntaxhighlight>After updating your configuration, apply the changes by running:<syntaxhighlight lang="bash">
 
After adding the option, apply the changes:
<syntaxhighlight lang="bash">
home-manager switch
home-manager switch
</syntaxhighlight>
</syntaxhighlight>


== Configuration ==
== Configuration ==
 
As mentioned above, there are both [https://search.nixos.org/options?channel=unstable&from=0&size=50&sort=relevance&type=packages&query=programs.yazi NixOS options] and [https://nix-community.github.io/home-manager/options.xhtml#opt-programs.yazi.enable home-manager options] for configuring Yazi.
==== Basic ====
<syntaxhighlight lang="nix">
programs.yazi = {
    enable = true;
};
</syntaxhighlight>


==== Advanced ====
==== Advanced ====
Line 85: Line 86:
== Tips and Tricks ==
== Tips and Tricks ==


==== Location of options ====
==== Installing Plugins ====
The home manager options are defined in the following [https://nix-community.github.io/home-manager/options.xhtml#opt-programs.yazi.enable Home Manager Options Manual].
Many yazi plugins are [https://search.nixos.org/packages?channel=unstable&from=0&size=50&buckets=%7B%22package_attr_set%22%3A%5B%22yaziPlugins%22%5D%2C%22package_license_set%22%3A%5B%5D%2C%22package_maintainers_set%22%3A%5B%5D%2C%22package_platforms%22%3A%5B%5D%7D&sort=relevance&type=packages&query=yaziPlugins packaged in nixpkgs].


The system-wide options are listed on {{nixos:option|programs.yazi.*}}.
There are some additional yazi plugins packaged in the [https://github.com/lordkekz/nix-yazi-plugins nix-yazi-plugins] flake. It also provides home-manager modules for configuring the plugins' options.


==== Bleeding edge ====
==== Bleeding edge ====
Line 97: Line 98:
</syntaxhighlight>Afterwards, you can use the new package.<syntaxhighlight lang="nix">
</syntaxhighlight>Afterwards, you can use the new package.<syntaxhighlight lang="nix">
# Global
# Global
environment.systemPackages = [ yazi.packages.${pkgs.system}.default ];
environment.systemPackages = [ yazi.packages.${pkgs.stdenv.hostPlatform.system}.default ];
# or, if you use the module
programs.yazi.package = yazi.packages.${pkgs.stdenv.hostPlatform.system}.default;


# Home Manager
# Home Manager
home.packages = [ yazi.packages.${pkgs.system}.default ];            
home.packages = [ yazi.packages.${pkgs.stdenv.hostPlatform.system}.default ];
# or, if you use the module
programs.yazi.package = yazi.packages.${pkgs.stdenv.hostPlatform.system}.default;
</syntaxhighlight>Pre-built artifacts are served at https://yazi.cachix.org, so that Nix users don't have to build Yazi on their machine.<ref>https://yazi-rs.github.io/docs/installation/#cache</ref><syntaxhighlight lang="nix">
</syntaxhighlight>Pre-built artifacts are served at https://yazi.cachix.org, so that Nix users don't have to build Yazi on their machine.<ref>https://yazi-rs.github.io/docs/installation/#cache</ref><syntaxhighlight lang="nix">
nix = {
nix = {
Line 152: Line 157:


== Troubleshooting ==
== Troubleshooting ==
===RAR file extraction===
By default, yazi depends on _7zz in nixpkgs for extraction and previewing purposes. This does not support RAR files by default. To enable support, you can override the _7zz in the dependencies into unfree rar version.
<syntaxHighlight lang=text>
pkgs.yazi.override {_7zz = pkgs._7zz-rar; }
</syntaxHighlight>
== See also ==
*[https://search.nixos.org/options?channel=unstable&query=programs.yazi NixOS options for Yazi]
*[https://yazi-rs.github.io/docs/installation/ Yazi official documentation]


== References ==
== References ==
[[Category:Applications]]
[[Category:Applications]]
[[Category:File Manager]]
[[Category:File Manager]]