1import { execSync } from 'child_process' 4export const isWithNix = () => cliFlag('--withNix') 6export const guardNixInstalled = () => { 8 execSync('which nix', {stdio: 'ignore'}) 11 'nix not found. Install with:', 13 ' sh <(curl -L https://nixos.org/nix/install) --daemon', 15 'Then restart your shell and re-run with --withNix.', 16 'Docs: https://nixos.org/download', 21 // nix store info hangs with ssh-ng://, so test with a trivial build dispatch instead 22 execSync(`nix build --impure --expr '(import <nixpkgs> { system = "x86_64-linux"; }).hello' --no-link 2>&1`, {timeout: 60000, stdio: 'ignore'}) 25 'nix remote builder not reachable or not configured.', 27 'Deploy the builder: ptnode pt0/klustersF/do2demo/epSyncNixbuilder.mjs apply', 28 'Then configure: ptnode pt0/klustersF/do2demo/epSyncNixbuilder.mjs setup', 29 'Host key changed? ptnode pt0/klustersF/do2demo/epSyncNixbuilder.mjs fixssh',