From b2cad2defae246ee8358975e388d97b034df6807 Mon Sep 17 00:00:00 2001 From: SebastianStork Date: Sat, 23 Nov 2024 00:02:10 +0100 Subject: [PATCH] Exempt aliases.nix from auto formatting --- flake/treefmt.nix | 1 + modules/home/shell/aliases.nix | 57 ++++------------------------------ 2 files changed, 7 insertions(+), 51 deletions(-) diff --git a/flake/treefmt.nix b/flake/treefmt.nix index af14ed2..c4ef1b0 100644 --- a/flake/treefmt.nix +++ b/flake/treefmt.nix @@ -6,4 +6,5 @@ prettier.enable = true; just.enable = true; }; + settings.formatter.nixfmt.excludes = [ "modules/home/shell/aliases.nix" ]; }).config.build diff --git a/modules/home/shell/aliases.nix b/modules/home/shell/aliases.nix index 57bd624..52d4dbc 100644 --- a/modules/home/shell/aliases.nix +++ b/modules/home/shell/aliases.nix @@ -11,64 +11,19 @@ pkgs.bat ]; - home.shellAliases = + home.shellAliases = let - lsAliases = + lsAliases = let - aliasList = - lib.mapCartesianProduct - ( - { - a, - b, - c, - }: - a + b + c - ) - { - a = [ - "ll" - "lt" - "l" - ]; - b = [ - "" - "a" - ]; - c = [ - "" - "d" - "f" - ]; - }; - convertAliasToCmd = - str: - "eza --header --group --time-style=long-iso --group-directories-first --sort=name --icons=auto --git --git-repos-no-status --binary " - + (builtins.replaceStrings - [ - "ll" - "lt" - "l" - "a" - "d" - "f" - ] - [ - "--long " - "--tree " - "--oneline --dereference " - "--all " - "--only-dirs " - "--only-files " - ] - str - ); + aliasList = lib.mapCartesianProduct ({ a, b, c }: a + b + c) { a = ["ll" "lt" "l"]; b = ["" "a"]; c = ["" "d" "f"]; }; + eza = "eza --header --group --time-style=long-iso --group-directories-first --sort=name --icons=auto --git --git-repos-no-status --binary "; + convertAliasToCmd = str: eza + (builtins.replaceStrings ["ll" "lt" "l" "a" "d" "f"] ["--long " "--tree " "--oneline --dereference " "--all " "--only-dirs " "--only-files "] str); in (lib.genAttrs aliasList convertAliasToCmd) // { ls = "l"; }; catAlias = let - theme = + theme = { dark = ""; light = "GitHub";