commit
8e2f255cb6
@ -232,6 +232,13 @@
|
||||
<link linkend="opt-services.nats.enable">services.nats</link>.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<link xlink:href="https://git-scm.com">git</link>, a
|
||||
distributed version control system. Available as
|
||||
<link xlink:href="options.html#opt-programs.git.enable">programs.git</link>.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
<section xml:id="sec-release-21.11-incompatibilities">
|
||||
|
@ -71,6 +71,8 @@ subsonic-compatible api. Available as [navidrome](#opt-services.navidrome.enable
|
||||
|
||||
- [nats](https://nats.io/), a high performance cloud and edge messaging system. Available as [services.nats](#opt-services.nats.enable).
|
||||
|
||||
- [git](https://git-scm.com), a distributed version control system. Available as [programs.git](options.html#opt-programs.git.enable).
|
||||
|
||||
## Backward Incompatibilities {#sec-release-21.11-incompatibilities}
|
||||
|
||||
|
||||
|
@ -145,6 +145,7 @@
|
||||
./programs/fuse.nix
|
||||
./programs/gamemode.nix
|
||||
./programs/geary.nix
|
||||
./programs/git.nix
|
||||
./programs/gnome-disks.nix
|
||||
./programs/gnome-documents.nix
|
||||
./programs/gnome-terminal.nix
|
||||
|
45
nixos/modules/programs/git.nix
Normal file
45
nixos/modules/programs/git.nix
Normal file
@ -0,0 +1,45 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.programs.git;
|
||||
in
|
||||
|
||||
{
|
||||
options = {
|
||||
programs.git = {
|
||||
enable = mkEnableOption "git";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.git;
|
||||
defaultText = "pkgs.git";
|
||||
example = literalExample "pkgs.gitFull";
|
||||
description = "The git package to use";
|
||||
};
|
||||
|
||||
config = mkOption {
|
||||
type = types.attrs;
|
||||
default = { };
|
||||
example = {
|
||||
init.defaultBranch = "main";
|
||||
url."https://github.com/".insteadOf = [ "gh:" "github:" ];
|
||||
};
|
||||
description = ''
|
||||
Configuration to write to /etc/gitconfig. See the CONFIGURATION FILE
|
||||
section of git-config(1) for more information.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = [ cfg.package ];
|
||||
environment.etc.gitconfig = mkIf (cfg.config != {}) {
|
||||
text = generators.toGitINI cfg.config;
|
||||
};
|
||||
};
|
||||
|
||||
meta.maintainers = with maintainers; [ figsoda ];
|
||||
}
|
Loading…
Reference in New Issue
Block a user