Compare commits

...

2 commits

Author SHA1 Message Date
Dmitry Voronin fa2ad42ecf
PS1 : Add shell lvl. 2024-09-30 13:55:42 +03:00
Dmitry Voronin d5414659c2
StrongSwan : Remove from host configs. 2024-09-30 13:55:40 +03:00
6 changed files with 14 additions and 9 deletions

View file

@ -14,6 +14,11 @@ in {
export -f $(find_function | tr '\n' ' ')
export -f find_function
# Nested shell indicator support.
if [ -z ''${SHLVLMIN} ]; then
export SHLVLMIN=''${SHLVL}
fi
# Autostart Sway.
if [[ -z $DISPLAY ]] && [[ "$(tty)" = "/dev/tty1" ]]; then
exec sway

View file

@ -37,7 +37,7 @@
# Spawn Nix shell with required tools.
function dvd_shell() {
NIX_SHELL="dvd" tmpshell dvdplusrwtools cdrkit
SHELL_NAME="dvd" tmpshell dvdplusrwtools cdrkit
}
'';
}

View file

@ -32,7 +32,7 @@
# Create Nix GC root in .NixRoot{NAME}.
nix build ".#devShells.''${NIX_CURRENT_SYSTEM}.''${target}" -o ".NixRoot''${target^}"
NIX_SHELL="''${target}" nix develop ".#devShells.''${NIX_CURRENT_SYSTEM}.''${target}"
SHELL_NAME="''${target}" nix develop ".#devShells.''${NIX_CURRENT_SYSTEM}.''${target}"
}
alias shell="nix_shell"
@ -42,7 +42,7 @@
local IFS=$'\n'
local input=("''${@}")
local pkgs=()
local tag="''${NIX_SHELL}"
local tag="''${SHELL_NAME}"
if [[ "''${input}" = "" ]]; then
help nix_tmpshell
@ -55,7 +55,7 @@
pkgs+=("nixpkgs#''${pkg}")
done
NIX_SHELL="''${tag}" NIXPKGS_ALLOW_UNFREE=1 nix shell --impure ''${pkgs[@]}
SHELL_NAME="''${tag}" NIXPKGS_ALLOW_UNFREE=1 nix shell --impure ''${pkgs[@]}
}
alias tmpshell="nix_tmpshell"

View file

@ -85,9 +85,11 @@ in {
# Command on new line.
PS1+="\n"
# Show nix shell name.
if [ -n "''${NIX_SHELL}" ]; then
PS1+="''${NIX_SHELL} "
# Show nix shell name or shell depth.
if [ -n "''${SHELL_NAME}" ]; then
PS1+="''${SHELL_NAME} "
elif [[ "''${SHLVL}" -gt "''${SHLVLMIN}" ]]; then
PS1+="($((''${SHLVL} - ''${SHLVLMIN}))) "
fi
# Show remote connections.

View file

@ -13,7 +13,6 @@
kernel.enable = true;
keyd.enable = true;
print.enable = true;
strongswan.enable = true;
tablet.enable = true;
intel.cpu = {
enable = true;

View file

@ -13,7 +13,6 @@
kernel.enable = true;
keyd.enable = true;
print.enable = true;
strongswan.enable = true;
tablet.enable = true;
amd = {
compute.enable = true;