Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Improve detect NixOS version #2157

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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