kubecolor: add module
This commit is contained in:
parent
e71e678d18
commit
8632735050
8 changed files with 197 additions and 0 deletions
5
tests/modules/programs/kubecolor/default.nix
Normal file
5
tests/modules/programs/kubecolor/default.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
kubecolor-empty-config = ./empty-config.nix;
|
||||
kubecolor-example-config-default-paths = ./example-config-default-paths.nix;
|
||||
kubecolor-example-config-xdg-paths = ./example-config-xdg-paths.nix;
|
||||
}
|
||||
20
tests/modules/programs/kubecolor/empty-config.nix
Normal file
20
tests/modules/programs/kubecolor/empty-config.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{ pkgs, config, ... }:
|
||||
|
||||
let
|
||||
configDir =
|
||||
if pkgs.stdenv.isDarwin then "Library/Application Support" else ".config";
|
||||
in {
|
||||
programs.kubecolor = {
|
||||
enable = true;
|
||||
package = config.lib.test.mkStubPackage {
|
||||
name = "kubecolor";
|
||||
version = "0.4.0";
|
||||
};
|
||||
};
|
||||
|
||||
test.stubs.kubecolor = { };
|
||||
|
||||
nmt.script = ''
|
||||
assertPathNotExists 'home-files/${configDir}/kube/color.yaml'
|
||||
'';
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
{ pkgs, config, ... }:
|
||||
|
||||
let
|
||||
configDir = if pkgs.stdenv.isDarwin then
|
||||
"Library/Application Support/kube"
|
||||
else
|
||||
".kube";
|
||||
in {
|
||||
programs.kubecolor = {
|
||||
enable = true;
|
||||
package = config.lib.test.mkStubPackage {
|
||||
name = "kubecolor";
|
||||
version = "0.4.0";
|
||||
};
|
||||
settings = {
|
||||
kubectl = "kubectl";
|
||||
preset = "dark";
|
||||
objFreshThreshold = 0;
|
||||
paging = "auto";
|
||||
pager = "less";
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists 'home-files/${configDir}/color.yaml'
|
||||
assertFileContent 'home-files/${configDir}/color.yaml' \
|
||||
${
|
||||
builtins.toFile "expected.yaml" ''
|
||||
kubectl: kubectl
|
||||
objFreshThreshold: 0
|
||||
pager: less
|
||||
paging: auto
|
||||
preset: dark
|
||||
''
|
||||
}
|
||||
'';
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
xdg.enable = true;
|
||||
home.preferXdgDirectories = true;
|
||||
|
||||
programs.kubecolor = {
|
||||
enable = true;
|
||||
package = config.lib.test.mkStubPackage {
|
||||
name = "kubecolor";
|
||||
version = "0.4.0";
|
||||
};
|
||||
settings = {
|
||||
kubectl = "kubectl";
|
||||
preset = "dark";
|
||||
objFreshThreshold = 0;
|
||||
paging = "auto";
|
||||
pager = "less";
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists 'home-files/.config/kube/color.yaml'
|
||||
assertFileContent 'home-files/.config/kube/color.yaml' \
|
||||
${
|
||||
builtins.toFile "expected.yaml" ''
|
||||
kubectl: kubectl
|
||||
objFreshThreshold: 0
|
||||
pager: less
|
||||
paging: auto
|
||||
preset: dark
|
||||
''
|
||||
}
|
||||
'';
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue