PortValhalla/archiso/scripts/build.sh

14 lines
508 B
Bash
Raw Normal View History

#!/bin/bash
contextRoot="$(mktemp -d)";
2024-06-23 10:32:52 +00:00
root="$contextRoot/airootfs";
rootHome="$root/root";
nixDir="$root/nix/var/nix/profiles/per-user/root/channels/nixpkgs";
profileDir="/mnt/archiso-valhalla";
mkdir -p "$rootHome";
git clone .. "$rootHome/PortValhalla";
2024-06-23 10:19:59 +00:00
git clone https://github.com/NixOS/nixpkgs.git --depth=1 -b nixos-24.05 "$nixDir";
rm -rf "$nixDir/.git";
sudo mount --mkdir -t overlay overlay -o lowerdir=.:"$contextRoot" "$profileDir";
sudo mkarchiso "$@" "$profileDir";
sudo umount "$profileDir";