| 30 Nov 2025 |
ChickenIQ | I've been trying to generate a disk image for my pi 4 with disko, but i keep getting an error: "Firmware not found"
Any idea on how i could fix it?
Repo: https://github.com/ChickenIQ/NixOSPI4 | 21:45:53 |
ChickenIQ | * I've been trying to generate a disk image for my pi 4 with disko, but i keep getting an error on boot: "Firmware not found"
Any idea on how i could fix it?
Repo: https://github.com/ChickenIQ/NixOSPI4 | 21:47:01 |
| 1 Dec 2025 |
ChickenIQ | this seems to be enough to get it to work
esp = {
size = "1024M";
type = "EF00";
content = {
format = "vfat";
type = "filesystem";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
postMountHook =
let
configTxt = pkgs.writeText "config.txt" ''
[pi4]
kernel=u-boot-rpi4.bin
disable_overscan=1
enable_gic=1
arm_boost=1
[all]
avoid_warnings=1
enable_uart=1
arm_64bit=1
'';
in
toString (
pkgs.writeScript "postMountHook.sh" ''
(cd ${pkgs.raspberrypifw}/share/raspberrypi/boot && cp bootcode.bin fixup4.dat start4.elf bcm2711-*.dtb /mnt/boot/)
cp ${pkgs.ubootRaspberryPi4_64bit}/u-boot.bin /mnt/boot/u-boot-rpi4.bin
cp ${configTxt} /mnt/boot/config.txt
''
);
};
};
| 00:20:12 |
ChickenIQ | proper hack, works without disko too
{
config,
pkgs,
lib,
...
}:
let
installBootLoader =
(import (pkgs.path + "/nixos/modules/system/boot/loader/generic-extlinux-compatible") {
inherit config lib pkgs;
}).config.content.system.build.installBootLoader;
populateFirmware =
(import (pkgs.path + "/nixos/modules/installer/sd-card/sd-image-aarch64.nix") {
inherit config lib pkgs;
}).sdImage.populateFirmwareCommands;
installCmd = pkgs.writeShellScript "populate-boot.sh" ''
set -e && export PATH=${pkgs.coreutils}/bin:$PATH
${installBootLoader} "$@"
ln -s "/boot" "$NIX_BUILD_TOP/firmware"
cd "$NIX_BUILD_TOP" && ${populateFirmware}
echo "include usercfg.txt" >> /boot/config.txt
'';
in
{
system.build.installBootLoader = lib.mkForce installCmd;
}
| 03:27:03 |
ChickenIQ | * proper hack, works without disko too
{
config,
pkgs,
lib,
...
}:
let
installBootLoader =
(import (pkgs.path + "/nixos/modules/system/boot/loader/generic-extlinux-compatible") {
inherit config lib pkgs;
}).config.content.system.build.installBootLoader;
populateFirmware =
(import (pkgs.path + "/nixos/modules/installer/sd-card/sd-image-aarch64.nix") {
inherit config lib pkgs;
}).sdImage.populateFirmwareCommands;
installCmd = pkgs.writeShellScript "populate-boot.sh" ''
set -e && export PATH=${pkgs.coreutils}/bin:$PATH
${installBootLoader} "$@"
ln -s "/boot" "$NIX_BUILD_TOP/firmware"
cd "$NIX_BUILD_TOP" && ${populateFirmware}
echo "include usercfg.txt" >> /boot/config.txt
'';
in
{
system.build.installBootLoader = lib.mkForce installCmd;
}
| 03:27:14 |
| stooj joined the room. | 16:54:37 |
stooj | Redacted or Malformed Event | 17:32:21 |
stooj | Possibly a general flake question: what is the syntax for applying a flake from a non-github repo and using a specific branch?
So far I'm trying:
nix run --extra-experimental-features 'nix-command flakes' 'github:nix-community/disko/latest#disko-install' -- --write-efi-boot-entries --flake 'https://codeberg.org/higara/legacy-nix-configuration.git?ref=add-klaes#klaes' --disk nvme0 /dev/nvme0n1
And getting:
error: Failed to open archive (Unrecognizde archive format)
.disko-install-wrapped: line 234: artifacts[1]: unbound variable
| 17:39:25 |
stooj | * Possibly a general flake question: what is the syntax for applying a flake from a non-github repo and using a specific branch?
So far I'm trying:
nix run --extra-experimental-features 'nix-command flakes' \
'github:nix-community/disko/latest#disko-install' -- \
--write-efi-boot-entries \
--flake 'https://codeberg.org/higara/legacy-nix-configuration.git?ref=add-klaes#klaes' \
--disk nvme0 /dev/nvme0n1
And getting:
error: Failed to open archive (Unrecognizde archive format)
.disko-install-wrapped: line 234: artifacts[1]: unbound variable
| 17:40:32 |
BerriJ | I guess you need 'git+https://...' instead of just starting directly with 'https://' | 17:44:09 |
stooj | Thanks, I will try that. | 17:45:08 |
| Brisingr changed their display name from Brisingr05 to Brisingr. | 18:39:52 |
stooj | Thanks @berrij:fairydust.space | 19:08:31 |
BerriJ | Quick question: I want to streamline my deployment process for new machines a bit using disko, flakes and nixos-anywhere. Currently I only use disko without flakes and I crafted this disko config (https://codeberg.org/BerriJ/nixos-config/src/branch/main/hosts/common/disks/disko-luks-lvm-swap-btrfs.nix#L1-L9) which uses some variables for swap-size, etc.
Ideally, I would add this config to my flake, and be able to define things like swapsize etc. per host (maybe inside the nixosConfigurations outputs of my flake?)
Maybe someone of you has something like that, you would help me a lot 😇🙏 | 20:49:57 |
BerriJ | Nevermind, I found this: https://github.com/nix-community/nixos-anywhere-examples/blob/main/flake.nix#L28, which should be exactly what I was looking for. Now I need to wrap my head around provisioning luks encryption passwords 🙃 | 21:13:51 |
| 2 Dec 2025 |
ChickenIQ | * proper hack, works without disko too
{
config,
pkgs,
lib,
...
}:
let
installBootLoader =
(import (pkgs.path + "/nixos/modules/system/boot/loader/generic-extlinux-compatible") {
inherit config lib pkgs;
}).config.content.system.build.installBootLoader;
populateFirmware =
(import (pkgs.path + "/nixos/modules/installer/sd-card/sd-image-aarch64.nix") {
inherit config lib pkgs;
}).sdImage.populateFirmwareCommands;
installCommand = pkgs.writeShellScript "populate-boot.sh" ''
set -e && export PATH=${pkgs.coreutils}/bin:$PATH
${builtins.replaceStrings [ "firmware/" ] [ "boot/" ] populateFirmware}
echo "include usercfg.txt" >> boot/config.txt
${installBootLoader} "$@"
'';
in
{
system.build.installBootLoader = lib.mkForce installCommand;
}
| 00:56:06 |
sinan | How do you guys handle diffrent /dev/* paths,
i use nixos anywhere to add nodes to my cluster but some nodes will have /dev/nvme0n1 as root and some /dev/sda1 and so on
Is there way to automatically select which ever is avaialable ?
| 12:47:49 |
sinan | if not maybe we can use some sort of lib.mkOverride where we assign priority on each path - disk pair, and select the first available one ? | 12:50:21 |
BerriJ | I usually pass it as a variable. So my config looks like this:
https://codeberg.org/BerriJ/nixos-config/src/branch/main/hosts/common/disks/disko-luks-lvm-swap-btrfs.nix#L16
And then I do:
nix --experimental-features "nix-command flakes" <br />
run github:nix-community/disko/c5140c6 -- <br />
--mode destroy,format,mount $SCRIPT_DIR/disko-luks-lvm-swap-btrfs.nix <br />
--yes-wipe-all-disks <br />
--argstr disk "${DISK}" <br />
--arg sizes "${SIZES}" <br />
--arg luks_passwordFile "${LUKS_PWF}" | 13:21:53 |
| 3 Dec 2025 |
| blitz joined the room. | 09:48:57 |
blitz | Hey! Quick question: Is it possible to perserve certain partitions when using disko to deploy a system? I'd like to preserve the ESP and another recovery partition (can be identified by UUID for example) | 09:49:52 |
lassulus | not easily, you would have to run just the formatScript and have enough space available, you can create some partitons with content = null; which would get ignored by disko, but the offsets for the partition you want to create need to be correct | 09:51:59 |
blitz | mmh ok. maybe I'll write my own script that handles this for now, let's see :) | 09:53:17 |
blitz | but thanks! | 09:53:23 |
lassulus | that is probably easier for now | 09:53:41 |
| 4 Dec 2025 |
| Ido Samuelson joined the room. | 01:47:19 |
| Tanja (she/her) changed their display name from Tanja (she/her) to Tanja (she/her) - ☎️ 4201. | 18:09:01 |
| 25 Apr 2024 |
| David Mell (zraexy) joined the room. | 23:38:25 |
| David Mell (zraexy) changed their display name from David Mell to David Mell (zraexy). | 23:51:57 |
| 26 Apr 2024 |
Raj | Couple of questions about NixOS live USBs:
I want to partition my 64 GB USB flash drive into two partitions (FAT32 live USB + ext4 storage), so I used the following disko config:
let
usb = "/dev/disk/by-id/usb-USB_SanDisk_3.2Gen1_0401a943ae4197a38a6f9070194e9ea2b3fb8dbb7997e05ed1b197c0e28946be4b8f000000000000000000001cf4be6800926418a955810751ab6336-0:0";
in {
disko.devices = {
disk = {
live = {
type = "disk";
device = usb;
content = {
type = "gpt";
partitions = {
ESP = {
type = "EF00";
device = "${usb}-part1";
priority = 0;
size = "8192M";
content = {
type = "filesystem";
format = "vfat";
};
};
storage = {
device = "${usb}-part2";
priority = 1;
size = "100%";
content = {
type = "filesystem";
format = "ext4";
};
};
};
};
};
};
};
}
I then copied over the files from the (minimal, non-graphical) NixOS live ISO into partition 1, hoping that the instructions on the Arch wiki would generalize to NixOS, but then my live ISO gets stuck with the following error message:
[...]
Timed out waiting for device /dev/root, trying to mount anyway
mounting /dev/root on /iso...
mount: mounting /dev/root on /mnt-root/iso failed: No such file or directory
An error occurred [...]
How can I use my USB flash drive as both a live USB and as a storage device? I found this relevant Discourse link but there was no resolution to the problem there.
I realize this might not be the best place to ask this, but I figured that folks here would have expertise configuring boot partitions correctly.
| 02:02:16 |