1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-14 15:19:45 +01:00
home-manager/tests/modules/programs/k9s/example-settings.nix
Paul Meyer c5f0d02e3c
k9s: add aliases, plugins, views
Adding the remaining config files of k9s that weren't covered yet.

PR #4627
2024-04-10 21:26:35 +02:00

89 lines
2.2 KiB
Nix

{ config, ... }:
{
programs.k9s = {
enable = true;
package = config.lib.test.mkStubPackage { };
settings = {
k9s = {
refreshRate = 2;
maxConnRetry = 5;
enableMouse = true;
headless = false;
};
};
hotkey = {
hotKey = {
shift-0 = {
shortCut = "Shift-0";
description = "Viewing pods";
command = "pods";
};
};
};
skin = {
k9s = {
body = {
fgColor = "dodgerblue";
bgColor = "#ffffff";
logoColor = "#0000ff";
};
info = {
fgColor = "lightskyblue";
sectionColor = "steelblue";
};
};
};
aliases = { alias = { pp = "v1/pods"; }; };
plugin = {
plugin = {
fred = {
shortCut = "Ctrl-L";
description = "Pod logs";
scopes = [ "po" ];
command = "kubectl";
background = false;
args =
[ "logs" "-f" "$NAME" "-n" "$NAMESPACE" "--context" "$CLUSTER" ];
};
};
};
views = {
k9s = {
views = {
"v1/pods" = {
columns = [ "AGE" "NAMESPACE" "NAME" "IP" "NODE" "STATUS" "READY" ];
};
};
};
};
};
nmt.script = ''
assertFileExists home-files/.config/k9s/config.yml
assertFileContent \
home-files/.config/k9s/config.yml \
${./example-config-expected.yml}
assertFileExists home-files/.config/k9s/skin.yml
assertFileContent \
home-files/.config/k9s/skin.yml \
${./example-skin-expected.yml}
assertFileExists home-files/.config/k9s/hotkey.yml
assertFileContent \
home-files/.config/k9s/hotkey.yml \
${./example-hotkey-expected.yml}
assertFileExists home-files/.config/k9s/aliases.yml
assertFileContent \
home-files/.config/k9s/aliases.yml \
${./example-aliases-expected.yml}
assertFileExists home-files/.config/k9s/plugin.yml
assertFileContent \
home-files/.config/k9s/plugin.yml \
${./example-plugin-expected.yml}
assertFileExists home-files/.config/k9s/views.yml
assertFileContent \
home-files/.config/k9s/views.yml \
${./example-views-expected.yml}
'';
}