From 79785c1cfc6febe913469683f87b87fb99d964a6 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 12 Sep 2023 11:31:25 +0200 Subject: [PATCH] add pkgs.parted where partprobe is needed --- lib/make-disk-image.nix | 3 ++- lib/types/gpt.nix | 6 +++++- lib/types/mdadm.nix | 4 +++- lib/types/zfs_volume.nix | 5 ++++- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/lib/make-disk-image.nix b/lib/make-disk-image.nix index 33f68bb..7f8bb53 100644 --- a/lib/make-disk-image.nix +++ b/lib/make-disk-image.nix @@ -18,9 +18,10 @@ let bash coreutils gnused + parted # for partprobe systemdMinimal nix - utillinux + util-linux ]; preVM = '' ${lib.concatMapStringsSep "\n" (disk: "truncate -s ${disk.imageSize} ${disk.name}.raw") (lib.attrValues nixosConfig.config.disko.devices.disk)} diff --git a/lib/types/gpt.nix b/lib/types/gpt.nix index d7cc373..aaf00a6 100644 --- a/lib/types/gpt.nix +++ b/lib/types/gpt.nix @@ -146,7 +146,11 @@ in readOnly = true; type = lib.types.functionTo (lib.types.listOf lib.types.package); default = pkgs: - [ pkgs.gptfdisk pkgs.systemdMinimal ] ++ lib.flatten (map + [ + pkgs.gptfdisk + pkgs.systemdMinimal + pkgs.parted # for partprobe + ] ++ lib.flatten (map (partition: lib.optional (partition.content != null) (partition.content._pkgs pkgs) ) diff --git a/lib/types/mdadm.nix b/lib/types/mdadm.nix index 47eb272..5edde9a 100644 --- a/lib/types/mdadm.nix +++ b/lib/types/mdadm.nix @@ -74,7 +74,9 @@ internal = true; readOnly = true; type = lib.types.functionTo (lib.types.listOf lib.types.package); - default = pkgs: (lib.optionals (config.content != null) (config.content._pkgs pkgs)); + default = pkgs: [ + pkgs.parted # for partprobe + ] ++ (lib.optionals (config.content != null) (config.content._pkgs pkgs)); description = "Packages"; }; }; diff --git a/lib/types/zfs_volume.nix b/lib/types/zfs_volume.nix index 6cedd10..7c8c7cb 100644 --- a/lib/types/zfs_volume.nix +++ b/lib/types/zfs_volume.nix @@ -72,7 +72,10 @@ internal = true; readOnly = true; type = lib.types.functionTo (lib.types.listOf lib.types.package); - default = pkgs: [ pkgs.util-linux ] ++ lib.optionals (config.content != null) (config.content._pkgs pkgs); + default = pkgs: [ + pkgs.util-linux + pkgs.parted # for partprobe + ] ++ lib.optionals (config.content != null) (config.content._pkgs pkgs); description = "Packages"; }; };