Bash : Replace aliases.
This commit is contained in:
parent
396fff0367
commit
6324a2a46c
|
@ -1,11 +1,10 @@
|
||||||
{ ... }: {
|
{ ... }: {
|
||||||
text = ''
|
text = ''
|
||||||
# Open file/dir in GUI.
|
# Open file/dir in GUI.
|
||||||
# Usage: open <FILE>
|
# Usage: o <FILE>
|
||||||
function open() {
|
function o() {
|
||||||
xdg-open "''${@}"
|
xdg-open "''${@}"
|
||||||
}
|
}
|
||||||
alias o="open"
|
|
||||||
|
|
||||||
# Play media file from CLI. All files by default.
|
# Play media file from CLI. All files by default.
|
||||||
# Usage: play [FILE]
|
# Usage: play [FILE]
|
||||||
|
|
|
@ -24,8 +24,8 @@
|
||||||
|
|
||||||
# Spawn shell with specified nix environment.
|
# Spawn shell with specified nix environment.
|
||||||
# Uses flake.nix in current dir by default.
|
# Uses flake.nix in current dir by default.
|
||||||
# Usage: nix_shell [NAME]
|
# Usage: shell [NAME]
|
||||||
function nix_shell() {
|
function shell() {
|
||||||
local target="''${1}"
|
local target="''${1}"
|
||||||
[[ "''${target}" = "" ]] && target="default"
|
[[ "''${target}" = "" ]] && target="default"
|
||||||
|
|
||||||
|
@ -34,18 +34,17 @@
|
||||||
|
|
||||||
SHELL_NAME="''${target}" nix develop ".#devShells.''${NIX_CURRENT_SYSTEM}.''${target}"
|
SHELL_NAME="''${target}" nix develop ".#devShells.''${NIX_CURRENT_SYSTEM}.''${target}"
|
||||||
}
|
}
|
||||||
alias shell="nix_shell"
|
|
||||||
|
|
||||||
# Spawn temporary nix-shell with specified packages.
|
# Spawn temporary nix-shell with specified packages.
|
||||||
# Usage: nix_tmpshell <PACKAGES>
|
# Usage: tmpshell <PACKAGES>
|
||||||
function nix_tmpshell() {
|
function tmpshell() {
|
||||||
local IFS=$'\n'
|
local IFS=$'\n'
|
||||||
local input=("''${@}")
|
local input=("''${@}")
|
||||||
local pkgs=()
|
local pkgs=()
|
||||||
local tag="''${SHELL_NAME}"
|
local tag="''${SHELL_NAME}"
|
||||||
|
|
||||||
if [[ "''${input}" = "" ]]; then
|
if [[ "''${input}" = "" ]]; then
|
||||||
help nix_tmpshell
|
help tmpshell
|
||||||
return 2
|
return 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -57,7 +56,6 @@
|
||||||
|
|
||||||
SHELL_NAME="''${tag}" NIXPKGS_ALLOW_UNFREE=1 nix shell --impure ''${pkgs[@]}
|
SHELL_NAME="''${tag}" NIXPKGS_ALLOW_UNFREE=1 nix shell --impure ''${pkgs[@]}
|
||||||
}
|
}
|
||||||
alias tmpshell="nix_tmpshell"
|
|
||||||
|
|
||||||
# Build live image.
|
# Build live image.
|
||||||
function nixos_live() {
|
function nixos_live() {
|
||||||
|
|
Loading…
Reference in a new issue