1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-24 12:09:46 +01:00
home-manager/tests/modules/programs/k9s/example-settings.nix

117 lines
3 KiB
Nix
Raw Normal View History

{ config, pkgs, lib, ... }:
2022-10-23 21:22:14 +02:00
{
xdg.enable = lib.mkIf pkgs.stdenv.isDarwin (lib.mkForce false);
2022-10-23 21:22:14 +02:00
programs.k9s = {
enable = true;
package = config.lib.test.mkStubPackage { };
settings = {
k9s = {
refreshRate = 2;
maxConnRetry = 5;
enableMouse = true;
headless = false;
ui.skin = "default";
2022-10-23 21:22:14 +02:00
};
};
hotkey = {
hotKey = {
shift-0 = {
shortCut = "Shift-0";
description = "Viewing pods";
command = "pods";
};
};
};
skins = {
"default" = {
k9s = {
body = {
fgColor = "dodgerblue";
bgColor = "#ffffff";
logoColor = "#0000ff";
};
info = {
fgColor = "lightskyblue";
sectionColor = "steelblue";
};
2022-10-23 21:22:14 +02:00
};
};
"alt-skin" = {
k9s = {
body = {
fgColor = "orangered";
bgColor = "#ffffff";
logoColor = "#0000ff";
};
info = {
fgColor = "red";
sectionColor = "mediumvioletred";
};
2022-10-23 21:22:14 +02: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 21:22:14 +02:00
};
nmt.script = let
configDir = if !pkgs.stdenv.isDarwin then
".config/k9s"
else
"Library/Application Support/k9s";
in ''
assertFileExists "home-files/${configDir}/config.yaml"
assertFileContent \
"home-files/${configDir}/config.yaml" \
${./example-config-expected.yaml}
assertFileExists "home-files/${configDir}/skins/default.yaml"
2022-10-23 21:22:14 +02:00
assertFileContent \
"home-files/${configDir}/skins/default.yaml" \
${./example-skin-expected.yaml}
assertFileExists "home-files/${configDir}/skins/alt-skin.yaml"
2022-10-23 21:22:14 +02:00
assertFileContent \
"home-files/${configDir}/skins/alt-skin.yaml" \
${./example-skin-expected-alt.yaml}
assertFileExists "home-files/${configDir}/hotkeys.yaml"
assertFileContent \
"home-files/${configDir}/hotkeys.yaml" \
${./example-hotkey-expected.yaml}
assertFileExists "home-files/${configDir}/aliases.yaml"
assertFileContent \
"home-files/${configDir}/aliases.yaml" \
${./example-aliases-expected.yaml}
assertFileExists "home-files/${configDir}/plugins.yaml"
assertFileContent \
"home-files/${configDir}/plugins.yaml" \
${./example-plugin-expected.yaml}
assertFileExists "home-files/${configDir}/views.yaml"
assertFileContent \
"home-files/${configDir}/views.yaml" \
${./example-views-expected.yaml}
2022-10-23 21:22:14 +02:00
'';
}