Commit Graph
1390 Commits
Author SHA1 Message Date
github-actions[bot]andGitHub 24fed06cac flake: update inputs (#1268)
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action
2026-06-08 04:56:02 +00:00
borsandgithub-actions[bot] 85d7f921cd [create-pull-request] automated change 2026-06-08 04:41:54 +00:00
github-actions[bot]andGitHub 115e521178 flake: update inputs (#1267)
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action
2026-06-01 05:05:12 +00:00
borsandgithub-actions[bot] 0a3481adf8 [create-pull-request] automated change 2026-06-01 04:50:56 +00:00
Michael HoangandGitHub caa775cf67 Activate unmount tests (#1150)
Adds missing testscript code to execute unmount scripts. With this
change all test derivations of the Disko examples verify proper
unmounting behaviour.

Part of stacked pull requests to enable unmount testing. This is PR 4
out of 4. Stacks on top of #1149.
Only the last commit applies to this PR.

See #1140 for ealier discussion.
2026-05-29 09:56:52 +00:00
Bert ProesmansandMichael Hoang 8ff2716d01 Fix(test); Add idempotent unmounting to tests of example configuration 2026-05-29 08:41:07 +02:00
Bert ProesmansandMichael Hoang 2c40806b93 feat(mdadm); start mdadm before mounting datasets 2026-05-29 08:41:07 +02:00
Bert ProesmansandMichael Hoang 5c7406ecc5 Fix(zfs_volume); Volume mount/unmount with encryption
- Fix consistent use of fully qualified dataset path
- Add idempotent unmounting with encryption keys
2026-05-29 08:41:07 +02:00
Bert ProesmansandMichael Hoang 03e19b4f67 Feature(zfs_volume); Add internal option for fully qualified zfs path 2026-05-29 08:41:07 +02:00
github-actions[bot]andGitHub 36c1d04e85 flake: update inputs (#1239)
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action
2026-05-28 04:21:46 +00:00
borsandgithub-actions[bot] 85e79db1bd [create-pull-request] automated change 2026-05-28 04:08:17 +00:00
Michael HoangandGitHub 5ba0c9555c luks: add test for FIDO2 (#1264) 2026-05-25 09:00:11 +00:00
Michael Hoang a1b9822f03 luks: add test for FIDO2 2026-05-25 10:55:36 +02:00
Michael Hoang 640d1dd8e0 tests: fix enabling Canokey 2026-05-25 10:55:36 +02:00
Michael Hoang 7da3d737f7 luks: fix not asking for password in format script 2026-05-20 00:19:04 +02:00
Michael Hoang 0d15976fce luks: don't depend on autogenerated password 2026-05-20 00:14:40 +02:00
Michael Hoang d60b2b5e00 luks: improve idempotency for enrolling FIDO2
Using FIDO2 automatically generates a temporary password for setting up LUKS
which is not available on subsequent runs of the script causing the format
script to crash with `password: unbound variable`.
2026-05-20 00:07:06 +02:00
Michael HoangandGitHub 65fb947964 flake: bump nixpkgs (#1258) 2026-05-19 21:37:54 +00:00
Michael Hoang 6795806dbc tests/zfs-with-vdevs: fix not all vdevs detected 2026-05-19 23:33:40 +02:00
a-kenjiandMichael Hoang e40d944dec tests/bcachefs: read filesystem metadata from sysfs
`bcachefs-tools`: `v1.33.1` cannot read the superblock from a mounted
device. The kernel returns EBUSY whenever
the filesystem is already mounted, so every `bcachefs show-super
/dev/vd*` assertion in this test now fails on the booted system.
2026-05-19 23:07:41 +02:00
a-kenjiandMichael Hoang 403186440c lib/types/bcachefs_filesystem: tolerate already-unlocked filesystem 2026-05-19 16:50:50 +02:00
a-kenjiandMichael Hoang 21d9daf255 tests/disko-install: drop default value for oldmachine 2026-05-19 16:50:50 +02:00
a-kenjiandMichael Hoang baf057aa5b lib/tests: stage the test password file under systemd initrd
`boot.initrd.preDeviceCommands` only runs in the script-based stage 1
and is gated on `!config.boot.initrd.systemd.enable`. Tests that
enable systemd initrd therefore never get `/tmp/secret.key` staged,
and disko's encrypted-filesystem mount hooks fail to find the
configured `passwordFile`.
2026-05-19 16:50:50 +02:00
a-kenjiandMichael Hoang 8ebce63228 tests: register dynamically-created machines with the driver
The nixpkgs test driver was refactored: `driver.machines` is now a
computed property that returns a fresh sorted list combining
`driver.machines_qemu` and `driver.machines_nspawn`. Appending to the
property therefore mutates only the temporary returned list, so the
machines created via `create_test_machine` are no longer registered
with the driver.
2026-05-19 16:50:50 +02:00
a-kenjiandMichael Hoang 17e2eee822 flake: bump nixpkgs 2026-05-19 16:50:50 +02:00
Michael HoangandGitHub d405a17988 devShells: expose disko CLI (#1261) 2026-05-18 20:18:46 +00:00
Michael Hoang a6a0a068c2 devShells: expose disko CLI 2026-05-17 10:44:15 +02:00
lassulusandGitHub 6e8dc7aa0e make-disk-image: don't build native /etc, only the udev rules. (#1260)
This is a very simple change that should mostly address #988 and #1062
without a new option or changing behavior.
2026-05-16 19:15:12 +00:00
June Stepp 4c81091646 make-disk-image: don't build native /etc.
Grab just the udev part.
2026-05-16 09:07:05 -05:00
lassulusandGitHub 63b4e7e6cf Remove alias usage (#1254) 2026-05-02 09:13:35 +00:00
SandroandGitHub 1be7610ee9 Remove alias usage 2026-05-02 01:02:39 +02:00
lassulusandGitHub 32f4236bfc disk-deactivate: wipe raid arrays before stopping them (#1248)
Closes #1247

## How to test
1. Go to $TMP: `cd "$(mktemp -d)"`
2. Get [the
gist](https://gist.github.com/kmein/9644e65ab8218a4b57c35cb9290b86ad):
`wget
https://gist.githubusercontent.com/kmein/9644e65ab8218a4b57c35cb9290b86ad/raw/3ec76f6a142abb1f4ea3764563a8843984b300d4/flake.nix`
3. See it fail: `nix build` (output: _Exception: The canary file
survived the Disko wipe process!_)
4. Switch the branch: `sed -i
's#github:nix-community/disko#github:kmein/disko?ref=fix/mdadm-destroy#'
flake.nix`
5. Watch it work: `nix build`
2026-04-19 15:46:07 +00:00
lassulusandGitHub ce160f5185 Fix failing ShellCheck for LUKS partitions (#1250)
Trivial fix
2026-04-19 15:42:53 +00:00
lassulusandGitHub 156dd93f59 feat: add FIDO2 & recovery support for LUKS (#1143)
This introduces what has been described in

https://0pointer.net/blog/unlocking-luks2-volumes-with-tpm2-fido2-pkcs11-security-hardware-on-systemd-248.html.

That is: support for FIDO2 and recovery passphrases and their boot
mechanism.

Testing is hard right now because of canokey-qemu being broken and U2F
is not a valid replacement for FIDO2…

I tried to keep as much as possible the previous behavior and make it
possible to mix FIDO2 and normal passphrases or key files without any
problem.

PIV support is out of scope for this change but can easily be added.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* FIDO2 token enrollment for LUKS-encrypted root with optional automatic
recovery passphrase and new configuration options to control enrollment
behavior.

* **Examples**
* Added an example configuration demonstrating a FIDO2-protected disk
layout (ESP + encrypted root) with FIDO2 enrollment enabled.

* **Tests**
* Added automated test coverage for the FIDO2/LUKS workflow and a
test-mode option to simulate a hardware FIDO2 device.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-04-19 14:03:58 +00:00
Raito Bezarius b02541f2d0 feat: add FIDO2 & recovery support for LUKS
This introduces what has been described in
https://0pointer.net/blog/unlocking-luks2-volumes-with-tpm2-fido2-pkcs11-security-hardware-on-systemd-248.html.

That is: support for FIDO2 and recovery passphrases and their boot
mechanism.

Testing is hard right now because of canokey-qemu being broken and U2F
is not a valid replacement for FIDO2…

I tried to keep as much as possible the previous behavior and make it
possible to mix FIDO2 and normal passphrases or key files without any
problem.

PIV support is out of scope for this change but can easily be added.

Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2026-04-19 15:26:35 +02:00
magic_rb 47deadb7c1 Fix failing ShellCheck for LUKS partitions
Signed-off-by: magic_rb <magic_rb@redalder.org>
2026-04-13 14:23:41 +02:00
Kierán Meinhardt dffa2001ce add canary test for btrfs on mdadm wipes
Adds a NixOS integration test to verify that the `disk-deactivate`
script properly destroys BTRFS filesystems residing on mdadm RAID arrays.
2026-04-08 10:26:37 +02:00
Kierán Meinhardt 669ca49ae4 disk-deactivate: wipe raid arrays before stopping them
Previously, the `disk-deactivate` script stopped mdadm arrays before
wiping the underlying physical disks. This caused filesystems with
backup superblocks (like BTRFS at 64 MiB and 256 GiB offsets) to
survive the wipe, as the backups were striped across the physical
disks and missed by `wipefs` on the raw block devices.

When the array was reassembled during reprovisioning, the filesystem
superblocks realigned. `disko` would detect the old filesystem via
`blkid` and silently skip the `mkfs` step, leaving stale data intact.

This commit adds a `wipefs --all` command against the assembled RAID
device *before* stopping it, ensuring all filesystem signatures and
backup superblocks are cleanly destroyed.
2026-04-08 09:40:37 +02:00
github-actions[bot]andGitHub 5ad85c82cc flake: update inputs (#1231)
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action
2026-03-19 03:01:46 +00:00
borsandgithub-actions[bot] c3b6033c65 [create-pull-request] automated change 2026-03-19 02:45:56 +00:00
Jörg ThalheimandGitHub 878ec37d6a Escape ZFS args (#1222)
Args to ZFS (like mountpoints) might have spaces or other
shell-unfriendly characters in them. This escapes those so they get
passed to zfs correctly.
2026-03-14 16:38:37 +00:00
Jörg ThalheimandGitHub c4d34f2031 fix: correct typos across docs and messages (#1229)
## Summary

This PR fixes typos in docs and user-facing messages.

## Detailed Changes

| File | Fixed |
|---|---|
| `scripts/create-release.nix` | `uncommited` -> `uncommitted` (4x) |
| `lib/default.nix:906` | `Depracated` -> `Deprecated` |
| `lib/tests.nix:195` | `mkOveride` -> `mkOverride` |
| `docs/interactive-vm.md:3` | `similiar` -> `similar` |
| `docs/disko-images.md:82` | `involed` -> `involved` |
| `docs/disko-images.md:110` | `scirpt` -> `script` |
| `docs/table-to-gpt.md:62` | `partiton` -> `partition` |
| `lib/make-disk-image.nix:212` | `involed` -> `involved` |
| `docs/disko-images.md:11` | `In the this example` -> `In this example`
|

No intended behavior change.

Closes #1228
2026-03-14 16:34:36 +00:00
github-actions[bot]andGitHub 7b9f7f88ab flake: update inputs (#1227)
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action
2026-03-09 02:56:50 +00:00
borsandgithub-actions[bot] 0fce0ab2bd [create-pull-request] automated change 2026-03-09 02:41:51 +00:00
lassulusandGitHub eaafb89b56 Mount file-systems in the correct order (#1057)
Use the `fsBefore` function from NixOS to sort the file-systems.
The function originates from `nixpkgs/nixos/lib/utils.nix`, but the file
is a lambda that requires more arguments than we have available.
2026-03-07 07:05:52 +00:00
Francesco Zanini 0597c9262e Mount file-systems in the correct order
Use the `fsBefore` function from NixOS to sort the file-systems.
The function originates from `nixpkgs/nixos/lib/utils.nix`, but the file
is a lambda that requires more arguments than we have available.
2026-03-05 09:33:32 +01:00
lassulusandGitHub 42affa9d33 Better handling of bind mounts in make-disk-image (#1056)
The device of the bind mounts is incorrectly taken verbatim while making
the image. The root hierarchy is mounted at `config.rootMountDir`
(`/mnt` by default) during the process, and this commit prepends that
path to the `device` in these cases.
2026-03-05 08:25:10 +00:00
luojiyin 089cf54ff3 fix: correct uncommitted spelling in release script 2026-03-05 12:13:10 +08:00
luojiyin 29d01f4245 test: fix typo in mkOverride comment 2026-03-05 12:13:09 +08:00
luojiyin 6be2229087 fix: correct typo in disk image help text 2026-03-05 12:13:08 +08:00