threefoldtech / tf-images

Apache License 2.0
1 stars 3 forks source link

VM: NixOS, with Mycelium #200

Open xmonader opened 7 months ago

xmonader commented 5 months ago

please sync with @ashraffouda

PeterNashaat commented 3 months ago
root@imagecreator:~#:/mnt/holochain-infra/modules/flake-parts# cat zos-vm-build.nix
{ pkgs ? import <nixpkgs> {} }:

pkgs.writeShellApplication {
  name = "zos-vm-build";
  text = ''
    set -xueE -o pipefail

    # Use escaped double quotes inside the shell command

    resultName="tfgrid-base.peter"

    mkdir -p results

    # Make sure to escape the inner quotes correctly
    nix build --out-link results/"$resultName" \
      .#nixosConfigurations."tfgrid-base".config.system.build.zosVmDir
    ln -sf --no-target-directory "$resultName" results/"tfgrid-base.latest"

    echo results/"$resultName"
  '';
}
- had issue with https://github.com/holochain/holochain-infra/pull/78/files#diff-ef0e217e535bf33c9bc5da91ff5547c1347bffb1486cc5f825958c4d3091fe94R20 , was getting this error 

error: syntax error, unexpected ':', expecting '}' at /mnt/holochain-infra/modules/flake-parts/zos-vm-build.nix:8:12:


- Using command to build the image 

nix-build packages.zos-utils.nix -A zos-vm-build

- Result after running build command  

lrwxrwxrwx 1 root root 56 Apr 16 07:44 result -> /nix/store/ma932v2n629pp1qpdlh0xnhnxblk52ja-zos-vm-build -rw-r--r-- 1 root root 385 Apr 16 07:02 speicalArgs.nix drwxr-xr-x 2 root root 4096 Apr 16 07:54 tfgrid-microvm -rw-r--r-- 1 root root 531 Apr 16 07:44 zos-vm-build.nix root@imagecreator:~#/mnt/holochain-infra/modules/flake-parts# ls -la /nix/store/ma932v2n629pp1qpdlh0xnhnxblk52ja-zos-vm-build total 160 dr-xr-xr-x 3 root root 4096 Jan 1 1970 . drwxrwxr-t 121 root nixbld 151552 Apr 16 07:44 .. dr-xr-xr-x 3 root root 4096 Apr 16 07:45 bin root@imagecreator:~#/mnt/holochain-infra/modules/flake-parts# ls -la /nix/store/ma932v2n629pp1qpdlh0xnhnxblk52ja-zos-vm-build/bin/ total 16 dr-xr-xr-x 3 root root 4096 Apr 16 07:45 . dr-xr-xr-x 3 root root 4096 Jan 1 1970 .. drwxr-xr-x 2 root root 4096 Apr 16 07:45 results -r-xr-xr-x 1 root root 503 Jan 1 1970 zos-vm-build root@imagecreator:~#/mnt/holochain-infra/modules/flake-parts# ls -la /nix/store/ma932v2n629pp1qpdlh0xnhnxblk52ja-zos-vm-build/bin/zos-vm-build -r-xr-xr-x 1 root root 503 Jan 1 1970 /nix/store/ma932v2n629pp1qpdlh0xnhnxblk52ja-zos-vm-build/bin/zos-vm-build


- Getting this error when running the newly created bin 

./zos-vm-build