add kak-pager and diffr
This commit is contained in:
parent
9d850b5a09
commit
97bbd4ebb0
13
diffr.nix
Normal file
13
diffr.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
pkgs.writeShellScriptBin "diffr" ''
|
||||
exec ${pkgs.diffr}/bin/diffr \
|
||||
--colors 'refine-added:foreground:green:underline' \
|
||||
--colors 'refine-added:background:none' \
|
||||
--colors 'refine-removed:foreground:red:underline' \
|
||||
--colors 'refine-removed:background:none' \
|
||||
--colors 'added:foreground:green' \
|
||||
--colors 'added:background:none' \
|
||||
--colors 'removed:foreground:red' \
|
||||
--colors 'removed:background:none' \
|
||||
$@
|
||||
''
|
|
@ -35,6 +35,8 @@
|
|||
(_: _: {
|
||||
dhist = dhist.packages.${system}.dhist;
|
||||
bmenu = import ./bmenu.nix { inherit config pkgs lib; };
|
||||
_diffr = import ./diffr.nix { inherit config pkgs lib; };
|
||||
kak-pager = import ./kak-pager.nix { inherit config pkgs lib; };
|
||||
})
|
||||
];
|
||||
})
|
||||
|
|
36
kak-pager.nix
Normal file
36
kak-pager.nix
Normal file
|
@ -0,0 +1,36 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
pkgs.writeScriptBin "kak-pager" ''
|
||||
#!/usr/bin/env fish
|
||||
|
||||
if test (count $argv) -ne 0
|
||||
for i in $argv
|
||||
cat "$i"
|
||||
end | eval (status filename)
|
||||
exit 0
|
||||
end
|
||||
|
||||
set term_line_count (tput lines)
|
||||
|
||||
while read line
|
||||
set -a input_lines "$line"
|
||||
|
||||
set input_line_count (printf "%s\n" $input_lines | wc -l)
|
||||
|
||||
if test "$term_line_count" -lt "$input_line_count"
|
||||
begin
|
||||
printf "%s\n" $input_lines
|
||||
cat
|
||||
end | kak -e '
|
||||
exec <a-o>
|
||||
map global normal q :q<ret>;
|
||||
rmhl global/number-lines;
|
||||
set global scrolloff 10,0;
|
||||
'
|
||||
|
||||
exit 0
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
printf "%s\n" $input_lines
|
||||
''
|
34
user/git.nix
Normal file
34
user/git.nix
Normal file
|
@ -0,0 +1,34 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
let inherit (import ./variables.nix) username mail;
|
||||
in {
|
||||
config = {
|
||||
programs.git = {
|
||||
enable = true;
|
||||
extraConfig = {
|
||||
user = {
|
||||
name = username;
|
||||
email = mail.personal.user;
|
||||
};
|
||||
init.defaultBranch = "main";
|
||||
commit.verbose = true;
|
||||
pull.rebase = true;
|
||||
merge.conflictStyle = "diff3";
|
||||
rerere.enabled = true;
|
||||
rebase = {
|
||||
abbreviateCommands = true;
|
||||
autoSquash = true;
|
||||
autoStash = true;
|
||||
};
|
||||
pager = {
|
||||
log = "${pkgs._diffr}/bin/diffr | ${pkgs.kak-pager}/bin/kak-pager";
|
||||
show = "${pkgs._diffr}/bin/diffr | ${pkgs.kak-pager}/bin/kak-pager";
|
||||
diff = "${pkgs._diffr}/bin/diffr | ${pkgs.kak-pager}/bin/kak-pager";
|
||||
};
|
||||
alias = {
|
||||
graph = "log --graph --oneline --all";
|
||||
root = "rev-parse --show-toplevel";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -10,12 +10,7 @@ let
|
|||
volumesh =
|
||||
pkgs.writeShellScriptBin "volumesh" (builtins.readFile ./scripts/volumesh);
|
||||
in {
|
||||
imports = [
|
||||
./waybar.nix
|
||||
./helix.nix
|
||||
./kakoune.nix
|
||||
./sway.nix
|
||||
];
|
||||
imports = [ ./waybar.nix ./helix.nix ./kakoune.nix ./sway.nix ./git.nix ];
|
||||
# Home Manager needs a bit of information about you and the
|
||||
# paths it should manage.
|
||||
home.username = "lelgenio";
|
||||
|
@ -35,6 +30,8 @@ in {
|
|||
alacritty
|
||||
exa
|
||||
fd
|
||||
_diffr
|
||||
kak-pager
|
||||
# text manipulation
|
||||
sd
|
||||
ripgrep
|
||||
|
|
|
@ -125,6 +125,8 @@ in {
|
|||
];
|
||||
home.sessionVariables = {
|
||||
EDITOR = "kak";
|
||||
# Some plugins(kak_ansi) like to compile stuff
|
||||
CC = "cc";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -66,4 +66,28 @@ in rec {
|
|||
big = 16;
|
||||
};
|
||||
};
|
||||
|
||||
username = "lelgenio";
|
||||
mail = {
|
||||
personal = {
|
||||
from = "Leonardo Eugênio";
|
||||
user = "lelgenio@disroot.org";
|
||||
imap = "disroot.org";
|
||||
smtp = "disroot.org";
|
||||
pass = "disroot.org";
|
||||
};
|
||||
work = {
|
||||
from = "Leonardo Eugênio";
|
||||
user = "leonardo@wopus.com.br";
|
||||
imap = "imap.wopus.com.br";
|
||||
smtp = "smtp.wopus.com.br";
|
||||
pass = "Work/wopus_email";
|
||||
};
|
||||
};
|
||||
nextcloud = {
|
||||
name = "disroot";
|
||||
user = "lelgenio";
|
||||
host = "cloud.disroot.org";
|
||||
pass = "disroot.org";
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue