# Enabling and installing? “programs.git.enable = true” & “systemPackages=\[git\]”

**URL:** https://discourse.nixos.org/t/enabling-and-installing-programs-git-enable-true-systempackages-git/40989
**Category:** Help
**Created:** [March 8, 2024, 3:51am UTC](https://discourse.nixos.org/t/enabling-and-installing-programs-git-enable-true-systempackages-git/40989 "2024-03-08T03:51:41Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![galo](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/g/9e8a1a/32.png) [@galo](https://discourse.nixos.org/u/galo)
#### Post date: [March 8, 2024, 3:51am UTC](https://discourse.nixos.org/t/enabling-and-installing-programs-git-enable-true-systempackages-git/40989/1 "2024-03-08T03:51:41Z")

</div>

Given there are multiple ways of installing a package, what happens when they are declared multiple times? As an example:

“programs.git.enable = true” & “systemPackages=[git]”

Is this harmful in any way?

---

<div class="post-metadata">

### Author: ![mmarx](https://discourse.nixos.org/user_avatar/discourse.nixos.org/mmarx/32/8118_2.png) [@mmarx](https://discourse.nixos.org/u/mmarx)
#### Post date: [March 8, 2024, 11:04pm UTC](https://discourse.nixos.org/t/enabling-and-installing-programs-git-enable-true-systempackages-git/40989/2 "2024-03-08T23:04:54Z")

</div>

It’s not actually harmful, but at least redundant. If you check what `programs.git.enable` [actually does](https://github.com/NixOS/nixpkgs/blob/880992dcc006a5e00dd0591446fdf723e6a51a64/nixos/modules/programs/git.nix#L78), you can see that it adds `cfg.package` (which, by default, is `git`) to `environment.systemPackages` (and optionally does some more configuration besides that). So if you don’t set any other `programs.git` options, both are exactly the same. If you, however, also set, e.g., `programs.git.package = pkgs.gitFull`, you will end up with both `git` and `gitFull` in `environment.systemPackages` – this is not a problem per se, but you will end up using more space, since two versions of git will be installed.
