Commit graph

320 commits

Author SHA1 Message Date
oott123
9067124b0d make-disk-image: auto-detect bcachefs kernel module like zfs
Automatically include the bcachefs kernel module when bcachefs is detected in
extraRootModules or boot.supportedFilesystems.

This follows the same pattern as ZFS.

Fixes #1151
2025-11-20 15:00:35 +01:00
Jörg Thalheim
af087d076d disko: drop more eval warnings 2025-11-04 17:23:16 +00:00
Jörg Thalheim
3f65d72ca6 disko/tests: silence mdadm tests 2025-11-04 17:23:16 +00:00
Francesco Zanini
6f4cf5abbe Set kernelPackages in native builder
In some cases, the kernel is not defined for cross-arch builds.
2025-10-31 08:29:56 +00:00
Edwin Mackenzie-Owen
fec5efebfc gpt: trigger udev after marking hybrid mbr partitions as bootable
Even though we don't depend on the MBR bootable flag in the following
steps, not running udevadm trigger and waiting for settle can cause
/dev/disk/by-partlabel entries to be absent when formatting filesystems
immediately after modifying the partition table.
2025-10-31 08:24:29 +00:00
Gabriel Nützi
3a9450b26e fix: forward arguments to vmWithDisko 2025-10-17 11:39:50 +00:00
Michael Hoang
67ff9807dd lib: fix mdadm warning when using config.system.build.installTest 2025-09-19 13:18:24 +00:00
Sergey Kazenyuk
31fe7eda26 gpt: add partition attributes 2025-09-07 14:37:19 +00:00
Jörg Thalheim
a5c4f2ab72 make-disk-image: use modules output of a kernel if present
This is a hotfix that could be reverted if we get:

https://github.com/NixOS/nixpkgs/pull/439178

in.
2025-09-01 13:33:49 +00:00
Jörg Thalheim
bafad29f89 make-disk-image: also use xcp 2025-08-25 09:53:42 +00:00
lassulus
4073ff2f48 types.luks: fix password check 2025-08-18 12:26:12 +00:00
Glen Huang
3db2f04765 allow subtype definitions to be broken up 2025-07-21 12:13:55 +00:00
Scott Edlund
8fd2d6c750 make-disk-image: QEUM_OPTS -> QEMU_OPTS 2025-06-23 12:03:50 +00:00
Mitch Fossen
d74db625a5 remove quotes from --label creation for bcachefs
fixes device groups, for example where the disko config given looks like:

label = "fast.dev1";

after formatting, the device has a literal label of "fast.dev1" which
breaks bcachefs device groups:

echo fast > /sys/fs/bcachefs/<id>/options/foreground_target

gives the error Invalid argument, echo fast.dev1 fails as well

echo "\"fast\"" fails the same, however echo "\"fast.dev1\"" succeeds

after this, device labels and groups work as expected and any component
of the label can be used for a *_target
2025-06-05 18:16:20 +00:00
Jörg Thalheim
6bb82b77ce luks: drop unnecessary subshell 2025-05-08 09:13:14 +00:00
Philipp Schmitt
06fb9283ca Unlock luks devices once and only once 2025-05-08 09:13:14 +00:00
Philipp Schmitt
69265ccde5 Fix _destroy 2025-05-08 09:13:14 +00:00
Philipp Schmitt
cbc1f418d0 Improve luks device detection 2025-05-08 09:13:14 +00:00
Philipp Schmitt
aa5d53aee8 Add disk.destroy option 2025-05-08 09:13:14 +00:00
Jörg Thalheim
c7e0b00007 diskoImagesScript: unset NIX_REMOTE
for some reason this is set and breaks running disko outside of the vm
2025-05-08 09:07:26 +00:00
Kyle Petryszak
8d78963819 fix: addresses: https://github.com/koverstreet/bcachefs/issues/812 2025-05-07 17:27:41 +00:00
nothingnesses
7b63642358 Make bcachefs subvolumes boot-time mount tests pass + more tests 2025-05-04 20:24:55 +00:00
nothingnesses
ca27b88c88 Add bcachefs type with encryption and multi-disk support
This update introduces a bcachefs type with encryption support and advanced formatting options.
It includes a new example (`examples/bcachefs-multi-disk.nix`) to demonstrate multi-disk setups and available options.

Key changes:

- Deterministic UUID generation.
- Addressed limitations with multi-disk root setups due to bcachefs and systemd issues.
- Provided a systemd-mount alternative for fileSystems configuration.
- Added subvolume support and updated scripts for clarity and functionality.

---------

Co-authored-by: Jonas Heinrich <onny@project-insanity.org>
Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com>
Co-authored-by: Kyle Petryszak <6314611+ProjectInitiative@users.noreply.github.com>

