Bash : Replace aliases.

This commit is contained in:
Dmitry Voronin 2024-10-04 12:08:23 +03:00
parent 396fff0367
commit 6324a2a46c
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k
2 changed files with 7 additions and 10 deletions

View file

@ -1,11 +1,10 @@
{ ... }: {
text = ''
# Open file/dir in GUI.
# Usage: open <FILE>
function open() {
# Usage: o <FILE>
function o() {
xdg-open "''${@}"
}
alias o="open"
# Play media file from CLI. All files by default.
# Usage: play [FILE]

View file

@ -24,8 +24,8 @@
# Spawn shell with specified nix environment.
# Uses flake.nix in current dir by default.
# Usage: nix_shell [NAME]
function nix_shell() {
# Usage: shell [NAME]
function shell() {
local target="''${1}"
[[ "''${target}" = "" ]] && target="default"
@ -34,18 +34,17 @@
SHELL_NAME="''${target}" nix develop ".#devShells.''${NIX_CURRENT_SYSTEM}.''${target}"
}
alias shell="nix_shell"
# Spawn temporary nix-shell with specified packages.
# Usage: nix_tmpshell <PACKAGES>
function nix_tmpshell() {
# Usage: tmpshell <PACKAGES>
function tmpshell() {
local IFS=$'\n'
local input=("''${@}")
local pkgs=()
local tag="''${SHELL_NAME}"
if [[ "''${input}" = "" ]]; then
help nix_tmpshell
help tmpshell
return 2
fi
@ -57,7 +56,6 @@
SHELL_NAME="''${tag}" NIXPKGS_ALLOW_UNFREE=1 nix shell --impure ''${pkgs[@]}
}
alias tmpshell="nix_tmpshell"
# Build live image.
function nixos_live() {