A new start
This commit is contained in:
commit
f4e2368893
93 changed files with 7621 additions and 0 deletions
20
modules/nixos/tools/direnv/default.nix
Normal file
20
modules/nixos/tools/direnv/default.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.metacfg;
|
||||
let cfg = config.metacfg.tools.direnv;
|
||||
in
|
||||
{
|
||||
options.metacfg.tools.direnv = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to enable direnv.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
metacfg.home.extraOptions = {
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
nix-direnv = enabled;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
61
modules/nixos/tools/git/default.nix
Normal file
61
modules/nixos/tools/git/default.nix
Normal file
|
@ -0,0 +1,61 @@
|
|||
{ options, config, pkgs, lib, ... }:
|
||||
|
||||
with lib;
|
||||
with lib.metacfg;
|
||||
let
|
||||
cfg = config.metacfg.tools.git;
|
||||
gpg = config.metacfg.security.gpg;
|
||||
user = config.metacfg.user;
|
||||
in
|
||||
{
|
||||
options.metacfg.tools.git = with types; {
|
||||
enable = mkBoolOpt false "Whether or not to install and configure git.";
|
||||
userName = mkOpt types.str user.fullName "The name to configure git with.";
|
||||
userEmail = mkOpt types.str user.email "The email to configure git with.";
|
||||
signingKey =
|
||||
mkOpt types.str "9762169A1B35EA68" "The key ID to sign commits with.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [ git ];
|
||||
|
||||
metacfg.home.extraOptions = {
|
||||
programs.git = {
|
||||
enable = true;
|
||||
inherit (cfg) userName userEmail;
|
||||
lfs = enabled;
|
||||
signing = {
|
||||
key = cfg.signingKey;
|
||||
signByDefault = mkIf gpg.enable true;
|
||||
};
|
||||
extraConfig = {
|
||||
init = { defaultBranch = "main"; };
|
||||
pull = { rebase = true; };
|
||||
push = { autoSetupRemote = true; };
|
||||
core = { whitespace = "trailing-space,space-before-tab"; };
|
||||
safe = {
|
||||
directory = "${user.home}/git";
|
||||
};
|
||||
"credential \"https://github.com\"" = {
|
||||
helper = "!gh auth git-credential";
|
||||
};
|
||||
alias = {
|
||||
co = "checkout";
|
||||
ci = "commit --signoff";
|
||||
};
|
||||
pull.ff = "only";
|
||||
core.pager = "${pkgs.delta}/bin/delta";
|
||||
delta = {
|
||||
features = "decorations";
|
||||
syntax-theme = "DarkNeon";
|
||||
light = "false";
|
||||
navigate = "true";
|
||||
};
|
||||
interactive.diffFilter = "${pkgs.delta}/bin/delta --color-only";
|
||||
merge.conflictStyle = "diff3";
|
||||
diff.colorMoved = "default";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue