!oNSIfazDqEcwhcOjSL:matrix.org

disko

351 Members
disko - declarative disk partitioning - https://github.com/nix-community/disko88 Servers

Load older messages


SenderMessageTime
2 Dec 2025
@chickeniq:matrix.orgChickenIQ *

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:sinanmohd.comsinan

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:sinanmohd.comsinanif 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:fairydust.spaceBerriJ 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:chat.x86.lolblitz joined the room.09:48:57
@blitz:chat.x86.lolblitzHey! 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:lassul.uslassulusnot 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 correct09:51:59
@blitz:chat.x86.lolblitzmmh ok. maybe I'll write my own script that handles this for now, let's see :)09:53:17
@blitz:chat.x86.lolblitzbut thanks!09:53:23
@lassulus:lassul.uslassulusthat is probably easier for now09:53:41
4 Dec 2025
@i-am-logger:matrix.orgIdo Samuelson joined the room.01:47:19
@tanja:catgirl.cloudTanja (she/her) - ☎️ 4201 changed their display name from Tanja (she/her) to Tanja (she/her) - ☎️ 4201.18:09:01

There are no newer messages yet.


Back to Room ListRoom Version: 10