mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-12 01:59:37 +08:00
lazygit: deduplicate platform-dependent files
This commit is contained in:
committed by
Austin Horstman
parent
ebab435f3e
commit
e69fbc243a
@@ -11,8 +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"
|
||||||
|
else
|
||||||
|
config.xdg.configHome;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
meta.maintainers = [
|
meta.maintainers = [
|
||||||
@@ -71,17 +74,10 @@ in
|
|||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
home.packages = mkIf (cfg.package != null) [ cfg.package ];
|
home.packages = mkIf (cfg.package != null) [ cfg.package ];
|
||||||
|
|
||||||
home.file."Library/Application Support/lazygit/config.yml" =
|
home.file."${configDir}/lazygit/config.yml" = {
|
||||||
mkIf (cfg.settings != { } && (isDarwin && !config.xdg.enable))
|
enable = cfg.settings != { };
|
||||||
{
|
source = yamlFormat.generate "lazygit-config" cfg.settings;
|
||||||
source = yamlFormat.generate "lazygit-config" cfg.settings;
|
};
|
||||||
};
|
|
||||||
|
|
||||||
xdg.configFile."lazygit/config.yml" =
|
|
||||||
mkIf (cfg.settings != { } && !(isDarwin && !config.xdg.enable))
|
|
||||||
{
|
|
||||||
source = yamlFormat.generate "lazygit-config" cfg.settings;
|
|
||||||
};
|
|
||||||
|
|
||||||
programs =
|
programs =
|
||||||
let
|
let
|
||||||
|
|||||||
Reference in New Issue
Block a user