1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-08 10:01:05 +01:00

programs/git: package nullable

Some platforms (e.g. macOS) provide their customized version of git with
exclusive features, and user might want to use that instead.
This commit is contained in:
Hanwen Guo 2025-12-03 12:48:35 -07:00 committed by Austin Horstman
parent 571c5eed1d
commit 36817384a6

View file

@ -41,6 +41,7 @@ in
enable = mkEnableOption "Git"; enable = mkEnableOption "Git";
package = lib.mkPackageOption pkgs "git" { package = lib.mkPackageOption pkgs "git" {
nullable = true;
example = "pkgs.gitFull"; example = "pkgs.gitFull";
extraDescription = '' extraDescription = ''
Use {var}`pkgs.gitFull` Use {var}`pkgs.gitFull`
@ -328,7 +329,7 @@ in
config = mkIf cfg.enable ( config = mkIf cfg.enable (
lib.mkMerge [ lib.mkMerge [
{ {
home.packages = [ cfg.package ]; home.packages = lib.optionals (cfg.package != null) [ cfg.package ];
assertions = [ assertions = [
{ {
@ -516,7 +517,7 @@ in
Type = "oneshot"; Type = "oneshot";
ExecStart = ExecStart =
let let
exe = lib.getExe cfg.package; exe = if cfg.package != null then lib.getExe cfg.package else "git";
in in
'' ''
"${exe}" for-each-repo --keep-going --config=maintenance.repo maintenance run --schedule=%i "${exe}" for-each-repo --keep-going --config=maintenance.repo maintenance run --schedule=%i
@ -553,7 +554,7 @@ in
launchd.agents = launchd.agents =
let let
baseArguments = [ baseArguments = [
"${lib.getExe cfg.package}" "${if cfg.package != null then lib.getExe cfg.package else "git"}"
"for-each-repo" "for-each-repo"
"--keep-going" "--keep-going"
"--config=maintenance.repo" "--config=maintenance.repo"