Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
];
});
runtimeDeps = [
pkgs.iproute2
(if pkgs.stdenv.isLinux then pkgs.iproute2 else pkgs.iproute2mac)
pkgs.nix
pkgs.openssh
pkgs.vde2
Expand Down
5 changes: 5 additions & 0 deletions src/NixVms.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import Network.Socket.Free (getFreePort)
import Options (VmName (..))
import State
import StdLib
import System.Info (os)
import System.Directory (createDirectoryIfMissing, listDirectory)
import System.Environment (getEnvironment)
import System.FilePath (takeDirectory)
Expand Down Expand Up @@ -52,6 +53,9 @@ listVmsImpl ctx = do
Left err -> impossible ctx $ cs err
Right (parsed :: [Text]) -> pure $ map VmName parsed

darwinBuilderArgs :: [Text]
darwinBuilderArgs = if os == "darwin" then ["--builders", "/etc/nix/builder_ed25519"] else [""]

buildVmScriptImpl :: Context -> Maybe Handle -> VmName -> IPv4 -> IO (FilePath, Port)
buildVmScriptImpl ctx handle vmName ip = do
port <- getFreePort
Expand Down Expand Up @@ -84,6 +88,7 @@ buildVmScriptImpl ctx handle vmName ip = do
"--no-link",
drvPath <> "^*"
]
<> darwinBuilderArgs
)
& Cradle.setWorkingDir (workingDir ctx)
& maybe id addStderrHandle handle
Expand Down