k9s: allow defining custom theme file
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
parent
3d65009eff
commit
ef844d7b62
|
@ -46,7 +46,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
skins = mkOption {
|
skins = mkOption {
|
||||||
type = types.attrsOf yamlFormat.type;
|
type = with types; attrsOf (oneOf [ yamlFormat.type path ]);
|
||||||
default = { };
|
default = { };
|
||||||
description = ''
|
description = ''
|
||||||
Skin files written to {file}`$XDG_CONFIG_HOME/k9s/skins/` (linux)
|
Skin files written to {file}`$XDG_CONFIG_HOME/k9s/skins/` (linux)
|
||||||
|
@ -61,6 +61,7 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
my_red_skin = ./red_skin.yaml;
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -174,7 +175,10 @@ in {
|
||||||
"k9s/skins/${name}.yaml"
|
"k9s/skins/${name}.yaml"
|
||||||
else
|
else
|
||||||
"Library/Application Support/k9s/skins/${name}.yaml") {
|
"Library/Application Support/k9s/skins/${name}.yaml") {
|
||||||
source = yamlFormat.generate "k9s-skin-${name}.yaml" value;
|
source = if lib.types.path.check value then
|
||||||
|
value
|
||||||
|
else
|
||||||
|
yamlFormat.generate "k9s-skin-${name}.yaml" value;
|
||||||
}) cfg.skins;
|
}) cfg.skins;
|
||||||
|
|
||||||
enableXdgConfig = !isDarwin || config.xdg.enable;
|
enableXdgConfig = !isDarwin || config.xdg.enable;
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
"default2" = ./example-skin-expected.yaml;
|
||||||
"alt-skin" = {
|
"alt-skin" = {
|
||||||
k9s = {
|
k9s = {
|
||||||
body = {
|
body = {
|
||||||
|
@ -92,6 +93,10 @@
|
||||||
assertFileContent \
|
assertFileContent \
|
||||||
"home-files/${configDir}/skins/default.yaml" \
|
"home-files/${configDir}/skins/default.yaml" \
|
||||||
${./example-skin-expected.yaml}
|
${./example-skin-expected.yaml}
|
||||||
|
assertFileExists "home-files/${configDir}/skins/default2.yaml"
|
||||||
|
assertFileContent \
|
||||||
|
"home-files/${configDir}/skins/default2.yaml" \
|
||||||
|
${./example-skin-expected.yaml}
|
||||||
assertFileExists "home-files/${configDir}/skins/alt-skin.yaml"
|
assertFileExists "home-files/${configDir}/skins/alt-skin.yaml"
|
||||||
assertFileContent \
|
assertFileContent \
|
||||||
"home-files/${configDir}/skins/alt-skin.yaml" \
|
"home-files/${configDir}/skins/alt-skin.yaml" \
|
||||||
|
|
Loading…
Reference in a new issue