mirror of
https://github.com/nix-community/home-manager
synced 2024-11-23 11:39:46 +01:00
bottom: use xdg.configHome on Darwin
Both locations are supported, see https://clementtsang.github.io/bottom/nightly/configuration/config-file/default-config/
This commit is contained in:
parent
cd690d2021
commit
e17e5e4f48
3 changed files with 6 additions and 22 deletions
|
@ -8,11 +8,6 @@ let
|
||||||
|
|
||||||
tomlFormat = pkgs.formats.toml { };
|
tomlFormat = pkgs.formats.toml { };
|
||||||
|
|
||||||
configDir = if pkgs.stdenv.isDarwin then
|
|
||||||
"Library/Application Support"
|
|
||||||
else
|
|
||||||
config.xdg.configHome;
|
|
||||||
|
|
||||||
in {
|
in {
|
||||||
options = {
|
options = {
|
||||||
programs.bottom = {
|
programs.bottom = {
|
||||||
|
@ -32,8 +27,7 @@ in {
|
||||||
default = { };
|
default = { };
|
||||||
description = ''
|
description = ''
|
||||||
Configuration written to
|
Configuration written to
|
||||||
<filename>$XDG_CONFIG_HOME/bottom/bottom.toml</filename> on Linux or
|
<filename>$XDG_CONFIG_HOME/bottom/bottom.toml</filename>.
|
||||||
<filename>$HOME/Library/Application Support/bottom/bottom.toml</filename> on Darwin.
|
|
||||||
</para><para>
|
</para><para>
|
||||||
See <link xlink:href="https://github.com/ClementTsang/bottom/blob/master/sample_configs/default_config.toml"/>
|
See <link xlink:href="https://github.com/ClementTsang/bottom/blob/master/sample_configs/default_config.toml"/>
|
||||||
for the default configuration.
|
for the default configuration.
|
||||||
|
@ -57,7 +51,7 @@ in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
home.packages = [ cfg.package ];
|
home.packages = [ cfg.package ];
|
||||||
|
|
||||||
home.file."${configDir}/bottom/bottom.toml" = mkIf (cfg.settings != { }) {
|
xdg.configFile."bottom/bottom.toml" = mkIf (cfg.settings != { }) {
|
||||||
source = tomlFormat.generate "bottom.toml" cfg.settings;
|
source = tomlFormat.generate "bottom.toml" cfg.settings;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -9,13 +9,8 @@ with lib;
|
||||||
package = config.lib.test.mkStubPackage { };
|
package = config.lib.test.mkStubPackage { };
|
||||||
};
|
};
|
||||||
|
|
||||||
nmt.script = let
|
nmt.script = ''
|
||||||
configDir = if pkgs.stdenv.isDarwin then
|
assertPathNotExists home-files/.config/bottom
|
||||||
"home-files/Library/Application Support"
|
|
||||||
else
|
|
||||||
"home-files/.config";
|
|
||||||
in ''
|
|
||||||
assertPathNotExists ${configDir}/bottom
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,14 +18,9 @@ with lib;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
nmt.script = let
|
nmt.script = ''
|
||||||
configDir = if pkgs.stdenv.isDarwin then
|
|
||||||
"home-files/Library/Application Support"
|
|
||||||
else
|
|
||||||
"home-files/.config";
|
|
||||||
in ''
|
|
||||||
assertFileContent \
|
assertFileContent \
|
||||||
"${configDir}/bottom/bottom.toml" \
|
"home-files/.config/bottom/bottom.toml" \
|
||||||
${./example-settings-expected.toml}
|
${./example-settings-expected.toml}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue