Docs: add Nix and NixOS install instructions

This commit is contained in:
Nehctarg 2023-05-31 10:57:43 +02:00 committed by Nikita Ivanov
parent 930535cbea
commit 13aa7a3a1b
No known key found for this signature in database
GPG Key ID: 6E656AC5B97B5133

View File

@ -109,6 +109,34 @@ package.
sudo port install ctpv
```
### Nix
#### Nix package
```console
nix-env -ivf cptv
nix profile install nixpkgs#cptv # with flakes enabled
```
#### NixOS and HomeManager
If you don't need to call it directly and
just want to use it through lf:
```nix
programs.lf = {
previewer = {
keybinding = "i";
source = "${pkgs.ctpv}/bin/ctpv";
};
extraConfig = ''
&${pkgs.ctpv}/bin/ctpv -s $id
cmd on-quit %${pkgs.ctpv}/bin/ctpv -e $id
set cleaner ${pkgs.ctpv}/bin/ctpvclear
'';
}
```
## Integration
### lf file manager