zsh: Remove _nr function
This commit is contained in:
parent
2b287cfbbf
commit
6b0e3567be
@ -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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user