mirror of
https://github.com/Gerg-L/nixos.git
synced 2025-12-10 00:43:56 -05:00
shell.nix: split page to page.nix
This commit is contained in:
parent
4d7eaf72e7
commit
f46ac4cd5b
2 changed files with 24 additions and 13 deletions
23
modules/page.nix
Normal file
23
modules/page.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{ pkgs, config }:
|
||||
{
|
||||
systemd.tmpfiles.rules = [ "d /tmp/neovim-page 0777 root root - -" ];
|
||||
|
||||
environment = {
|
||||
systemPackages = [ pkgs.page ];
|
||||
variables = {
|
||||
PAGER = "page -WC -q 90000 -z 90000";
|
||||
SYSTEMD_PAGERSECURE = "true";
|
||||
MANPAGER = "page -t man";
|
||||
};
|
||||
shellAliases.page = config.environment.variables.PAGER;
|
||||
};
|
||||
|
||||
programs.zsh.interactiveShellInit = ''
|
||||
man () {
|
||||
PROGRAM="''${@[-1]}"
|
||||
SECTION="''${@[-2]}"
|
||||
page -W "man://$PROGRAM''${SECTION:+($SECTION)}"
|
||||
}
|
||||
'';
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue