Skip to content

Commit

Permalink
[PR] dylanaraps#2157 from Izorkin - Improve detect NixOS version
Browse files Browse the repository at this point in the history
Upstream PR: dylanaraps#2157
Thanks to @Izorkin

Co-authored-by: Izorkin <izorkin@elven.pw>
  • Loading branch information
hykilpikonna and Izorkin committed Jul 30, 2022
2 parents 7a7e710 + de253af commit 0b0eafb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions neofetch
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,13 @@ get_distro() {
*) distro="OS Elbrus $(< /etc/mcst_version)"
esac

elif [[ -f /etc/NIXOS ]]; then
case $distro_shorthand in
on) distro="NixOS $(nixos-version | awk '{print substr($1,0,5),$2}')" ;;
tiny) distro="NixOS" ;;
*) distro="NixOS $(nixos-version)" ;;
esac

elif type -p pveversion >/dev/null; then
case $distro_shorthand in
on|tiny) distro="Proxmox VE" ;;
Expand Down

0 comments on commit 0b0eafb

Please sign in to comment.