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

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?

It’s not actually harmful, but at least redundant. If you check what programs.git.enable actually does, 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.