fork/home-manager
git clone https://git.julia.blue/fork/home-manager
75790441
master
1{ config , lib , pkgs , ...} : 2 3with lib ; 4 5let 6 7cfg = config . programs . lazygit ; 8 9yamlFormat = pkgs . formats . yaml { }; 10 11inherit ( pkgs . stdenv . hostPlatform ) isDarwin ; 12 13in { 14meta . maintainers = [ hm . maintainers . kalhauge ]; 15 16options . programs . lazygit = { 17enable = mkEnableOption "lazygit, a simple terminal UI for git commands" ; 18 19package = mkPackageOption pkgs "lazygit" { }; 20 21settings = mkOption { 22type = yamlFormat . type ; 23default = { }; 24defaultText = literalExpression "{ }" ; 25example = literalExpression '' 26{ 27gui.theme = { 28lightTheme = true; 29activeBorderColor = [ "blue" "bold" ]; 30inactiveBorderColor = [ "black" ]; 31selectedLineBgColor = [ "default" ]; 32}; 33} 34'' ; 35description = '' 36Configuration written to 37{file}`$XDG_CONFIG_HOME/lazygit/config.yml` 38on Linux or on Darwin if [](#opt-xdg.enable) is set, otherwise 39{file}`~/Library/Application Support/lazygit/config.yml`. 40See 41<https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md> 42for supported values. 43'' ; 44}; 45}; 46 47config = mkIf cfg . enable { 48home . packages = [ cfg . package ]; 49 50home . file . "Library/Application Support/lazygit/config.yml" = 51mkIf ( cfg . settings != { } && ( isDarwin && ! config . xdg . enable )) { 52source = yamlFormat . generate "lazygit-config" cfg . settings ; 53}; 54 55xdg . configFile . "lazygit/config.yml" = 56mkIf ( cfg . settings != { } && ! ( isDarwin && ! config . xdg . enable )) { 57source = yamlFormat . generate "lazygit-config" cfg . settings ; 58}; 59}; 60}