Even in a simple flake demo, unable to run zig build
, due to the blocking error: ReadOnlyFileSystem
.
[flake.nix]
{
description = "A very basic flake";
inputs = {
nixpkgs.url = "flake:nixpkgs";
};
outputs = { self, nixpkgs }: let
system = "aarch64-darwin";
pkgs = import nixpkgs { inherit system; };
in {
packages.${system}.default = pkgs.stdenv.mkDerivation {
pname = "zig-hello";
version = "0.1.0";
src = ./src;
buildInputs = [ pkgs.zig ];
buildPhase = ''
mkdir -p $TMPDIR/bin
# touch $TMPDIR/bin/zig-hello
zig build-exe main.zig -femit-bin=$TMPDIR/bin/zig-hello
'';
installPhase = ''
mkdir -p $out/bin
cp $TMPDIR/bin/zig-hello $out/bin
'';
};
};
}
mkdir
and touch
run regularly, but zig build
always complains that error.
Is there somebody understand why?