From aa0a395353dca70db1e3e86ee85a8083fc054642 Mon Sep 17 00:00:00 2001 From: Colin Date: Fri, 7 Jun 2024 07:28:56 +0000 Subject: [PATCH] nit: fix image output to be a file, not an item inside a folder --- hosts/modules/hal/pine64.nix | 2 +- modules/image.nix | 21 ++++++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/hosts/modules/hal/pine64.nix b/hosts/modules/hal/pine64.nix index 60bc9383..66c52dad 100644 --- a/hosts/modules/hal/pine64.nix +++ b/hosts/modules/hal/pine64.nix @@ -279,7 +279,7 @@ in sane.image.extraGPTPadding = 16 * 1024 * 1024; sane.image.firstPartGap = 0; sane.image.installBootloader = '' - dd if=${pkgs.tow-boot-pinephone}/Tow-Boot.noenv.bin of=$out/nixos.img bs=1024 seek=8 conv=notrunc + dd if=${pkgs.tow-boot-pinephone}/Tow-Boot.noenv.bin of=$out bs=1024 seek=8 conv=notrunc ''; sane.programs.swaynotificationcenter.config = { diff --git a/modules/image.nix b/modules/image.nix index cbee8fb2..da56d89c 100644 --- a/modules/image.nix +++ b/modules/image.nix @@ -173,17 +173,20 @@ in in lib.mkIf cfg.enable { - system.build.img = (if cfg.installBootloader == null then - img - else pkgs.runCommand "nixos-with-bootloader" {} '' - cp -vR ${img} $out - chmod -R +w $out - ${cfg.installBootloader} - '') // { + system.build.img = pkgs.runCommandLocal "nixos-with-bootloader" { passthru = { inherit bootFsImg nixFsImg; - withoutBootloader = img; + withoutBootloader = img; #< XXX: this derivation places the image at $out/nixos.img }; - }; + } ( + if cfg.installBootloader == null then '' + ln -s ${img}/nixos.img $out + '' else '' + cp ${img}/nixos.img $out + chmod +w $out + ${cfg.installBootloader} + chmod -w $out + '' + ); }; }