From a6a3179ddf396dfc28a078e2f169354d0c137125 Mon Sep 17 00:00:00 2001 From: Felix Uhl Date: Tue, 15 Oct 2024 16:22:34 +0200 Subject: [PATCH] cli: stop using system dependencies in destroy step re-applying 15aa78e9a5ce391cd5694f36e98efc7b6989c659 because I accidentally overwrote it in 15aa78e9a5ce391cd5694f36e98efc7b6989c659. --- lib/default.nix | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index ba5ca13d..fb8afeef 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -391,21 +391,22 @@ let default = { pkgs, checked ? false }: let throwIfNoDisksDetected = _: v: if devices.disk == { } then throw "No disks defined, did you forget to import your disko config?" else v; + destroyDependencies = with pkgs; [ + util-linux + e2fsprogs + mdadm + zfs + lvm2 + bash + jq + gnused + gawk + coreutils-full + ]; in lib.mapAttrs throwIfNoDisksDetected { destroyScript = (diskoLib.writeCheckedBash { inherit pkgs checked; }) "disko-destroy" '' - export PATH=${lib.makeBinPath (with pkgs; [ - util-linux - e2fsprogs - mdadm - zfs - lvm2 - bash - jq - gnused - gawk - coreutils-full - ])}:$PATH + export PATH=${lib.makeBinPath destroyDependencies}:$PATH ${cfg.config._destroy} ''; @@ -420,7 +421,7 @@ let ''; 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} '';