cli: stop using system dependencies in destroy step

re-applying 15aa78e9a5 because I
accidentally overwrote it in 15aa78e9a5.
This commit is contained in:
Felix Uhl committed 2024-10-18 21:59:08 +02:00
1 parent d7d57edb72
commit a6a3179ddf
1 file changed
+7 -6
+7 -6
View File
@@ -391,10 +391,7 @@ let
default = { pkgs, checked ? false }: default = { pkgs, checked ? false }:
let let
throwIfNoDisksDetected = _: v: if devices.disk == { } then throw "No disks defined, did you forget to import your disko config?" else v; throwIfNoDisksDetected = _: v: if devices.disk == { } then throw "No disks defined, did you forget to import your disko config?" else v;
in destroyDependencies = with pkgs; [
lib.mapAttrs throwIfNoDisksDetected {
destroyScript = (diskoLib.writeCheckedBash { inherit pkgs checked; }) "disko-destroy" ''
export PATH=${lib.makeBinPath (with pkgs; [
util-linux util-linux
e2fsprogs e2fsprogs
mdadm mdadm
@@ -405,7 +402,11 @@ let
gnused gnused
gawk gawk
coreutils-full coreutils-full
])}:$PATH ];
in
lib.mapAttrs throwIfNoDisksDetected {
destroyScript = (diskoLib.writeCheckedBash { inherit pkgs checked; }) "disko-destroy" ''
export PATH=${lib.makeBinPath destroyDependencies}:$PATH
${cfg.config._destroy} ${cfg.config._destroy}
''; '';
@@ -420,7 +421,7 @@ let
''; '';
diskoScript = (diskoLib.writeCheckedBash { inherit pkgs checked; }) "disko" '' diskoScript = (diskoLib.writeCheckedBash { inherit pkgs checked; }) "disko" ''
export PATH=${lib.makeBinPath ((cfg.config._packages pkgs) ++ [ pkgs.bash ])}:$PATH export PATH=${lib.makeBinPath ((cfg.config._packages pkgs) ++ [ pkgs.bash ] ++ destroyDependencies)}:$PATH
${cfg.config._disko} ${cfg.config._disko}
''; '';