Merge pull request #59 from LovingMelody/master

Add: Add NixOS Check
This commit is contained in:
the Sane 2023-07-28 21:30:59 -04:00 committed by GitHub
commit cc9b516646
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 0 deletions

View File

@ -82,4 +82,5 @@ _Optional Dependencies: **zenity** (for GUI)_
- https://github.com/victort
- https://github.com/Wrzlprnft
- https://github.com/ananace
- https://github.com/LovingMelody
- Runner Downloader inspired by https://github.com/richardtatum/sc-runner-updater

View File

@ -46,6 +46,7 @@
# Contributor: https://github.com/gort818
# Contributor: https://github.com/victort
# Contributor: https://github.com/Wrzlprnft
# Contributor: https://github.com/LovingMelody
# Runner Downloader inspired by:
# https://github.com/richardtatum/sc-runner-updater
#
@ -86,6 +87,12 @@ if [ ! -x "$(command -v xargs)" ]; then
exit 1
fi
# Checks for NixOS for NixOS specific options
if (grep '^NAME=NixOS' /etc/os-release -q 2> /dev/null ); then
is_nixos=1
else
is_nixos=0
fi
######## Config ############################################################
@ -222,6 +229,10 @@ repo="starcitizen-lug/lug-helper"
releases_url="https://github.com/$repo/releases"
current_version="v2.8"
# FIXME: Link
# NixOS section in Wiki
lug_wiki_nixos="https://github.com/starcitizen-lug/knowledge-base/wiki/Tips-and-Tricks"
############################################################################
############################################################################
############################################################################
@ -2497,6 +2508,15 @@ Usage: lug-helper <options>
fi
fi
# Detect if NixOS is being used and direct user to wiki
if [ "$is_nixos" -eq 1 ]; then
# Detect if Zenity is being used and format the links
if [ "$use_zenity" -eq 1 ]; then
lug_wiki_nixos="<a href='$lug_wiki_nixos'>$lug_wiki_nixos</a>"
fi
message info "It looks like you're using NixOS\nPlease see our wiki for NixOS-specific configuration requirements:\n\n$lug_wiki_nixos"
fi
# Loop the main menu until the user selects quit
while true; do
# Configure the menu