From aa292f3a4282c0aed21bccc434c3a1a061c245ac Mon Sep 17 00:00:00 2001 From: derped Date: Tue, 26 May 2020 16:30:51 +0200 Subject: [PATCH] Add a couple of small utilities and wire them up. --- config/etc.nix | 7 ++++--- config/zsh.nix | 12 +++++++++++- pkgsets/base.nix | 2 ++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/config/etc.nix b/config/etc.nix index d4a2b3f..e541613 100644 --- a/config/etc.nix +++ b/config/etc.nix @@ -12,9 +12,10 @@ with lib; }; environment.variables = mkIf (elem "etcvars" config.machine.conffiles) { - NIXPKGS_ALLOW_UNFREE="1"; - WINEDLLOVERRIDES="winemenubuilder.exe=d"; - LC_CTYPE="zh_CN.UTF-8"; + LC_CTYPE = "zh_CN.UTF-8"; + MANPAGER = "sh -c 'col -bx | bat -l man -p'"; + NIXPKGS_ALLOW_UNFREE = "1"; + WINEDLLOVERRIDES = "winemenubuilder.exe=d"; # This breaks a lot of applications # QT_SCALE_FACTOR="0.7"; }; diff --git a/config/zsh.nix b/config/zsh.nix index 4e5c5a7..019c11c 100644 --- a/config/zsh.nix +++ b/config/zsh.nix @@ -7,6 +7,17 @@ mkIf (elem "zsh" config.machine.conffiles) { enable = true; autosuggestions.enable = true; syntaxHighlighting.enable = true; + shellAliases = { + cat = ''bat --paging=never --theme="Solarized (dark)"''; + less = ''bat --paging=always --style=changes --color=always --theme="Solarized (dark)"''; + ls = "exa"; + l = "exa -abgHhl@ --git --color=always --group-directories-first"; + tree = "exa --tree --color=always"; + }; + shellInit = '' + function ll() { exa -abgHhl@ --git --color=always --group-directories-first $@ | bat --paging=always --style=changes --color=always --theme="Solarized (dark)" } + function lln() { exa -abgHhl@ --git --color=always --group-directories-first $@ | bat --paging=always --style=changes --color=always --theme="Solarized (dark)" -n} + ''; ohMyZsh = { enable = true; plugins = [ "cabal" "docker" "gitfast" "python" "pip" "sudo" "systemd" "man" ]; @@ -14,4 +25,3 @@ mkIf (elem "zsh" config.machine.conffiles) { }; }; } - diff --git a/pkgsets/base.nix b/pkgsets/base.nix index d43d6af..9d7374e 100644 --- a/pkgsets/base.nix +++ b/pkgsets/base.nix @@ -8,6 +8,7 @@ cryptsetup dhcpcd dnsutils + exa finger_bsd gitFull gnupg @@ -44,6 +45,7 @@ ripgrep rsync sysvtools + tealdeer telnet traceroute tree