mirror of
https://github.com/nix-community/disko.git
synced 2026-12-02 05:53:28 +01:00
Merge pull request #993 from nix-community/disk-deactivate-fix
Disk deactivate fix
This commit is contained in:
2 files changed
+7
-2
No files matched your search
@@ -45,7 +45,7 @@ def deactivate:
|
|||||||
]
|
]
|
||||||
elif .type == "swap" then
|
elif .type == "swap" then
|
||||||
[
|
[
|
||||||
"swapoff \(.path)",
|
"swapoff \(.path)"
|
||||||
]
|
]
|
||||||
elif .type == "lvm" then
|
elif .type == "lvm" then
|
||||||
(.name | split("-")[0]) as $vgname |
|
(.name | split("-")[0]) as $vgname |
|
||||||
|
|||||||
@@ -68,6 +68,11 @@
|
|||||||
diskoVersion = version;
|
diskoVersion = version;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
checkJqSyntax = pkgs.runCommand "check-jq-syntax" { nativeBuildInputs = [ pkgs.jq ]; } ''
|
||||||
|
echo '{ "blockdevices" : [] }' | jq -r -f ${./disk-deactivate/disk-deactivate.jq} --arg disk_to_clear foo
|
||||||
|
touch $out
|
||||||
|
'';
|
||||||
|
|
||||||
jsonTypes = pkgs.writeTextFile {
|
jsonTypes = pkgs.writeTextFile {
|
||||||
name = "jsonTypes";
|
name = "jsonTypes";
|
||||||
text = (builtins.toJSON diskoLib.jsonTypes);
|
text = (builtins.toJSON diskoLib.jsonTypes);
|
||||||
@@ -83,7 +88,7 @@
|
|||||||
//
|
//
|
||||||
pkgs.lib.optionalAttrs (!pkgs.stdenv.buildPlatform.isRiscV64 && !pkgs.stdenv.hostPlatform.isx86_32)
|
pkgs.lib.optionalAttrs (!pkgs.stdenv.buildPlatform.isRiscV64 && !pkgs.stdenv.hostPlatform.isx86_32)
|
||||||
{
|
{
|
||||||
inherit jsonTypes treefmt;
|
inherit jsonTypes treefmt checkJqSyntax;
|
||||||
inherit (self.packages.${system}) disko-doc;
|
inherit (self.packages.${system}) disko-doc;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in new issue
Block a user