mirror of
https://github.com/nix-community/home-manager
synced 2024-11-23 03:29:45 +01:00
k9s: allow defining custom theme file
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
parent
8a175a8913
commit
77c9414828
2 changed files with 18 additions and 7 deletions
|
@ -46,7 +46,7 @@ in {
|
|||
};
|
||||
|
||||
skins = mkOption {
|
||||
type = types.attrsOf yamlFormat.type;
|
||||
type = with types; attrsOf (either yamlFormat.type path);
|
||||
default = { };
|
||||
description = ''
|
||||
Skin files written to {file}`$XDG_CONFIG_HOME/k9s/skins/` (linux)
|
||||
|
@ -54,6 +54,7 @@ in {
|
|||
<https://k9scli.io/topics/skins/> for supported values.
|
||||
'';
|
||||
example = literalExpression ''
|
||||
{
|
||||
my_blue_skin = {
|
||||
k9s = {
|
||||
body = {
|
||||
|
@ -61,6 +62,8 @@ in {
|
|||
};
|
||||
};
|
||||
};
|
||||
my_red_skin = ./red_skin.yaml;
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
|
@ -174,7 +177,10 @@ in {
|
|||
"k9s/skins/${name}.yaml"
|
||||
else
|
||||
"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;
|
||||
|
||||
enableXdgConfig = !isDarwin || config.xdg.enable;
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
"default2" = ./example-skin-expected.yaml;
|
||||
"alt-skin" = {
|
||||
k9s = {
|
||||
body = {
|
||||
|
@ -92,6 +93,10 @@
|
|||
assertFileContent \
|
||||
"home-files/${configDir}/skins/default.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"
|
||||
assertFileContent \
|
||||
"home-files/${configDir}/skins/alt-skin.yaml" \
|
||||
|
|
Loading…
Reference in a new issue