huge refactor
This commit is contained in:
parent
03e5a47910
commit
1d4c8455ee
30 changed files with 972 additions and 697 deletions
45
moduler/programs/git/default.nix
Normal file
45
moduler/programs/git/default.nix
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
{ lib, config, ... }:
|
||||
with lib;
|
||||
{
|
||||
options.features.git = {
|
||||
enable = mkEnableOption "enable git defaults";
|
||||
userName = mkOption {
|
||||
type = types.str;
|
||||
default = "fwastring";
|
||||
description = "Default git user.name.";
|
||||
};
|
||||
userEmail = mkOption {
|
||||
type = types.str;
|
||||
default = "fredrik@wastring.com";
|
||||
description = "Default git user.email.";
|
||||
};
|
||||
pullRebase = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = "Enable pull.rebase by default.";
|
||||
};
|
||||
githubSshInsteadOfHttps = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = "Use SSH for GitHub remotes when cloning with HTTPS URLs.";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf config.features.git.enable {
|
||||
programs.git = {
|
||||
enable = true;
|
||||
config = {
|
||||
user = {
|
||||
name = config.features.git.userName;
|
||||
email = config.features.git.userEmail;
|
||||
};
|
||||
pull = {
|
||||
rebase = config.features.git.pullRebase;
|
||||
};
|
||||
}
|
||||
// optionalAttrs config.features.git.githubSshInsteadOfHttps {
|
||||
url."git@github.com:".insteadOf = "https://github.com/";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue