summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorKleidi Bujari <mail@4kb.net>2026-08-31 11:43:56 -0700
committerKleidi Bujari <mail@4kb.net>2026-08-31 11:43:56 -0700
commit2a06a6165be53ac383c3884a1a7383a3ecfb46c3 (patch)
tree91e9f7c1b3f3296ce0d06d6bb7d7f6c3e83621cb /modules
parenta2aa95edfd3fb679a1d9100af3d856c7a1711673 (diff)
downloaddepot-2a06a6165be53ac383c3884a1a7383a3ecfb46c3.tar.gz
depot-2a06a6165be53ac383c3884a1a7383a3ecfb46c3.tar.bz2
depot-2a06a6165be53ac383c3884a1a7383a3ecfb46c3.zip
[nixos/disk] provide both qcow2 and raw images
Diffstat (limited to 'modules')
-rw-r--r--modules/disk.nix30
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 =