Reorganize repository
This commit is contained in:
parent
da1824edb6
commit
0fc6c32a47
124 changed files with 16295 additions and 1229 deletions
92
modules/development/git/default.nix
Normal file
92
modules/development/git/default.nix
Normal file
|
@ -0,0 +1,92 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
options.chvp.development.git = {
|
||||
enable = lib.mkOption {
|
||||
default = false;
|
||||
example = true;
|
||||
};
|
||||
email = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "charlotte@vanpetegem.me";
|
||||
example = "charlotte@vanpetegem.me";
|
||||
description = ''
|
||||
Default email set in global git config.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config =
|
||||
let
|
||||
base = {
|
||||
home.packages = with pkgs; [
|
||||
gitAndTools.gitflow
|
||||
git-crypt
|
||||
];
|
||||
programs.git = {
|
||||
enable = true;
|
||||
extraConfig = {
|
||||
branch.autosetuprebase = "always";
|
||||
pull.rebase = true;
|
||||
github.user = "chvp";
|
||||
};
|
||||
ignores = [
|
||||
".direnv"
|
||||
".envrc"
|
||||
"shell.nix"
|
||||
# Ruby dependencies in source tree
|
||||
"/vendor/bundle"
|
||||
];
|
||||
signing = {
|
||||
key = "charlotte@vanpetegem.me";
|
||||
signByDefault = config.chvp.graphical.enable;
|
||||
};
|
||||
userEmail = config.chvp.development.git.email;
|
||||
userName = "Charlotte Van Petegem";
|
||||
};
|
||||
};
|
||||
in
|
||||
lib.mkIf config.chvp.development.git.enable {
|
||||
chvp.base.emacs.extraConfig = [
|
||||
''
|
||||
;; Magit GitHub/GitLab integration
|
||||
(use-package forge
|
||||
:after magit)
|
||||
|
||||
;; Git integration
|
||||
(use-package magit
|
||||
:demand t
|
||||
:general
|
||||
(lmap
|
||||
"g" '(:ignore t :which-key "git")
|
||||
"gs" '(magit-status :which-key "status")
|
||||
)
|
||||
)
|
||||
|
||||
;; Project management
|
||||
(use-package projectile
|
||||
:after (ripgrep selectrum)
|
||||
:demand t
|
||||
:diminish (projectile-mode)
|
||||
:config (projectile-mode 1)
|
||||
:general
|
||||
(lmap
|
||||
"p" '(:ignore t :which-key "project")
|
||||
"pf" '(projectile-find-file :which-key "find")
|
||||
"pp" '(projectile-switch-project :which-key "switch")
|
||||
"pr" '(projectile-replace :which-key "replace")
|
||||
"ps" '(consult-ripgrep :search "incsearch")
|
||||
"pS" '(projectile-ripgrep :which-key "search")
|
||||
"p!" '(projectile-run-shell-command-in-root :which-key "command")
|
||||
"p&" '(projectile-run-async-shell-command-in-root :which-key "task")
|
||||
)
|
||||
)
|
||||
|
||||
;; Ripgrep support (needed for `projectile-ripgrep')
|
||||
(use-package ripgrep)
|
||||
''
|
||||
];
|
||||
home-manager.users.charlotte = { ... }: base;
|
||||
home-manager.users.root = { ... }: base;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue