From 9f3a8ac2bd7a820fab4ffd2b8a468a68298abb03 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Wed, 3 May 2023 20:19:17 +0100 Subject: [PATCH] home: zsh: extract aliases It doesn't (yet?) support nushell, if I ever end up switching to it. --- home/aliases/default.nix | 26 ++++++++++++++++++++++++++ home/default.nix | 1 + home/zsh/default.nix | 13 ------------- 3 files changed, 27 insertions(+), 13 deletions(-) create mode 100644 home/aliases/default.nix diff --git a/home/aliases/default.nix b/home/aliases/default.nix new file mode 100644 index 0000000..259f148 --- /dev/null +++ b/home/aliases/default.nix @@ -0,0 +1,26 @@ +{ config, lib, ... }: +let + cfg = config.my.home.aliases; +in +{ + options.my.home.aliases = with lib; { + enable = my.mkDisableOption "shell aliases configuration"; + }; + + config = lib.mkIf cfg.enable { + home = { + shellAliases = { + # I like pretty colors + diff = "diff --color=auto"; + grep = "grep --color=auto"; + egrep = "egrep --color=auto"; + fgrep = "fgrep --color=auto"; + ls = "ls --color=auto"; + + # Well-known ls aliases + l = "ls -alh"; + ll = "ls -l"; + }; + }; + }; +} diff --git a/home/default.nix b/home/default.nix index c851f76..42d365b 100644 --- a/home/default.nix +++ b/home/default.nix @@ -1,6 +1,7 @@ { ... }: { imports = [ + ./aliases ./atuin ./bat ./bluetooth diff --git a/home/zsh/default.nix b/home/zsh/default.nix index 994a652..2e645c2 100644 --- a/home/zsh/default.nix +++ b/home/zsh/default.nix @@ -88,19 +88,6 @@ in AGKOZAK_LEFT_PROMPT_ONLY = 1; }; - shellAliases = { - # I like pretty colors - diff = "diff --color=auto"; - grep = "grep --color=auto"; - egrep = "egrep --color=auto"; - fgrep = "fgrep --color=auto"; - ls = "ls --color=auto"; - - # Well-known ls aliases - l = "ls -alh"; - ll = "ls -l"; - }; - # Enable VTE integration enableVteIntegration = true; };