2022-10-23 19:22:14 +00:00
|
|
|
{ config, ... }:
|
|
|
|
|
|
|
|
{
|
|
|
|
programs.k9s = {
|
|
|
|
enable = true;
|
|
|
|
package = config.lib.test.mkStubPackage { };
|
|
|
|
|
|
|
|
settings = {
|
|
|
|
k9s = {
|
|
|
|
refreshRate = 2;
|
|
|
|
maxConnRetry = 5;
|
|
|
|
enableMouse = true;
|
|
|
|
headless = false;
|
2024-01-21 23:17:27 +00:00
|
|
|
ui.skin = "default";
|
2022-10-23 19:22:14 +00:00
|
|
|
};
|
|
|
|
};
|
2023-11-01 17:40:14 +00:00
|
|
|
hotkey = {
|
|
|
|
hotKey = {
|
|
|
|
shift-0 = {
|
|
|
|
shortCut = "Shift-0";
|
|
|
|
description = "Viewing pods";
|
|
|
|
command = "pods";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2024-01-21 23:17:27 +00:00
|
|
|
skins = {
|
|
|
|
"default" = {
|
|
|
|
k9s = {
|
|
|
|
body = {
|
|
|
|
fgColor = "dodgerblue";
|
|
|
|
bgColor = "#ffffff";
|
|
|
|
logoColor = "#0000ff";
|
|
|
|
};
|
|
|
|
info = {
|
|
|
|
fgColor = "lightskyblue";
|
|
|
|
sectionColor = "steelblue";
|
|
|
|
};
|
2022-10-23 19:22:14 +00:00
|
|
|
};
|
2024-01-21 23:17:27 +00:00
|
|
|
};
|
|
|
|
"alt-skin" = {
|
|
|
|
k9s = {
|
|
|
|
body = {
|
|
|
|
fgColor = "orangered";
|
|
|
|
bgColor = "#ffffff";
|
|
|
|
logoColor = "#0000ff";
|
|
|
|
};
|
|
|
|
info = {
|
|
|
|
fgColor = "red";
|
|
|
|
sectionColor = "mediumvioletred";
|
|
|
|
};
|
2022-10-23 19:22:14 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2023-11-02 06:51:00 +00:00
|
|
|
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" ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2022-10-23 19:22:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nmt.script = ''
|
2024-01-21 23:17:27 +00:00
|
|
|
assertFileExists home-files/.config/k9s/config.yaml
|
|
|
|
assertFileContent \
|
|
|
|
home-files/.config/k9s/config.yaml \
|
|
|
|
${./example-config-expected.yaml}
|
|
|
|
assertFileExists home-files/.config/k9s/skins/default.yaml
|
2022-10-23 19:22:14 +00:00
|
|
|
assertFileContent \
|
2024-01-21 23:17:27 +00:00
|
|
|
home-files/.config/k9s/skins/default.yaml \
|
|
|
|
${./example-skin-expected.yaml}
|
|
|
|
assertFileExists home-files/.config/k9s/skins/alt-skin.yaml
|
2022-10-23 19:22:14 +00:00
|
|
|
assertFileContent \
|
2024-01-21 23:17:27 +00:00
|
|
|
home-files/.config/k9s/skins/alt-skin.yaml \
|
|
|
|
${./example-skin-expected-alt.yaml}
|
|
|
|
assertFileExists home-files/.config/k9s/hotkey.yaml
|
2023-11-01 17:40:14 +00:00
|
|
|
assertFileContent \
|
2024-01-21 23:17:27 +00:00
|
|
|
home-files/.config/k9s/hotkey.yaml \
|
|
|
|
${./example-hotkey-expected.yaml}
|
|
|
|
assertFileExists home-files/.config/k9s/aliases.yaml
|
2023-11-02 06:51:00 +00:00
|
|
|
assertFileContent \
|
2024-01-21 23:17:27 +00:00
|
|
|
home-files/.config/k9s/aliases.yaml \
|
|
|
|
${./example-aliases-expected.yaml}
|
|
|
|
assertFileExists home-files/.config/k9s/plugin.yaml
|
2023-11-02 06:51:00 +00:00
|
|
|
assertFileContent \
|
2024-01-21 23:17:27 +00:00
|
|
|
home-files/.config/k9s/plugin.yaml \
|
|
|
|
${./example-plugin-expected.yaml}
|
|
|
|
assertFileExists home-files/.config/k9s/views.yaml
|
2023-11-02 06:51:00 +00:00
|
|
|
assertFileContent \
|
2024-01-21 23:17:27 +00:00
|
|
|
home-files/.config/k9s/views.yaml \
|
|
|
|
${./example-views-expected.yaml}
|
2022-10-23 19:22:14 +00:00
|
|
|
'';
|
|
|
|
}
|