port new home manager config to work laptop

This commit is contained in:
Cyryl Płotnicki 2020-07-29 08:16:28 +01:00
parent 9520ef38a7
commit 0fb3e72df2
3 changed files with 31 additions and 24 deletions

View file

@ -1,26 +1,8 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
{ {
home-manager.users.cyryl = {...}: { home-manager.users.cyryl = {...}: {
programs.git = { imports = [
enable = true; ./home.nix
lfs.enable = true; ];
userName = "Cyryl Płotnicki"; };
userEmail = "cyplo@cyplo.net"; }
extraConfig = {
credential = { helper ="cache"; };
core = { pager = "cat"; };
pager = {
diff = "${pkgs.gitAndTools.diff-so-fancy}/bin/diff-so-fancy | less --tabs=1,5 -RFX";
show = "${pkgs.gitAndTools.diff-so-fancy}/bin/diff-so-fancy | less --tabs=1,5 -RFX";
};
};
aliases =
{
tree = "log --show-signature --color --decorate --date=short --all --graph -n 3";
newbranch = "!git checkout master && git fetch -p && git reset --hard origin/master && git checkout -b $2";
head = "log HEAD -n1";
vacuum = "!git fetch -p && git branch -vv | awk '/: gone]/{print $1}' | xargs -r git branch -D && git gc --aggressive --auto";
};
};
};
}

24
nixos/git/home.nix Normal file
View file

@ -0,0 +1,24 @@
{ config, pkgs, ... }:
{
programs.git = {
enable = true;
lfs.enable = true;
userName = "Cyryl Płotnicki";
userEmail = "cyplo@cyplo.net";
extraConfig = {
credential = { helper ="cache"; };
core = { pager = "cat"; };
pager = {
diff = "${pkgs.gitAndTools.diff-so-fancy}/bin/diff-so-fancy | less --tabs=1,5 -RFX";
show = "${pkgs.gitAndTools.diff-so-fancy}/bin/diff-so-fancy | less --tabs=1,5 -RFX";
};
};
aliases =
{
tree = "log --show-signature --color --decorate --date=short --all --graph -n 3";
newbranch = "!git checkout master && git fetch -p && git reset --hard origin/master && git checkout -b $2";
head = "log HEAD -n1";
vacuum = "!git fetch -p && git branch -vv | awk '/: gone]/{print $1}' | xargs -r git branch -D && git gc --aggressive --auto";
};
};
}

View file

@ -22,6 +22,7 @@ in
home.file.".config/i3/status.toml".source = ~/dev/dotfiles/.config/i3/status-single-bat.toml; home.file.".config/i3/status.toml".source = ~/dev/dotfiles/.config/i3/status-single-bat.toml;
imports = [ imports = [
./home-common.nix ./home-manager/default.nix
./git/home.nix
]; ];
} }