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.
No edit summary
Line 11: Line 11:


==== Using global configuration ====
==== Using global configuration ====
<syntaxhighlight lang="text">
<syntaxhighlight lang="nix">programs.yazi = {
environment.systemPackages = [
  enable = true;
  pkgs.yazi
  # There are more options available:
];
  # https://search.nixos.org/options?channel=unstable&type=packages&query=programs.yazi
</syntaxhighlight>After modifying your configuration, apply the changes by running:<syntaxhighlight lang="bash">
};</syntaxhighlight>After modifying your configuration, apply the changes by running:<syntaxhighlight lang="bash">sudo nixos-rebuild switch</syntaxhighlight>
sudo nixos-rebuild switch
</syntaxhighlight>


==== Using home configuration ====
==== Using home configuration ====
<syntaxhighlight lang="text">
<syntaxhighlight lang="nix">programs.yazi = {
home.packages = [
  enable = true;
   pkgs.yazi  
   # There are more options available:
];
  # https://nix-community.github.io/home-manager/options.xhtml#opt-programs.yazi.enable
</syntaxhighlight>After updating your configuration, apply the changes by running:<syntaxhighlight lang="bash">
};</syntaxhighlight>After updating your configuration, apply the changes by running:<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 ====
==== Advanced Example ====
<syntaxhighlight lang="nix">
programs.yazi = {
    enable = true;
};
</syntaxhighlight>
 
==== Advanced ====
<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
programs.yazi = {
programs.yazi = {
Line 98: Line 90:
# Global
# Global
environment.systemPackages = [ yazi.packages.${pkgs.system}.default ];
environment.systemPackages = [ yazi.packages.${pkgs.system}.default ];
# or, if you use the module
programs.yazi.package = yazi.packages.${pkgs.system}.default;


# Home Manager
# Home Manager
home.packages = [ yazi.packages.${pkgs.system}.default ];            
home.packages = [ yazi.packages.${pkgs.system}.default ];
# or, if you use the module
programs.yazi.package = yazi.packages.${pkgs.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 = {