mirror of
https://github.com/nix-community/home-manager.git
synced 2026-10-02 19:49:18 +00:00
Nixpkgs switched pkgs.formats.yaml to remarshal v2. Generated files now start with a %YAML 1.1 directive and a --- document start, and multiline strings use double-quoted escapes. Only files written through yamlFormat.generate change. Modules that declare the YAML type but write the file with builtins.toJSON keep their current output.
38 lines
812 B
Nix
38 lines
812 B
Nix
{
|
|
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" ''
|
|
%YAML 1.1
|
|
---
|
|
kind: SwitchConfig
|
|
kubeconfigName: '*.myconfig'
|
|
kubeconfigStores:
|
|
- kind: filesystem
|
|
kubeconfigName: '*.myconfig'
|
|
paths:
|
|
- ~/.kube/my-other-kubeconfigs/
|
|
version: v1alpha1
|
|
''}
|
|
'';
|
|
}
|