2024-04-24 00:25:21 +00:00
Notes to repro on top of QubesOS debian-12-xfce template based qube
- Clone a debian-12-xfce on top of Q4.2.1 to be specialized
- Deploy QubesOS nix requirements in template: https://dataswamp.org/~solene/2023-05-15-qubes-os-install-nix.html
- Deploy QubesOS requirements for docker: https://gist.github.com/tlaurion/9113983bbdead492735c8438cd14d6cd
- Create a qube based on the cloned template above
- Open qube
- Clone whatever repo is most recent between https://github.com/mmlb/osresearch-heads/tree/wip-nix-for-build or https://github.com/tlaurion/heads/tree/wip-nix-for-build
- git clone Above_repo
- cd /home/user/heads or cd /home/user/osresearch-heads
- git checkout wip-nix-for-build
- git reset --hard
Now, replication traces
2024-04-24 18:49:13 +00:00
#Install nix cleanly:
2024-04-24 00:25:21 +00:00
sudo rm -rf /nix/* || echo "cannot delete /nix" && sh <(curl -L https://nixos.org/nix/install) --no-daemon
2024-04-24 18:49:13 +00:00
#Source nix prior of creating nix cache and jumping in it
2024-04-24 00:25:21 +00:00
. /home/user/.nix-profile/etc/profile.d/nix.sh
2024-04-24 18:49:13 +00:00
#Configure nix for local builds until we have proper docker image instead:
2024-04-24 00:25:21 +00:00
mkdir -p ~/.config/nix
echo 'experimental-features = nix-command flakes' >~/.config/nix/nix.conf
2024-04-24 18:49:13 +00:00
#Build nix developer local env with flakes locks to specified versions and jump into it:
2024-04-24 00:25:21 +00:00
nix --print-build-logs --verbose develop --ignore-environment
2024-04-24 18:49:13 +00:00
#Build a board
2024-04-24 00:25:21 +00:00
make BOARD=nitropad-nv41
2024-04-24 18:49:13 +00:00
2024-04-24 00:25:21 +00:00
In case you need to rebuild from packages+ patches + a clean ./install (where libraries and headers are found):
make real.remove_canary_files-extract_patch_rebuild_what_changed
IF that doesn;t help you, look at the end of the global Helper for more helper. Iterate.
build docker out of nix develop environement and jump into it:
nix build .#dockerImage && docker load < result && docker run --network host --rm -ti -v $(pwd):$(pwd) -w $(pwd) linuxboot/heads:dev-env
From there, rebuild with
make real.remove_canary_files-extract_patch_rebuild_chat_changed
make BOARD=nitropad-nv41
Make changes until taht part works in both nix layer on top of OS and withing docker image.
......
SUCCESSSSS?!?!?!?! CELEBRATION!
Tell @mmlb and @insurgo on matrix channel!!!!
-------
Some raw and incomplete notes on how to push that docker to dockerhub
docker tag linuxboot/heads:dev-env tlaurion/heads-dev-env:v0.0.3
docker push tlaurion/heads-dev-env:v0.0.3
(to be continued)
2024-05-02 18:57:05 +00:00
-------------------
#To create the docker image, I was not able to set gcroot dynamically, so here are the manual steps so nix is not wiped per garbage collector
mkdir -p /nix/var/nix/gcroots/per-user/$(whoami)
ln -sfn $(readlink -f $HOME/.nix-profile) /nix/var/nix/gcroots/per-user/$(whoami)/profile
#And then build derivates and cal garbarrge collection (not yet successfull since docker build fails now)
nix build .#dockerImage && docker load < result && docker run --network host --rm -ti -v $(pwd):$(pwd) -w $(pwd) linuxboot/heads:dev-env
#Use it
docker run -e DISPLAY=$DISPLAY --network host --rm -ti -v $(pwd):$(pwd) -w $(pwd) linuxboot/heads:dev-env -- make BOARD=qemu-coreboot-whiptail-tpm2
docker run -e DISPLAY=$DISPLAY --network host --rm -ti -v $(pwd):$(pwd) -w $(pwd) linuxboot/heads:dev-env -- make BOARD=qemu-coreboot-whiptail-tpm2 run
#push it
docker login
docker tag linuxboot/heads:dev-env tlaurion/heads-dev-env:v0.0.9
docker push tlaurion/heads-dev-env:v0.0.9