k9s: configuration files in Darwin without XDG
Support alternate configuration files for k9s in darwin where XDG is not mandated and k9s expects configuration files in `~/Library/Application Support/k9s/`.
This commit is contained in:
parent
76a1650c45
commit
9f32c66a51
3 changed files with 85 additions and 31 deletions
|
|
@ -1,11 +1,17 @@
|
|||
{ ... }:
|
||||
{ pkgs, lib, ... }: {
|
||||
|
||||
{
|
||||
programs.k9s.enable = true;
|
||||
|
||||
xdg.enable = lib.mkIf pkgs.stdenv.isDarwin (lib.mkForce false);
|
||||
|
||||
test.stubs.k9s = { };
|
||||
|
||||
nmt.script = ''
|
||||
assertPathNotExists home-files/.config/k9s
|
||||
nmt.script = let
|
||||
configDir = if !pkgs.stdenv.isDarwin then
|
||||
".config/k9s"
|
||||
else
|
||||
"Library/Application Support/k9s";
|
||||
in ''
|
||||
assertPathNotExists home-files/${configDir}
|
||||
'';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
{ config, ... }:
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
xdg.enable = lib.mkIf pkgs.stdenv.isDarwin (lib.mkForce false);
|
||||
|
||||
programs.k9s = {
|
||||
enable = true;
|
||||
package = config.lib.test.mkStubPackage { };
|
||||
|
|
@ -76,34 +78,39 @@
|
|||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/k9s/config.yaml
|
||||
nmt.script = let
|
||||
configDir = if !pkgs.stdenv.isDarwin then
|
||||
".config/k9s"
|
||||
else
|
||||
"Library/Application Support/k9s";
|
||||
in ''
|
||||
assertFileExists "home-files/${configDir}/config.yaml"
|
||||
assertFileContent \
|
||||
home-files/.config/k9s/config.yaml \
|
||||
"home-files/${configDir}/config.yaml" \
|
||||
${./example-config-expected.yaml}
|
||||
assertFileExists home-files/.config/k9s/skins/default.yaml
|
||||
assertFileExists "home-files/${configDir}/skins/default.yaml"
|
||||
assertFileContent \
|
||||
home-files/.config/k9s/skins/default.yaml \
|
||||
"home-files/${configDir}/skins/default.yaml" \
|
||||
${./example-skin-expected.yaml}
|
||||
assertFileExists home-files/.config/k9s/skins/alt-skin.yaml
|
||||
assertFileExists "home-files/${configDir}/skins/alt-skin.yaml"
|
||||
assertFileContent \
|
||||
home-files/.config/k9s/skins/alt-skin.yaml \
|
||||
"home-files/${configDir}/skins/alt-skin.yaml" \
|
||||
${./example-skin-expected-alt.yaml}
|
||||
assertFileExists home-files/.config/k9s/hotkeys.yaml
|
||||
assertFileExists "home-files/${configDir}/hotkeys.yaml"
|
||||
assertFileContent \
|
||||
home-files/.config/k9s/hotkeys.yaml \
|
||||
"home-files/${configDir}/hotkeys.yaml" \
|
||||
${./example-hotkey-expected.yaml}
|
||||
assertFileExists home-files/.config/k9s/aliases.yaml
|
||||
assertFileExists "home-files/${configDir}/aliases.yaml"
|
||||
assertFileContent \
|
||||
home-files/.config/k9s/aliases.yaml \
|
||||
"home-files/${configDir}/aliases.yaml" \
|
||||
${./example-aliases-expected.yaml}
|
||||
assertFileExists home-files/.config/k9s/plugins.yaml
|
||||
assertFileExists "home-files/${configDir}/plugins.yaml"
|
||||
assertFileContent \
|
||||
home-files/.config/k9s/plugins.yaml \
|
||||
"home-files/${configDir}/plugins.yaml" \
|
||||
${./example-plugin-expected.yaml}
|
||||
assertFileExists home-files/.config/k9s/views.yaml
|
||||
assertFileExists "home-files/${configDir}/views.yaml"
|
||||
assertFileContent \
|
||||
home-files/.config/k9s/views.yaml \
|
||||
"home-files/${configDir}/views.yaml" \
|
||||
${./example-views-expected.yaml}
|
||||
'';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue