summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2018-08-01 21:13:38 +0200
committerDaiderd Jordan <daiderd@gmail.com>2018-08-01 21:13:38 +0200
commit35c23a8fbf2ef5bdc93a4f00c2f82fb0ef44b167 (patch)
tree30eec710723bd1275aad2f063e6b9916a7375991
parenta893723b95eca2ab3c5ab50609b6045d1889578a (diff)
lnl: update direnv/nix-repl aliases
-rw-r--r--modules/examples/lnl.nix92
1 files changed, 58 insertions, 34 deletions
diff --git a/modules/examples/lnl.nix b/modules/examples/lnl.nix
index 4dadffb..95d9be5 100644
--- a/modules/examples/lnl.nix
+++ b/modules/examples/lnl.nix
@@ -215,13 +215,21 @@
:l() {
if [ ! -e .envrc ]; then
echo 'use nix' > .envrc
+ direnv edit .
fi
- direnv allow
eval "$(direnv hook zsh)"
}
:r() {
- direnv reload
+ if [ -z "$IN_NIX_SHELL" ]; then
+ eval "$(direnv hook zsh)"
+ else
+ direnv reload
+ fi
+ }
+
+ :a() {
+ nix repl ''${@:-<nixpkgs>}
}
xi() {
@@ -236,10 +244,6 @@
${pkgs.darwin.cctools}/bin/otool "$@"
}
- pkgs() {
- nix repl ''${@:-<nixpkgs>}
- }
-
aarch-build() {
nix-build --option system aarch64-linux --store ssh-ng://aarch1 "$@"
}
@@ -344,6 +348,7 @@
zle -N up-line-or-beginning-search
'';
+ environment.variables.CLICOLOR = "1";
environment.variables.FZF_DEFAULT_COMMAND = "ag -l -f -g ''";
environment.variables.SHELLCHECK_OPTS = "-e SC1008";
environment.variables.LANG = "en_US.UTF-8";
@@ -354,11 +359,10 @@
environment.shellAliases.gcb = "git checkout -B";
environment.shellAliases.gd = "git diff --minimal --patch";
environment.shellAliases.gf = "git fetch";
- environment.shellAliases.gl = "git log --pretty=color --graph";
- environment.shellAliases.glog = "git log --pretty=nocolor";
+ environment.shellAliases.gg = "git log --pretty=color --graph";
+ environment.shellAliases.gl = "git log --pretty=nocolor";
environment.shellAliases.grh = "git reset --hard";
environment.shellAliases.l = "ls -lh";
- environment.shellAliases.ls = "ls -G";
nix.nixPath =
[ # Use local nixpkgs checkout instead of channels.
@@ -406,33 +410,23 @@
esac
EOF
'';
- })
- ];
-
- # TODO: add module for per-user config, etc, ...
- system.activationScripts.extraUserActivation.text = "ln -sfn /etc/per-user/lnl/gitconfig ~/.gitconfig";
-
- environment.etc."per-user/lnl/gitconfig".text = ''
- [include]
- path = .gitconfig.local
- [core]
- excludesfile = ~/.gitignore
- autocrlf = input
-
- [color]
- ui = auto
-
- [pretty]
- color = format:%C(yellow)%h%Cblue%d%Creset %s %C(white) %an, %ar%Creset
- nocolor = format:%h%d %s %an, %ar
-
- [user]
- name = Daiderd Jordan
+ vim_configurable = super.vim_configurable.override {
+ ftNixSupport = false; # enable using a custom vim-nix
+ };
+ })
- [github]
- user = LnL7
- '';
+ (self: super: {
+ # TODO: fix darwin build in nixpkgs.
+ kitty = super.runCommandNoCC "kitty" {} ''
+ mkdir -p $out/bin
+ ln -s /Applications/Kitty.app/Contents/MacOS/kitty $out/bin
+ '';
+
+ vimPlugins = super.vimPlugins or {} // {
+ };
+ })
+ ];
services.khd.khdConfig = ''
# modifier only mappings
@@ -539,11 +533,41 @@
ctrl + alt - s : kwmc space -t monocle
ctrl + alt - d : kwmc space -t float
+ ctrl + alt - return : kitty --single-instance -d ~
+
# quit/reload daemons
ctrl + alt - q : kwmc quit;\
khd -e "reload"
'';
+ # TODO: add module for per-user config, etc, ...
+ system.activationScripts.extraUserActivation.text = "ln -sfn /etc/per-user/lnl/gitconfig ~/.gitconfig";
+
+ environment.etc."per-user/lnl/gitconfig".text = ''
+ [include]
+ path = .gitconfig.local
+
+ [core]
+ excludesfile = ~/.gitignore
+ autocrlf = input
+
+ [color]
+ ui = auto
+
+ [pretty]
+ color = format:%C(yellow)%h%C(red)%d%Creset %s %C(green)%an, %ar%Creset
+ nocolor = format:%h%d %s %an, %ar
+
+ [rerere]
+ enabled = true
+
+ [user]
+ name = Daiderd Jordan
+
+ [github]
+ user = LnL7
+ '';
+
# You should generally set this to the total number of logical cores in your system.
# $ sysctl -n hw.ncpu
nix.maxJobs = 1;