aboutsummaryrefslogtreecommitdiff
path: root/nix
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2025-04-07 07:01:08 -0700
committerFranck Cuny <franck@fcuny.net>2025-04-14 08:26:46 -0700
commit2ef065c24570d7a8b017108b9c9e281886d26f18 (patch)
tree9af7ce01d3761c4bd47c15a0d4d27c3ddd623c3b /nix
parentMerge pull request #16 from fcuny/update_flake_lock_action (diff)
downloadinfra-2ef065c24570d7a8b017108b9c9e281886d26f18.tar.gz
install bat and configure it for k9s
Diffstat (limited to 'nix')
-rw-r--r--nix/users/fcuny/k8s.nix58
-rw-r--r--nix/users/fcuny/shell.nix7
2 files changed, 64 insertions, 1 deletions
diff --git a/nix/users/fcuny/k8s.nix b/nix/users/fcuny/k8s.nix
index cbc04ef..8e82a70 100644
--- a/nix/users/fcuny/k8s.nix
+++ b/nix/users/fcuny/k8s.nix
@@ -7,12 +7,68 @@
kubernetes-helm # deploy applications
kubie # kubeconfig browser https://github.com/sbstp/kubie
kubelogin-oidc # OIDC plugin
- k9s # object explorer
# docker
dive # explore layers in docker images
];
+ programs.k9s = {
+ enable = true;
+ settings = {
+ k9s = {
+ refreshRate = 1;
+ };
+ };
+ plugin = {
+ plugins = {
+ log-bat = {
+ shortCut = "Shift-L";
+ description = "Logs (bat)";
+ scopes = [ "po" ];
+ command = "bash";
+ background = false;
+ args = [
+ "-c"
+ "\"$@\" | bat"
+ "dummy-arg"
+ "kubectl"
+ "logs"
+ "$NAME"
+ "-n"
+ "$NAMESPACE"
+ "--context"
+ "$CONTEXT"
+ "--kubeconfig"
+ "$KUBECONFIG"
+ ];
+ };
+ log-bat-container = {
+ shortCut = "Shift-L";
+ description = "Logs (bat)";
+ scopes = [ "containers" ];
+ command = "bash";
+ background = false;
+ args = [
+ "-c"
+ "\"$@\" | bat"
+ "dummy-arg"
+ "kubectl"
+ "logs"
+ "-c"
+ "$NAME"
+ "$POD"
+ "-n"
+ "$NAMESPACE"
+ "--context"
+ "$CONTEXT"
+ "--kubeconfig"
+ "$KUBECONFIG"
+ ];
+ };
+ };
+ };
+ };
+
home.file.kubie = {
target = ".kube/kubie.yaml";
text = ''
diff --git a/nix/users/fcuny/shell.nix b/nix/users/fcuny/shell.nix
index f5d83e5..5d10385 100644
--- a/nix/users/fcuny/shell.nix
+++ b/nix/users/fcuny/shell.nix
@@ -91,6 +91,13 @@ in
};
};
+ programs.bat = {
+ enable = true;
+ config = {
+ pager = "less -FR";
+ };
+ };
+
programs.starship = {
enable = true;
settings = {