forked from nix-community/home-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
186d939
commit 7dc4e4e
Showing
11 changed files
with
153 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -101,6 +101,12 @@ | |
fingerprint = "2BE3 BAFD 793E A349 ED1F F00F 04D0 CEAF 916A 9A40"; | ||
}]; | ||
}; | ||
katexochen = { | ||
name = "Paul Meyer"; | ||
email = "[email protected]"; | ||
github = "katexochen"; | ||
githubId = 49727155; | ||
}; | ||
kubukoz = { | ||
name = "Jakub Kozłowski"; | ||
email = "[email protected]"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
{ config, lib, pkgs, ... }: | ||
|
||
with lib; | ||
|
||
let | ||
|
||
cfg = config.programs.k9s; | ||
yamlFormat = pkgs.formats.yaml { }; | ||
|
||
in { | ||
meta.maintainers = [ hm.maintainers.katexochen ]; | ||
|
||
options.programs.k9s = { | ||
enable = | ||
mkEnableOption "k9s - Kubernetes CLI To Manage Your Clusters In Style"; | ||
|
||
package = mkPackageOption pkgs "k9s" { }; | ||
|
||
settings = mkOption { | ||
type = yamlFormat.type; | ||
default = { }; | ||
description = '' | ||
Configuration written to | ||
<filename>$XDG_CONFIG_HOME/k9s/config.yml</filename>. See | ||
<link xlink:href="https://k9scli.io/topics/config/"/> | ||
for supported values. | ||
''; | ||
example = literalExpression '' | ||
k9s = { | ||
refreshRate = 2; | ||
}; | ||
''; | ||
}; | ||
|
||
skin = mkOption { | ||
type = yamlFormat.type; | ||
default = { }; | ||
description = '' | ||
Skin written to | ||
<filename>$XDG_CONFIG_HOME/k9s/skin.yml</filename>. See | ||
<link xlink:href="https://k9scli.io/topics/skins/"/> | ||
for supported values. | ||
''; | ||
example = literalExpression '' | ||
k9s = { | ||
body = { | ||
fgColor = "dodgerblue"; | ||
}; | ||
}; | ||
''; | ||
}; | ||
}; | ||
|
||
config = mkIf cfg.enable { | ||
home.packages = [ cfg.package ]; | ||
|
||
xdg.configFile."k9s/config.yml" = mkIf (cfg.settings != { }) { | ||
source = yamlFormat.generate "k9s-config" cfg.settings; | ||
}; | ||
|
||
xdg.configFile."k9s/skin.yml" = mkIf (cfg.skin != { }) { | ||
source = yamlFormat.generate "k9s-skin" cfg.skin; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
k9s-example-settings = ./example-settings.nix; | ||
k9s-empty-settings = ./empty-settings.nix; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ ... }: | ||
|
||
{ | ||
programs.k9s.enable = true; | ||
|
||
test.stubs.k9s = { }; | ||
|
||
nmt.script = '' | ||
assertPathNotExists home-files/.config/k9s | ||
''; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
k9s: | ||
enableMouse: true | ||
headless: false | ||
maxConnRetry: 5 | ||
refreshRate: 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ config, ... }: | ||
|
||
{ | ||
programs.k9s = { | ||
enable = true; | ||
package = config.lib.test.mkStubPackage { }; | ||
|
||
settings = { | ||
k9s = { | ||
refreshRate = 2; | ||
maxConnRetry = 5; | ||
enableMouse = true; | ||
headless = false; | ||
}; | ||
}; | ||
|
||
skin = { | ||
k9s = { | ||
body = { | ||
fgColor = "dodgerblue"; | ||
bgColor = "#ffffff"; | ||
logoColor = "#0000ff"; | ||
}; | ||
info = { | ||
fgColor = "lightskyblue"; | ||
sectionColor = "steelblue"; | ||
}; | ||
}; | ||
}; | ||
}; | ||
|
||
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} | ||
''; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
k9s: | ||
body: | ||
bgColor: '#ffffff' | ||
fgColor: dodgerblue | ||
logoColor: '#0000ff' | ||
info: | ||
fgColor: lightskyblue | ||
sectionColor: steelblue |