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)}"
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,21 +1,16 @@
|
||||||
{
|
{
|
||||||
fetch-rs,
|
fetch-rs,
|
||||||
pkgs,
|
pkgs,
|
||||||
config,
|
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
systemd.tmpfiles.rules = [ "d /tmp/neovim-page 0777 root root - -" ];
|
|
||||||
environment = {
|
environment = {
|
||||||
systemPackages = builtins.attrValues {
|
systemPackages = builtins.attrValues {
|
||||||
inherit (pkgs) page eza fzf;
|
inherit (pkgs) eza fzf;
|
||||||
inherit (fetch-rs.packages) fetch-rs;
|
inherit (fetch-rs.packages) fetch-rs;
|
||||||
};
|
};
|
||||||
variables = {
|
variables = {
|
||||||
EDITOR = "nvim";
|
EDITOR = "nvim";
|
||||||
VISUAL = "nvim";
|
VISUAL = "nvim";
|
||||||
PAGER = "page -WC -q 90000 -z 90000";
|
|
||||||
SYSTEMD_PAGERSECURE = "true";
|
|
||||||
MANPAGER = "page -t man";
|
|
||||||
};
|
};
|
||||||
shellAliases = {
|
shellAliases = {
|
||||||
#paste link trick
|
#paste link trick
|
||||||
|
|
@ -36,7 +31,6 @@
|
||||||
lx = "eza -lbhHigUmuSa@ --time-style=long-iso --git --color-scale";
|
lx = "eza -lbhHigUmuSa@ --time-style=long-iso --git --color-scale";
|
||||||
lS = "eza -1";
|
lS = "eza -1";
|
||||||
lt = "eza --tree --level=2";
|
lt = "eza --tree --level=2";
|
||||||
page = config.environment.variables.PAGER;
|
|
||||||
};
|
};
|
||||||
interactiveShellInit = "fetch-rs";
|
interactiveShellInit = "fetch-rs";
|
||||||
};
|
};
|
||||||
|
|
@ -58,12 +52,6 @@
|
||||||
bindkey '^[[B' history-substring-search-down
|
bindkey '^[[B' history-substring-search-down
|
||||||
### fzf-tab ###
|
### fzf-tab ###
|
||||||
source ${pkgs.zsh-fzf-tab}/share/fzf-tab/fzf-tab.plugin.zsh
|
source ${pkgs.zsh-fzf-tab}/share/fzf-tab/fzf-tab.plugin.zsh
|
||||||
### pager ###
|
|
||||||
man () {
|
|
||||||
PROGRAM="''${@[-1]}"
|
|
||||||
SECTION="''${@[-2]}"
|
|
||||||
page -W "man://$PROGRAM''${SECTION:+($SECTION)}"
|
|
||||||
}
|
|
||||||
### transient shell prompt ###
|
### transient shell prompt ###
|
||||||
zle-line-init() {
|
zle-line-init() {
|
||||||
emulate -L zsh
|
emulate -L zsh
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue