!oNSIfazDqEcwhcOjSL:matrix.org

disko

362 Members
disko - declarative disk partitioning - https://github.com/nix-community/disko93 Servers

Load older messages


SenderMessageTime
5 Jul 2024
@matthewcroughan:defenestrate.itmatthewcroughanAnyone wanna help?20:36:48
@matthewcroughan:defenestrate.itmatthewcroughan blikvm-v1-disko-images> qemu-system-aarch64: failed to load "/nix/store/d2vw2hx48nphic1n4xd8y43q5vdn4lfk-kernel-modules/vmlinuz.efi" 20:36:49
@matthewcroughan:defenestrate.itmatthewcroughanwhy would that happen..20:36:56
@matthewcroughan:defenestrate.itmatthewcroughanthis is me, trying to make my PR to make the image builder kernel configurable20:41:18
@matthewcroughan:defenestrate.itmatthewcroughanIt's quite a minimal PR 20:41:41
@matthewcroughan:defenestrate.itmatthewcroughan
diff --git a/lib/make-disk-image.nix b/lib/make-disk-image.nix
index a61e937..e1f7e36 100644
--- a/lib/make-disk-image.nix
+++ b/lib/make-disk-image.nix
@@ -10,7 +10,7 @@ let
   vmTools = pkgs.vmTools.override {
     rootModules = [ "9p" "9pnet_virtio" "virtio_pci" "virtio_blk" ] ++ nixosConfig.config.disko.extraRootModules;
     kernel = pkgs.aggregateModules
-      (with nixosConfig.config.boot.kernelPackages; [ kernel ]
+      (with nixosConfig.config.disko.imageBuilderKernelPackages; [ kernel ]
         ++ lib.optional (lib.elem "zfs" nixosConfig.config.disko.extraRootModules) zfs);
   };
   cleanedConfig = diskoLib.testLib.prepareDiskoConfig nixosConfig.config diskoLib.testLib.devices;
diff --git a/module.nix b/module.nix
index 8c8fbc3..e3fde41 100644
--- a/module.nix
+++ b/module.nix
@@ -10,6 +10,15 @@ let
 in
 {
   options.disko = {
+    imageBuilderKernelPackages = lib.mkOption {
+      type = lib.types.attrs;
+      description = ''
+        the kernel used when building disk images via make-disk-image.nix.
+        Useful when the config's kernel won't boot in the image-builder.
+      '';
+      default = config.boot.kernelPackages;
+      example = lib.literalExpression "pkgs.linuxPackages_testing";
+    };
     extraRootModules = lib.mkOption {
       type = lib.types.listOf lib.types.str;
       description = ''
20:41:59
@drsensor:matrix.org૮༼⚆︿⚆༽つ / wildan joined the room.20:46:17
@matthewcroughan:defenestrate.itmatthewcroughan Oh.. it's because my config for the thing I'm building an image for actually modifies the nixpkgs.hostPlatform of the disko image builder.. 21:30:45
@matthewcroughan:defenestrate.itmatthewcroughanit's a bit too intertwined I think21:30:50
@matthewcroughan:defenestrate.itmatthewcroughandisko's image builder should not care about the nixosConfig as much as it does, it inherits too much21:31:18
@matthewcroughan:defenestrate.itmatthewcroughani.e it needs its own pkgs instance, uneffected by the nixosConfig's overlays and stuff21:32:15
@matthewcroughan:defenestrate.itmatthewcroughanhttps://github.com/nix-community/disko/blob/master/lib/make-disk-image.nix#L321:33:26
@matthewcroughan:defenestrate.itmatthewcroughanAh there it is.. yeah we need a module option namespace now21:33:34
@matthewcroughan:defenestrate.itmatthewcroughan disko.image-builder.pkgs for example should exist and be overridable, and all the other options we have should be inside of disko.image-builder 21:33:56
@matthewcroughan:defenestrate.itmatthewcroughanI will pr that shortly21:59:05
8 Jul 2024
@wolfeexd:matrix.orgwolfeexd joined the room.03:35:38
@matthewcroughan:defenestrate.itmatthewcroughanAfter so much hacking I finally managed to solve that problem, but it's a huge hack14:53:54
@matthewcroughan:defenestrate.itmatthewcroughanwe'll end up maintaining almost all of `vmTools14:54:00
@matthewcroughan:defenestrate.itmatthewcroughan * we'll end up maintaining almost all of `vmTools` 14:54:04
@matthewcroughan:defenestrate.itmatthewcroughan * we'll end up maintaining almost all of vmTools\ 14:54:06
@matthewcroughan:defenestrate.itmatthewcroughan * we'll end up maintaining almost all of vmTools 14:54:09
@matthewcroughan:defenestrate.itmatthewcroughanbecause vmTools doesn't let you directly override the qemu version used by all of the tools15:05:08
@matthewcroughan:defenestrate.itmatthewcroughanmaybe I should make a PR to vmTools instead15:05:14
@matthewcroughan:defenestrate.itmatthewcroughan it just needs to stop using that damned qemuBinary function 15:05:44
@matthewcroughan:defenestrate.itmatthewcroughan * it just needs to stop using that damned qemuBinary function and pass qemu as an input rather than the whole of pkgs 15:05:56
@matthewcroughan:defenestrate.itmatthewcroughanhttps://github.com/NixOS/nixpkgs/pull/32561919:04:57
@matthewcroughan:defenestrate.itmatthewcroughanimportant for disko19:05:00
@matthewcroughan:defenestrate.itmatthewcroughanunless anyone knows a better way19:05:07
@matthewcroughan:defenestrate.itmatthewcroughan I've tried to make it as minimal as possible lassulus but it requires a vmTools change in nixpkgs 19:16:09
@wolfeexd:matrix.orgwolfeexd

attempt: on a BIOS boot only system, I am trying to assign a id or uudi to a disko config because /dev/sdx gets switched around and becomes less viable in a raid setup
problem: switching to or using /dev/disk/by-id/<some-device> causes a GRUB2 error after rebuild: "This GPT partition label contains no BIOS Boot Partition; embedding won't be possible."
extra context: this is on a system that already has a disko config setup and im trying to switch it, i cannot bootstrap with /dev/disk/by-id disk either.

I've been stuck on this for a few days, just a nudge in the right direction even if its pointing out something in the docs, or a workaround would be very helpful.

config:
""
{
device ? throw "Set this to your disk device, e.g. /dev/sda",
...
}: {
disko.devices = {
disk.main = {
inherit device;
type = "disk";
content = {
type = "gpt";
partitions = {
boot = {
name = "boot";
size = "1M";
type = "EF02"; # for grub MBR
};
esp = {
name = "ESP";
size = "500M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
swap = {
size = "4G";
content = {
type = "swap";
resumeDevice = true;
};
};
root = {
name = "root";
size = "100%";
content = {
type = "lvm_pv";
vg = "root_vg";
};
};
};
};
};
lvm_vg = {
root_vg = {
type = "lvm_vg";
lvs = {
root = {
size = "100%FREE";
content = {
type = "btrfs";
extraArgs = ["-f"];

          subvolumes = {
            "/root" = {
              mountpoint = "/";
            };

            "/persist" = {
              mountOptions = ["subvol=persist" "noatime"];
              mountpoint = "/persist";
            };

            "/nix" = {
              mountOptions = ["subvol=nix" "noatime"];
              mountpoint = "/nix";
            };
          };
        };
      };
    };
  };
};

};
}
""

23:26:32

Show newer messages


Back to Room ListRoom Version: 10