We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a8104fd commit a39c96fCopy full SHA for a39c96f
1 file changed
src/check_os.sh
@@ -11,6 +11,8 @@ function check_os::init() {
11
_DISTRO="Ubuntu"
12
elif check_os::is_alpine; then
13
_DISTRO="Alpine"
14
+ elif check_os::is_nixos; then
15
+ _DISTRO="NixOS"
16
else
17
_DISTRO="Other"
18
fi
@@ -32,6 +34,11 @@ function check_os::is_alpine() {
32
34
command -v apk > /dev/null
33
35
}
36
37
+function check_os::is_nixos() {
38
+ [[ -f /etc/NIXOS ]] && return 0
39
+ grep -q '^ID=nixos' /etc/os-release 2>/dev/null
40
+}
41
+
42
function check_os::is_linux() {
43
[[ "$(uname)" == "Linux" ]]
44
@@ -71,3 +78,4 @@ export _DISTRO
71
78
export -f check_os::is_alpine
72
79
export -f check_os::is_busybox
73
80
export -f check_os::is_ubuntu
81
+export -f check_os::is_nixos
0 commit comments