Remove redundancy

This commit is contained in:
Manuel Thalmann 2024-12-07 17:50:10 +01:00
parent ed0ccb340f
commit c818c8c477

View file

@ -104,7 +104,6 @@ let
if append then "--append" else "" if append then "--append" else ""
} ${deviceVar}" } ${deviceVar}"
}"; }";
wipeScript = script: fdiskScript script [ ] false;
appendScript = index: script: fdiskScript script [ "-N" (builtins.toString index) ] true; appendScript = index: script: fdiskScript script [ "-N" (builtins.toString index) ] true;
cleanup = lib.strings.concatLines (builtins.map cleanup = lib.strings.concatLines (builtins.map
@ -116,7 +115,7 @@ let
fdiskCommands = lib.strings.concatLines fdiskCommands = lib.strings.concatLines
(lib.optionals config.wipe [ (lib.optionals config.wipe [
cleanup cleanup
(wipeScript "label: gpt") (fdiskScript "label: gpt" [ ] false)
] ++ (builtins.concatMap ] ++ (builtins.concatMap
( (
partition: partition: