Execute partition script using shebang

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

View file

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

View file

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