lazydocker: deduplicate platform-dependent files

This commit is contained in:
Benedikt Rips
2026-01-05 23:00:13 +01:00
committed by Austin Horstman
parent bacad23b8c
commit ebab435f3e

View File

@@ -11,7 +11,11 @@ let
yamlFormat = pkgs.formats.yaml { }; yamlFormat = pkgs.formats.yaml { };
inherit (pkgs.stdenv.hostPlatform) isDarwin; configDir =
if pkgs.stdenv.hostPlatform.isDarwin && !config.xdg.enable then
"Library/Application Support/jesseduffield"
else
config.xdg.configHome;
in in
{ {
@@ -51,16 +55,8 @@ 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 ];
home.file."Library/Application Support/jesseduffield/lazydocker/config.yml" = home.file."${configDir}/lazydocker/config.yml" = lib.mkIf (cfg.settings != { }) {
lib.mkIf (cfg.settings != { } && (isDarwin && !config.xdg.enable)) source = yamlFormat.generate "lazydocker-config" cfg.settings;
{ };
source = yamlFormat.generate "lazydocker-config" cfg.settings;
};
xdg.configFile."lazydocker/config.yml" =
lib.mkIf (cfg.settings != { } && !(isDarwin && !config.xdg.enable))
{
source = yamlFormat.generate "lazydocker-config" cfg.settings;
};
}; };
} }