Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
guillemcordoba committed Mar 7, 2024
1 parent 7264d41 commit dd29ed3
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 18 deletions.
55 changes: 55 additions & 0 deletions nix/deterministic-zome.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
runCommandNoCC,
dockerTools,
docker,
workspacePath,
dbus,
crateCargoToml,
buildEnv,
git,
systemd,
meta
}:

let
nixFromDockerHub = dockerTools.pullImage {
imageName = "nixpkgs/nix-flakes";
imageDigest = "sha256:ae2d8172d75347b040b29b726faf680f35c9beffe3f90d6a93b74fa3d5227774";
sha256 = "mQYzwbTpkslXAOAq4LX05kNcoPqVHfhzM8yZ9bQ7VgA=";
finalImageTag = "nixos-23.11";
finalImageName = "nix";
};
image = dockerTools.buildImage {
name = "build-deterministic-zome";
tag = "latest";
fromImage = nixFromDockerHub;

copyToRoot = buildEnv {
name = "cargo-workspace";
pathsToLink = [ workspacePath "/bin" ];
paths = [ workspacePath git ];
};

# runAsRoot = ''
# #!/bin/bash
# echo ${workspacePath}
# mkdir -p /build/source
# cp -R ${workspacePath}/* /build/source
# cd /build/source
# git init .
# git add .
# ls -la
# nix --help
# nix build .#my_zome.meta.debug

# '';
config.Cmd = [ "/bin/nix --help"];
};
in
runCommandNoCC "container" {
buildInputs = [dbus];
} ''
${systemd}/bin/systemctl --user start docker
${docker}/bin/docker load --input ${image}
${docker}/bin/docker run -t -i build-deterministic-zome
''
34 changes: 17 additions & 17 deletions nix/fixture/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion nix/zome.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,5 @@ in
holochainPackageType = "zome";
};
} ''
${binaryen}/bin/wasm-opt --strip-debug -Oz -o $out ${debug}
cp ${debug} $out
''

0 comments on commit dd29ed3

Please sign in to comment.