mirror of
https://github.com/kmein/niveum
synced 2026-03-29 08:41:07 +02:00
feat(aliases): use makeBinPath
This commit is contained in:
@@ -1,4 +1,7 @@
|
|||||||
{ pkgs, lib, config, ... }:
|
{ pkgs, lib, config, ... }:
|
||||||
|
let
|
||||||
|
inherit (lib.strings) makeBinPath;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
<modules/constants.nix>
|
<modules/constants.nix>
|
||||||
@@ -189,13 +192,14 @@
|
|||||||
environment.interactiveShellInit = "export PATH=$PATH:$HOME/.cargo/bin";
|
environment.interactiveShellInit = "export PATH=$PATH:$HOME/.cargo/bin";
|
||||||
environment.shellAliases =
|
environment.shellAliases =
|
||||||
let
|
let
|
||||||
|
path = makeBinPath [ pkgs.which pkgs.coreutils pkgs.findutils ];
|
||||||
wcd = pkgs.writeDash "wcd" ''
|
wcd = pkgs.writeDash "wcd" ''
|
||||||
cd "$(${pkgs.coreutils}/bin/readlink "$(${pkgs.which}/bin/which --skip-alias "$1")" \
|
export PATH=${path}
|
||||||
| ${pkgs.findutils}/bin/xargs ${pkgs.coreutils}/bin/dirname)/.."
|
cd "$(readlink "$(which --skip-alias "$1")" | xargs dirname)/.."
|
||||||
'';
|
'';
|
||||||
where = pkgs.writeDash "where" ''
|
where = pkgs.writeDash "where" ''
|
||||||
${pkgs.coreutils}/bin/readlink "$(${pkgs.which}/bin/which --skip-alias "$1")" \
|
export PATH=${path}
|
||||||
| ${pkgs.findutils}/bin/xargs ${pkgs.coreutils}/bin/dirname
|
readlink "$(which --skip-alias "$1")" | xargs dirname
|
||||||
'';
|
'';
|
||||||
take = pkgs.writeDash "take" ''
|
take = pkgs.writeDash "take" ''
|
||||||
mkdir "$1" && cd "$1"
|
mkdir "$1" && cd "$1"
|
||||||
@@ -299,8 +303,10 @@
|
|||||||
script = ''
|
script = ''
|
||||||
set -efu
|
set -efu
|
||||||
|
|
||||||
${pkgs.procps}/bin/pkill -HUP --exact openvpn
|
export PATH=${makeBinPath [ pkgs.procps ]}
|
||||||
${pkgs.procps}/bin/pkill -ALRM --exact tincd
|
|
||||||
|
pkill -HUP --exact openvpn
|
||||||
|
pkill -ALRM --exact tincd
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user