fix(lib): doom-system-distro-version: check nixos-version first

Even if a NixOS machine has lsb_release in its PATH, lsb_release will be used
instead of nixos-version to determine the distro version.
This commit is contained in:
Peter Hoeg 2023-07-22 14:16:09 +00:00 committed by GitHub
parent 96ab62d566
commit 12dfc62ae5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,10 +31,10 @@
(format "Windows %s" "Unknown")) ; TODO
((eq distro 'macos)
(format "MacOS %s" (sh "sw_vers" "-productVersion")))
((executable-find "lsb_release")
(sh "lsb_release" "-s" "-d"))
((executable-find "nixos-version")
(format "NixOS %s" (sh "nixos-version")))
((executable-find "lsb_release")
(sh "lsb_release" "-s" "-d"))
((ignore-errors
(with-file-contents! "/etc/os-release"
(when (re-search-forward "^PRETTY_NAME=\"?\\([^\"\n]+\\)\"?" nil t)