zsh: Remove _nr function

This commit is contained in:
Giulio De Pasquale 2023-03-27 17:48:21 +02:00
parent 2b287cfbbf
commit 6b0e3567be

View File

@ -1,4 +1,4 @@
{ config, pkgs, lib, optionalString, ... }: { config, pkgs, lib, ... }:
let let
inherit (pkgs.lib) optionalString; inherit (pkgs.lib) optionalString;
@ -12,28 +12,6 @@ let
exec ${pkgs.zsh}/bin/zsh exec ${pkgs.zsh}/bin/zsh
''; '';
nix_run_fn = ''
function _nr {
if [ "$#" -lt 1 ]; then
echo "Usage: _nr <pkg>"
return
fi
quoted_args=()
local pkg=$1
shift 1
for a in "$@"; do
quoted_args+=("\"$a\"")
done
echo ''${quoted_args[@]}
# `nix run nixpkgs#$pkg -- ''${quoted_args[@]}`
exec nix run nixpkgs#$pkg "$@"
}
'';
in in
{ {
programs.zsh = { programs.zsh = {
@ -47,11 +25,6 @@ in
}; };
home.file.".bashrc".text = '' home.file.".bashrc".text = ''
${nix_run_fn}
${optionalString (!builtins.hasAttr "users" config) "${exec_zsh}"} ${optionalString (!builtins.hasAttr "users" config) "${exec_zsh}"}
''; '';
home.file.".zshrc".text = nix_run_fn;
} }