Execute partition script using shebang

This commit is contained in:
Manuel Thalmann 2024-09-12 18:44:14 +02:00
parent b5f8949138
commit afbff7ac8c
2 changed files with 8 additions and 3 deletions

View file

@ -344,8 +344,11 @@
sudo swapon ${partPath _} sudo swapon ${partPath _}
'') '')
(builtins.filter (_: _.useSwap) partitions)); (builtins.filter (_: _.useSwap) partitions));
in lib.strings.concatLines ( in lib.strings.concatLines ([
(builtins.map (_: _.deviceScript) disks) ++ lib.optionals ((builtins.length disks) > 0) [ "#!/bin/bash"
] ++
(builtins.map (_: _.deviceScript) disks) ++
lib.optionals ((builtins.length disks) > 0) [
". ${./../../../scripts/Common/Scripts/is-truthy.sh}" ". ${./../../../scripts/Common/Scripts/is-truthy.sh}"
''echo "$(tput setaf 3)==== WARNING ====$(tput sgr0)"'' ''echo "$(tput setaf 3)==== WARNING ====$(tput sgr0)"''
(''echo "Continuing this script will alter the partitions of '' + ( (''echo "Continuing this script will alter the partitions of '' + (

View file

@ -8,6 +8,7 @@ function runSetup
set -l projectName (basename "$projectRoot") set -l projectName (basename "$projectRoot")
set -l PROJECT_CLONE_ROOT "/opt/$(basename "$projectName")" set -l PROJECT_CLONE_ROOT "/opt/$(basename "$projectName")"
set -l script (mktemp) set -l script (mktemp)
chmod +x "$script"
if not type -q runChroot if not type -q runChroot
function runChroot -S function runChroot -S
@ -44,7 +45,8 @@ function runSetup
end end
getConfig valhalla.partition.script > "$script" getConfig valhalla.partition.script > "$script"
bash "$script" and "$script"
and rm "$script"
# Copy `nixpkgs` channel # Copy `nixpkgs` channel
and begin and begin