Skip to content

Commit 1792eda

Browse files
committed
feat(commands/install): check if runner has nix
1 parent 194d465 commit 1792eda

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/checks.gleam

+10
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import gleam/io
22
import gleam/list
3+
import gleam/option
34
import gleam/string
45
import glexec as exec
56
import utils
67

78
pub fn checks(system_address_pairs: List(#(String, String))) {
89
io.println("📋 Preflight Checks:")
10+
runner_has_nix()
911
use pair <- list.each(system_address_pairs)
1012
let #(system, address) = pair
1113

@@ -15,6 +17,14 @@ pub fn checks(system_address_pairs: List(#(String, String))) {
1517
has_kexec(pair)
1618
}
1719

20+
fn runner_has_nix() {
21+
let nix = exec.find_executable("nix")
22+
case nix {
23+
Error(_) -> io.println_error(" ❌ You don't have nix installed!")
24+
Ok(_) -> io.println(" ✅ You have nix installed!")
25+
}
26+
}
27+
1828
fn ping(system_address_pair: #(String, String)) {
1929
let #(_system, address) = system_address_pair
2030

0 commit comments

Comments
 (0)