Skip to content

Commit

Permalink
Compress generic-x86_64 image
Browse files Browse the repository at this point in the history
Signed-off-by: Valentin Kharin <[email protected]>
  • Loading branch information
remimimimimi authored and brianmcgillion committed Jan 5, 2025
1 parent e504823 commit 606a182
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions targets/generic-x86_64/flake-module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,28 @@ let
self.nixosModules.hw-x86_64-generic
self.nixosModules.reference-programs

(
{
lib,
config,
pkgs,
modulesPath,
...
}:
{
# https://github.com/nix-community/nixos-generators/blob/master/formats/raw-efi.nix#L24-L29
system.build.raw = lib.mkOverride 98 (
import "${toString modulesPath}/../lib/make-disk-image.nix" {
inherit lib config pkgs;
partitionTableType = "efi";
inherit (config.virtualisation) diskSize;
format = "raw";
postVM = "${pkgs.zstd}/bin/zstd --compress --rm $out/nixos.img";
}
);
}
)

{
ghaf = {
hardware.x86_64.common.enable = true;
Expand Down

0 comments on commit 606a182

Please sign in to comment.