feat: git
This commit is contained in:
parent
fb29126d4c
commit
5b0774350f
3 changed files with 12 additions and 9 deletions
|
@ -10,6 +10,7 @@
|
||||||
./fuzzel.nix
|
./fuzzel.nix
|
||||||
./fzf.nix
|
./fzf.nix
|
||||||
./gh.nix
|
./gh.nix
|
||||||
|
./git
|
||||||
./nemo.nix
|
./nemo.nix
|
||||||
./nh.nix
|
./nh.nix
|
||||||
./waybar.nix
|
./waybar.nix
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
lib,
|
|
||||||
config,
|
config,
|
||||||
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
cfg = config.marleyos.programs.git;
|
cfg = config.marleyos.programs.git;
|
||||||
|
@ -14,6 +14,7 @@ in {
|
||||||
# ╚═╝ ╚═╝╚══════╝╚═╝╚═╝ ╚═╝╚══════╝╚══════╝╚══════╝
|
# ╚═╝ ╚═╝╚══════╝╚═╝╚═╝ ╚═╝╚══════╝╚══════╝╚══════╝
|
||||||
|
|
||||||
programs.git.aliases = let
|
programs.git.aliases = let
|
||||||
|
has_fish = config.programs.fish.enable;
|
||||||
fish_fns = config.programs.fish.functions;
|
fish_fns = config.programs.fish.functions;
|
||||||
in {
|
in {
|
||||||
### Staging ###
|
### Staging ###
|
||||||
|
@ -84,8 +85,8 @@ in {
|
||||||
|
|
||||||
b = "branch";
|
b = "branch";
|
||||||
cb = "checkout -b";
|
cb = "checkout -b";
|
||||||
cm = lib.mkIf (fish_fns ? git_main_branch) "!git checkout $(git_main_branch)";
|
cm = lib.mkIf (has_fish && (fish_fns ? git_main_branch)) "!git checkout $(git_main_branch)";
|
||||||
cd = lib.mkIf (fish_fns ? git_develop_branch) "!git checkout $(git_develop_branch)";
|
cd = lib.mkIf (has_fish && (fish_fns ? git_develop_branch)) "!git checkout $(git_develop_branch)";
|
||||||
|
|
||||||
m = "merge";
|
m = "merge";
|
||||||
mtl = "mergetool --no-prompt";
|
mtl = "mergetool --no-prompt";
|
||||||
|
@ -159,9 +160,9 @@ in {
|
||||||
|
|
||||||
nevermind = "!git reset --hard head && git clean -df";
|
nevermind = "!git reset --hard head && git clean -df";
|
||||||
|
|
||||||
open = lib.mkIf (config.programs.fish.enable && (fish_fns ? git_open)) "!fish -c git_open";
|
open = lib.mkIf (has_fish && (fish_fns ? git_open)) "!fish -c git_open";
|
||||||
|
|
||||||
chash = "!git log --oneline | gum filter --height 10 | cut -d' ' -f1 | ${config.marleyos.apps.clipboard.copy-command} &>/dev/null";
|
chash = "!git log --oneline | gum filter --height 10 | cut -d' ' -f1 | ${config.marleycfg.apps.clipboard.copy-command} &>/dev/null";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
|
@ -1,10 +1,12 @@
|
||||||
{
|
{
|
||||||
lib,
|
|
||||||
config,
|
config,
|
||||||
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
cfg = config.marleyos.programs.git;
|
cfg = config.marleyos.programs.git;
|
||||||
|
|
||||||
|
inherit (config.marleycfg) my;
|
||||||
in {
|
in {
|
||||||
options.marleyos.programs.git.enable = lib.mkEnableOption "git";
|
options.marleyos.programs.git.enable = lib.mkEnableOption "git";
|
||||||
|
|
||||||
|
@ -15,7 +17,6 @@ in {
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
gum
|
gum
|
||||||
config.marleyos.apps.clipboard.package
|
|
||||||
];
|
];
|
||||||
|
|
||||||
# ██████╗ ██╗████████╗
|
# ██████╗ ██╗████████╗
|
||||||
|
@ -28,8 +29,8 @@ in {
|
||||||
programs.git = {
|
programs.git = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
userName = "punkfairie";
|
userName = my.git.name;
|
||||||
userEmail = "marley@punkfairie.net";
|
userEmail = my.git.email;
|
||||||
|
|
||||||
signing = {
|
signing = {
|
||||||
signByDefault = true;
|
signByDefault = true;
|
Loading…
Reference in a new issue