From 880c97dff896ac43c6c579dfdabcb405fd1ffc6d Mon Sep 17 00:00:00 2001 From: Nickolaj Jepsen Date: Sun, 23 Feb 2025 23:19:39 +0100 Subject: [PATCH] Chore: update formatter --- .gitignore | 1 + formatter.nix | 20 ++++++++++++++++++-- modules/shell/fish/k8s.fish | 14 +++++++------- modules/shell/fish/theme.fish | 22 +++++++++++----------- 4 files changed, 37 insertions(+), 20 deletions(-) diff --git a/.gitignore b/.gitignore index 38ad937..e256ccc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +result result/ secrets/yubikey-identity.txt diff --git a/formatter.nix b/formatter.nix index c3de1b5..8d858f4 100644 --- a/formatter.nix +++ b/formatter.nix @@ -1,4 +1,10 @@ -{inputs, ...}: { +{ + inputs, + lib, + ... +}: let + mkExtensionIgnore = exts: "*.{${lib.concatStringsSep "," exts}}"; +in { imports = [inputs.treefmt-nix.flakeModule]; perSystem = {config, ...}: { @@ -10,8 +16,18 @@ statix.enable = true; just.enable = true; prettier.enable = true; + fish_indent.enable = true; }; - settings.global.excludes = ["*.{gitignore,svg}"]; + settings.global.excludes = [ + "result" + "*/node_modules/*" + (mkExtensionIgnore [ + "gitignore" + "svg" + "age" + "pub" + ]) + ]; }; formatter = config.treefmt.build.wrapper; }; diff --git a/modules/shell/fish/k8s.fish b/modules/shell/fish/k8s.fish index 563be51..6140450 100644 --- a/modules/shell/fish/k8s.fish +++ b/modules/shell/fish/k8s.fish @@ -1,9 +1,9 @@ -set __kube_verbs get describe delete edit -set __kube_verbs_short g d rm e -set __kube_resource pods deployments services ingresses configmaps daemonsets statefulsets namespace namespace -set __kube_resource_short p d s i c ds ss n ns +set __kube_verbs get describe delete edit +set __kube_verbs_short g d rm e +set __kube_resource pods deployments services ingresses configmaps daemonsets statefulsets namespace namespace +set __kube_resource_short p d s i c ds ss n ns -function __echo_kubeexec; +function __echo_kubeexec set _flag_namespace (kubectl config view --minify --output 'jsonpath={..namespace}') if test -z "$_flag_namespace" set _flag_namespace default @@ -18,7 +18,7 @@ function __echo_kubeexec; echo "kubectl exec --namespace $_flag_namespace -it $POD --" end -function __echo_kubemanage; +function __echo_kubemanage set _flag_namespace (kubectl config view --minify --output 'jsonpath={..namespace}') if test -z "$_flag_namespace" set _flag_namespace default @@ -60,4 +60,4 @@ if type -q kubectl abbr kexec --function __echo_kubeexec abbr kmanage --function __echo_kubemanage -end \ No newline at end of file +end diff --git a/modules/shell/fish/theme.fish b/modules/shell/fish/theme.fish index 6a8f439..6b5645a 100644 --- a/modules/shell/fish/theme.fish +++ b/modules/shell/fish/theme.fish @@ -25,16 +25,16 @@ set -U fish_pager_color_progress brwhite --background=cyan set -U fish_pager_color_completion normal set -U fish_pager_color_description yellow --italics set -U fish_pager_color_selected_background --reverse -set -U fish_pager_color_selected_description -set -U fish_pager_color_selected_completion -set -U fish_pager_color_secondary_completion -set -U fish_pager_color_secondary_background -set -U fish_color_keyword -set -U fish_pager_color_selected_prefix -set -U fish_pager_color_background -set -U fish_pager_color_secondary_prefix -set -U fish_pager_color_secondary_description -set -U fish_color_host_remote +set -U fish_pager_color_selected_description +set -U fish_pager_color_selected_completion +set -U fish_pager_color_secondary_completion +set -U fish_pager_color_secondary_background +set -U fish_color_keyword +set -U fish_pager_color_selected_prefix +set -U fish_pager_color_background +set -U fish_pager_color_secondary_prefix +set -U fish_pager_color_secondary_description +set -U fish_color_host_remote set -U fish_color_option # Bobthefish config @@ -42,4 +42,4 @@ set -g theme_date_timezone Europe/Copenhagen set -g theme_date_format "+%a %H:%M" set -g theme_nerd_fonts yes set -g theme_color_scheme terminal -set -g theme_display_user ssh \ No newline at end of file +set -g theme_display_user ssh