Skip to content

Commit

Permalink
cli: stop using system dependencies in destroy step
Browse files Browse the repository at this point in the history
re-applying 15aa78e because I
accidentally overwrote it in 15aa78e.
  • Loading branch information
iFreilicht committed Oct 18, 2024
1 parent d7d57ed commit a6a3179
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions lib/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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}
'';

Expand All @@ -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}
'';

Expand Down

0 comments on commit a6a3179

Please sign in to comment.