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

fix(scripts): niveum-update, where, wcd

This commit is contained in:
Kierán Meinhardt
2019-10-26 19:43:29 +02:00
parent 6591a39532
commit 394ec9309f

View File

@@ -193,7 +193,7 @@ in
(pkgs.writers.writeDashBin "niveum-update" ''
${pkgs.nix-prefetch-git}/bin/nix-prefetch-git \
--url https://github.com/NixOS/nixpkgs-channels \
--rev refs/heads/nixos-${config.system.stateVersion}
--rev refs/heads/nixos-${config.system.stateVersion} \
> "${niveumPath}/nixpkgs.json"
'')
];
@@ -202,14 +202,11 @@ in
environment.interactiveShellInit = "export PATH=$PATH:$HOME/.cargo/bin";
environment.shellAliases =
let
path = makeBinPath [ pkgs.which pkgs.coreutils pkgs.findutils ];
wcd = pkgs.writers.writeDash "wcd" ''
PATH=${path}
cd "$(readlink "$(which --skip-alias "$1")" | xargs dirname)/.."
cd "$(readlink "$(${pkgs.which}/bin/which --skip-alias "$1")" | xargs dirname)/.."
'';
where = pkgs.writers.writeDash "where" ''
PATH=${path}
readlink "$(which --skip-alias "$1")" | xargs dirname
readlink "$(${pkgs.which}/bin/which --skip-alias "$1")" | xargs dirname
'';
take = pkgs.writers.writeDash "take" ''
mkdir "$1" && cd "$1"