1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00

add wcd and where scripts

This commit is contained in:
Kierán Meinhardt
2019-08-22 09:44:11 +02:00
parent 2f63ff75f0
commit 9550f1b1a0

View File

@@ -183,7 +183,19 @@
}
{
environment.interactiveShellInit = "export PATH=$PATH:$HOME/.cargo/bin";
environment.shellAliases = {
environment.shellAliases =
let
wcd =
pkgs.writeScript "wcd" ''
#!/bin/sh
cd "$(${pkgs.coreutils}/bin/readlink "$(${pkgs.which}/bin/which --skip-alias "$1")" | ${pkgs.findutils}/bin/xargs ${pkgs.coreutils}/bin/dirname)/.."
'';
where =
pkgs.writeScript "where" ''
#!/bin/sh
${pkgs.coreutils}/bin/readlink "$(${pkgs.which}/bin/which --skip-alias "$1")" | ${pkgs.findutils}/bin/xargs ${pkgs.coreutils}/bin/dirname
'';
in {
clipboard = "${pkgs.xclip}/bin/xclip -se c";
o = "${pkgs.xdg_utils}/bin/xdg-open";
tmux = "${pkgs.tmux}/bin/tmux -2";
@@ -198,6 +210,8 @@
ll = "${pkgs.exa}/bin/exa -l";
la = "${pkgs.exa}/bin/exa -la";
dig = "dig +short";
wcd = "source ${wcd}";
where = "source ${where}";
};
}
{