nixos/git: init
This commit is contained in:
parent
6e4c36b3f7
commit
44853e8cf3
|
@ -232,6 +232,13 @@
|
||||||
<link linkend="opt-services.nats.enable">services.nats</link>.
|
<link linkend="opt-services.nats.enable">services.nats</link>.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</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>
|
</itemizedlist>
|
||||||
</section>
|
</section>
|
||||||
<section xml:id="sec-release-21.11-incompatibilities">
|
<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).
|
- [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}
|
## Backward Incompatibilities {#sec-release-21.11-incompatibilities}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -145,6 +145,7 @@
|
||||||
./programs/fuse.nix
|
./programs/fuse.nix
|
||||||
./programs/gamemode.nix
|
./programs/gamemode.nix
|
||||||
./programs/geary.nix
|
./programs/geary.nix
|
||||||
|
./programs/git.nix
|
||||||
./programs/gnome-disks.nix
|
./programs/gnome-disks.nix
|
||||||
./programs/gnome-documents.nix
|
./programs/gnome-documents.nix
|
||||||
./programs/gnome-terminal.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 a new issue