1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-08 18:11:05 +01:00

kubeswitch: add module

Signed-off-by: Ludovic Ortega <ludovic.ortega@adminafk.fr>
Co-authored-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
Ludovic Ortega 2025-07-05 22:54:55 +02:00 committed by Austin Horstman
parent 92db5be8e1
commit af8a884164
10 changed files with 220 additions and 0 deletions

View file

@ -77,6 +77,7 @@ let
"khard"
"kitty"
"kubecolor"
"kubeswitch"
"lapce"
"lazydocker"
"lazygit"

View file

@ -0,0 +1,14 @@
{
programs = {
kubeswitch.enable = true;
bash.enable = true;
};
nmt.script = ''
assertFileExists home-files/.bashrc
assertFileRegex home-files/.bashrc \
'^source /nix/store/[0-9a-z]*-kubeswitch-kswitch-shell-files-for-bash/share/kswitch_init.bash$'
assertFileRegex home-files/.bashrc \
'^source /nix/store/[0-9a-z]*-kubeswitch-kswitch-shell-files-for-bash/share/kswitch_completion.bash$'
'';
}

View file

@ -0,0 +1,7 @@
{
kubeswitch-bash = ./bash.nix;
kubeswitch-empty-settings = ./empty-settings.nix;
kubeswitch-example-settings = ./example-settings.nix;
kubeswitch-fish = ./fish.nix;
kubeswitch-zsh = ./zsh.nix;
}

View file

@ -0,0 +1,7 @@
{
programs.kubeswitch.enable = true;
nmt.script = ''
assertPathNotExists home-files/.kube/switch-config.yaml
'';
}

View file

@ -0,0 +1,35 @@
{
programs.kubeswitch = {
enable = true;
settings = {
kind = "SwitchConfig";
version = "v1alpha1";
kubeconfigName = "*.myconfig";
kubeconfigStores = [
{
kind = "filesystem";
kubeconfigName = "*.myconfig";
paths = [
"~/.kube/my-other-kubeconfigs/"
];
}
];
};
};
nmt.script = ''
assertFileContent \
home-files/.kube/switch-config.yaml \
${builtins.toFile "example-settings-expected.yaml" ''
kind: SwitchConfig
kubeconfigName: '*.myconfig'
kubeconfigStores:
- kind: filesystem
kubeconfigName: '*.myconfig'
paths:
- ~/.kube/my-other-kubeconfigs/
version: v1alpha1
''}
'';
}

View file

@ -0,0 +1,16 @@
{ ... }:
{
programs = {
kubeswitch.enable = true;
fish.enable = true;
};
nmt.script = ''
assertFileExists home-files/.config/fish/config.fish
assertFileRegex home-files/.config/fish/config.fish \
'^\s*source /nix/store/[0-9a-z]*-kubeswitch-kswitch-shell-files-for-fish/share/kswitch_init.fish$'
assertFileRegex home-files/.config/fish/config.fish \
'^\s*source /nix/store/[0-9a-z]*-kubeswitch-kswitch-shell-files-for-fish/share/kswitch_completion.fish$'
'';
}

View file

@ -0,0 +1,14 @@
{
programs = {
kubeswitch.enable = true;
zsh.enable = true;
};
nmt.script = ''
assertFileExists home-files/.zshrc
assertFileRegex home-files/.zshrc \
'^source /nix/store/[0-9a-z]*-kubeswitch-kswitch-shell-files-for-zsh/share/kswitch_init.zsh$'
assertFileRegex home-files/.zshrc \
'^source /nix/store/[0-9a-z]*-kubeswitch-kswitch-shell-files-for-zsh/share/kswitch_completion.zsh$'
'';
}