PortValhalla/archiso/scripts/build.fish

26 lines
914 B
Fish
Raw Permalink Normal View History

2024-07-07 22:44:35 +00:00
#!/bin/env fish
begin
2024-11-01 13:13:41 +00:00
set -l dir (status dirname)
source "$dir/../../scripts/lib/config.fish"
source "$dir/../../scripts/lib/nix.fish"
2024-07-07 22:44:35 +00:00
set -l projectName archiso-valhalla
set -l overlayDir (mktemp -d)
set -l upperDir (mktemp -d)
set -l workDir (mktemp -d)
set -l root airootfs
set -l rootHome "$overlayDir/$root/root"
set -l profileDir "/mnt/$projectName"
set -l projectDir "$rootHome/PortValhalla"
2024-11-01 13:13:41 +00:00
set -l nixDir "$profileDir/$root$nixPkgsDir"
2024-07-07 22:44:35 +00:00
mkdir -p "$rootHome"
2024-11-01 12:12:16 +00:00
and fish "$(status dirname)/../../scripts/lib/copy-repo.fish" "$projectDir"
2024-11-01 13:13:41 +00:00
downloadNixPkgs
2024-07-07 22:44:35 +00:00
2024-07-07 23:03:21 +00:00
and sudo mount --mkdir -t overlay overlay -o lowerdir=.:"$overlayDir",upperdir="$upperDir",workdir="$workDir" "$profileDir"
2024-11-01 13:13:41 +00:00
and sudo mount --mkdir --bind "$nixPkgsCache" "$nixDir"
2024-07-07 23:03:21 +00:00
and sudo mkarchiso $argv "$profileDir"
2024-07-07 22:57:44 +00:00
sudo umount "$nixDir"
2024-07-07 23:03:21 +00:00
and sudo umount "$profileDir"
2024-07-07 22:44:35 +00:00
end