diff options
| author | Kleidi Bujari <mail@4kb.net> | 2026-08-31 11:43:56 -0700 |
|---|---|---|
| committer | Kleidi Bujari <mail@4kb.net> | 2026-08-31 11:43:56 -0700 |
| commit | 2a06a6165be53ac383c3884a1a7383a3ecfb46c3 (patch) | |
| tree | 91e9f7c1b3f3296ce0d06d6bb7d7f6c3e83621cb | |
| parent | a2aa95edfd3fb679a1d9100af3d856c7a1711673 (diff) | |
| download | depot-2a06a6165be53ac383c3884a1a7383a3ecfb46c3.tar.gz depot-2a06a6165be53ac383c3884a1a7383a3ecfb46c3.tar.bz2 depot-2a06a6165be53ac383c3884a1a7383a3ecfb46c3.zip | |
[nixos/disk] provide both qcow2 and raw images
| -rw-r--r-- | modules/disk.nix | 30 |
1 files changed, 19 insertions, 11 deletions
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, ... }: - { - imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; + image.modules = + let + baseImage = + extension: + { config, modulesPath, ... }: + { + 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; - }; + image.extension = extension; + system.build.image = pkgs.depot.make-zfs-image.override { + inherit pkgs lib config; + inherit (config.image) fileName extension; + }; + }; + in + { + depot = baseImage "qcow2"; + depotRaw = baseImage "raw"; }; # datasets = |
