mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 19:46:05 +01:00
iamb: use correct config directory on macOS
On macOS, configuration files are stored in the platform-standard directory `~/Library/Application Support/` by default. However, if the user enables the XDG Base Directory specification by setting `xdg.enable = true`, iamb should respect the `XDG_CONFIG_HOME` environment variable (along with other related XDG variables). Currently, this behavior is not implemented in iamb, a PR has been opened to fix that -> https://github.com/ulyssa/iamb/pull/478.
This commit is contained in:
parent
04b710c1f0
commit
d1db9055ea
1 changed files with 6 additions and 1 deletions
|
|
@ -7,6 +7,11 @@
|
||||||
let
|
let
|
||||||
cfg = config.programs.iamb;
|
cfg = config.programs.iamb;
|
||||||
tomlFormat = pkgs.formats.toml { };
|
tomlFormat = pkgs.formats.toml { };
|
||||||
|
configDir =
|
||||||
|
if pkgs.stdenv.isDarwin && !config.xdg.enable then
|
||||||
|
"Library/Application Support"
|
||||||
|
else
|
||||||
|
config.xdg.configHome;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.programs.iamb = {
|
options.programs.iamb = {
|
||||||
|
|
@ -46,7 +51,7 @@ in
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
|
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
|
||||||
|
|
||||||
xdg.configFile."iamb/config.toml" = lib.mkIf (cfg.settings != { }) {
|
home.file."${configDir}/iamb/config.toml" = lib.mkIf (cfg.settings != { }) {
|
||||||
source = tomlFormat.generate "iamb-config" cfg.settings;
|
source = tomlFormat.generate "iamb-config" cfg.settings;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue