2022-06-13 21:16:20 +02:00
|
|
|
/*
|
|
|
|
|
|
|
|
# sGdisk with Patches
|
|
|
|
|
|
|
|
GPT-FDisk patched to be able to move not only the primary, but also the backup partition table.
|
|
|
|
|
|
|
|
|
|
|
|
## Implementation
|
|
|
|
|
|
|
|
```nix
|
|
|
|
#*/# end of MarkDown, beginning of NixPkgs overlay:
|
|
|
|
dirname: inputs: final: prev: let
|
2023-06-16 02:14:51 +02:00
|
|
|
inherit (final) pkgs; lib = inputs.self.lib.__internal__;
|
2023-01-03 18:14:25 +01:00
|
|
|
debug = false;
|
2024-05-31 22:41:35 +02:00
|
|
|
enable = lib.versionOlder prev.gptfdisk.version "1.0.10"; # patch merged in that version
|
2022-06-13 21:16:20 +02:00
|
|
|
in {
|
|
|
|
|
2024-05-31 22:41:35 +02:00
|
|
|
gptfdisk = if !enable then prev.gptfdisk else (
|
2023-01-03 18:14:25 +01:00
|
|
|
if debug then pkgs.enableDebugging else (x: x)
|
|
|
|
) (prev.gptfdisk.overrideAttrs (old: let
|
2022-06-13 21:16:20 +02:00
|
|
|
pname = "gptfdisk";
|
2022-12-27 15:37:27 +01:00
|
|
|
in rec {
|
2022-06-13 21:16:20 +02:00
|
|
|
version = "1.0.9";
|
|
|
|
src = builtins.fetchurl {
|
|
|
|
url = "https://downloads.sourceforge.net/gptfdisk/${pname}-${version}.tar.gz";
|
|
|
|
sha256 = "1hjh5m77fmfq5m44yy61kchv7mbfgx026aw3jy5qxszsjckavzns";
|
|
|
|
};
|
2023-01-03 18:14:25 +01:00
|
|
|
patches = [ # (don't include »old.patches«, as the only one was upstreamed in v1.0.9)
|
2022-06-13 21:16:20 +02:00
|
|
|
../patches/gptfdisk-move-secondary-table.patch
|
2023-01-03 18:14:25 +01:00
|
|
|
];
|
|
|
|
} // (if debug then {
|
|
|
|
dontStrip = true;
|
|
|
|
} else { })));
|
2022-06-28 05:00:48 +02:00
|
|
|
|
2024-05-31 22:41:35 +02:00
|
|
|
libblockdev = prev.libblockdev.override (lib.optionalAttrs enable { inherit (prev) gptfdisk; });
|
2022-06-28 05:00:48 +02:00
|
|
|
|
2022-06-13 21:16:20 +02:00
|
|
|
}
|