From 2a06a6165be53ac383c3884a1a7383a3ecfb46c3 Mon Sep 17 00:00:00 2001 From: Kleidi Bujari Date: Mon, 31 Aug 2026 11:43:56 -0700 Subject: [nixos/disk] provide both qcow2 and raw images --- modules/disk.nix | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) (limited to 'modules') diff --git a/modules/disk.nix b/modules/disk.nix index 757d436..bf4a9a8 100644 --- a/modules/disk.nix +++ b/modules/disk.nix @@ -133,8 +133,8 @@ in description = "Expand zroot to take up entire partition."; serviceConfig.Type = "oneshot"; - wantedBy = ["zfs.target"]; - after = ["zfs-import-zroot.service"]; + wantedBy = [ "zfs.target" ]; + after = [ "zfs-import-zroot.service" ]; script = '' # pull partuuid from zpool @@ -154,16 +154,24 @@ in pkgs.zfs ]; - image.modules.depot = - { config, modulesPath, ... }: + image.modules = + let + baseImage = + extension: + { config, modulesPath, ... }: + { + imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; + + image.extension = extension; + system.build.image = pkgs.depot.make-zfs-image.override { + inherit pkgs lib config; + inherit (config.image) fileName extension; + }; + }; + in { - imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; - - image.extension = "qcow2"; - system.build.image = pkgs.depot.make-zfs-image.override { - inherit pkgs lib config; - inherit (config.image) fileName extension; - }; + depot = baseImage "qcow2"; + depotRaw = baseImage "raw"; }; # datasets = -- cgit v1.3.1