Update
* Add examples
* Improve descriptions

Remove debugging

Remove comment

Use `unique` to dedup lists
2025-04-24 13:41:42 +00:00
Jeremy Fleischman
51d33bbb7f UI nit: remove unnecessary newline when prompting user for password 2025-04-18 01:42:02 +00:00
Jörg Thalheim
76c0a6dba3 udevadm settle: use timeout
there are cases where this can just indefinitly hang as we can see in VM
tests. Let's add a tie breaker.
2025-04-08 20:46:43 +00:00
Jörg Thalheim
8f806681d7 tree-wise: quote path correctlys 2025-04-08 15:36:04 +00:00
Ari Gato
329d3d7e8b interactive-vm: use disk.imageName instead of .name
Avoids a "No such file or directory" if a configuration uses a named disk image.
2025-04-02 12:57:47 +00:00
meck
9a7ab516cf Set buildPlatform in make-disk-image
Currently if building an image using cross compilation:

nixpkgs = {
  config.allowUnsupportedSystem = true;
  hostPlatform = "armv7l-linux";
  buildPlatform = "x86_64-linux";
};

And resetting the Disko packages for binFmt use:

disko.imageBuilder =
  let
    diskoPkgs = nixpkgs.legacyPackages."x86_64-linux";
  in
  {
    enableBinfmt = true;
    pkgs = diskoPkgs;
    kernelPackages = diskoPkgs.linuxPackages_latest;
  };

Something will differ between host/build Platform in diskoPkgs (Not sure
what, they look the same when tracing but there is functions that maybe
differ) causing it to miss the nixpkgs cache and rebuilding for x86_64-linux.
Also resettings buildPlatform fixes this.
2025-03-12 08:35:27 +01:00
rszyma
19c1140419 fix schellcheck warning failing build 2025-02-25 12:19:28 +00:00
lassulus
fa5746ecea types disk: fix deviceOrdering 2025-02-15 15:53:51 +00:00
DavHau
ff2d853a84 treewide: format all files 2025-02-15 10:08:56 +00:00
Rua
a825e29a3b Use regex for UUID, adjust documentation a bit 2025-02-15 01:27:47 +00:00
Rua
bf440582c4 Use concatMapStrings 2025-02-15 01:27:47 +00:00
Rua
54be8abff0 Add configration option for partition UUIDs 2025-02-15 01:27:47 +00:00
danjujan
e51159153b make-disk-image: format natively 2025-02-14 10:39:29 +00:00
Sávio
6438340415 make-disk-image: add binfmt emulation 2025-02-14 10:39:29 +00:00
lassulus
85942f35d3 Revert "Fix: Device dependencies not sorting correctly"
This reverts commit 40da43e8e5.
2025-02-14 07:40:53 +00:00
Kyle Petryszak
40da43e8e5 Fix: Device dependencies not sorting correctly 2025-02-14 07:22:23 +00:00
Sávio
fa88901f1e make-disk-image: fix virtiofs 2025-02-14 06:27:20 +00:00
Sávio
9503f225a4 make-disk-image: fix build environment variables 2025-02-14 06:27:20 +00:00
lassulus
26ade10051 lib: fix recursiveUpdate not merging lists 2025-02-12 10:45:46 +01:00
nhnn
ff3568858c style: make it prettier 2025-02-05 17:19:22 +03:00
nhnn
68ef26bb78 fix: use zfs kernel module which corresponds to user-space tools 2025-02-05 15:20:10 +03:00
Leonie Marcy Vack
c53bfaa13a zfs_volume: fix eval of _unmount if content is null 2025-01-16 14:46:04 +01:00
whs
ade21e2c96 Fix typo 2025-01-11 09:56:21 +00:00
Sávio
fe89f379e7 make-disk-image: fix function precedence breaks customQemu 2025-01-10 20:23:13 -03:00
Jörg Thalheim
7ea6edd857 zfs-with-vdevs: add an example for using absolute device paths
This is the only way to assign devices rather than fixed gpt partitions.
Without reading the code it's not very obvious how disko actually
assigns devices to zpools.
2024-12-24 14:45:56 +01:00
Jörg Thalheim
2ee76c861a
Merge pull request #921 from nix-community/zfs-fix
zfs: run load-key on mount/unmount
2024-12-20 14:26:41 +01:00
Jörg Thalheim
d8f3cfc582 zfs: run load-key on mount 2024-12-20 14:24:53 +01:00
Jörg Thalheim
dcd15a37f7 make-disk-image fix virtiofs support 2024-12-16 09:27:07 +01:00