152 Commits

Author SHA1 Message Date
nothingnesses
78d6a1365c Use a hard-coded UUID for the failing example to get it to work 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
Jörg Thalheim
a8e75da08f disko-deactivate: fix jq syntax 2025-04-08 18:03:50 +00:00
Jörg Thalheim
0c8f1b9eab Merge pull request #977 from nix-community/update_flake_lock_action
flake.lock: Update
2025-03-12 14:13:09 +01:00
Jörg Thalheim
87d86e499c fix eval for make-disk-image test 2025-03-11 10:11:35 +01:00
Dennis Værum
2db1d64fc0 Added example for swap on zfs_volume
I could not find an example of how to enable swap on a `zfs_volume` but since I made it work I wanted to share it 😁
2025-03-11 09:06:40 +00:00
DavHau
be1e4321c9 tests/disko-install: make faster by optimizing closure size 2025-02-17 02:51:54 +00:00
DavHau
ff2d853a84 treewide: format all files 2025-02-15 10:08:56 +00:00
DavHau
5d6c85c1d0 Update tests/zfs-encrypted-root.nix
Co-authored-by: lassulus <github@lassul.us>
2025-02-15 05:51:50 +00:00
DavHau
d478e2f9f3 zfs: add example for encrypted root 2025-02-15 05:51:50 +00:00
Jörg Thalheim
4edb87a2ac test explicit gpt uuid optoin 2025-02-15 01:27:47 +00:00
Aos Dabbagh
7d9940a4df doc: simple xfs with options
This PR documents an XFS example that uses the `xfs_quota` feature.
2024-12-28 16:43:16 -05: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
d8f3cfc582 zfs: run load-key on mount 2024-12-20 14:24:53 +01:00
Gary Guo
3e83c11038 Fix evaluation when a GPT partition is left unformatted 2024-11-25 02:10:48 +00:00
Michon van Dooren
d192ffd944 Fix zpool create for disk vdev after mirror vdev
A config like

```nix
{
  vdev = [
    {
      mode = "mirror";
      members = [ "data1" "data2" ];
    }
    {
      members = [ "data3" ];
    }
  ];
}
```

would result in the following command:

```shell
zpool create -f <name> mirror /dev/data1 /dev/data2 /dev/data3
```

which would result in a single vdev with a 3-way mirror, rather than a
vdev with a 2-way mirror and a second vdev with a single disk. By
reordering the vdevs to handle those with an empty mode first we
transform this into:

```shell
zpool create -f <name> /dev/data3 mirror /dev/data1 /dev/data2
```

which does have the desired outcome.
2024-11-18 01:33:49 +01:00
Jörg Thalheim
6bfa3a18d4 tests/interactive-cryptsetup: make waiting for passphrase more robust 2024-11-08 11:07:09 +01:00
Jörg Thalheim
a8bdb16b47 tests/disko-install: fix eval 2024-11-08 08:38:31 +01:00
Jörg Thalheim
dd3d2a5e93 fix offline installation 2024-11-08 08:33:11 +01:00
Andrew Marshall
3979285062 treewide: Fix using pkgs.{build,host}Platform alias
This was recently changed in nixpkgs to be an alias; if nixpkgs is
configured to disable aliases, this usage will fail.
2024-10-29 09:32:41 +01:00
Felix Uhl
ca47da60e5 disko: fix improper handling of whitespace
Fixes #130

This should fix pretty much all cases where spaces or other special
characters would break disko due to improper quoting. I searched for all
instances of '.label', '.device' and '.name', so I believe I caught
whatever I could.

In some cases I changed single quotes to double quotes for consistency.

I know we don't usually fix bugs in the legacy table type, but it was so
easy I couldn't resist.
2024-10-22 09:10:08 +00:00
Chris Scutcher
78d685c123 tests: Add failing test to demonstrate issues with whitespace in part names
Reproduces #130.

For new style table the generated script has a few problems for example;

```sh
    sgdisk \
      --new=2:0:+100M \
      --change-name=2:disk-vdb-name with spaces \
      --typecode=2:EF00 \
      /dev/vdb
```

and

```sh
mkfs.vfat \
         \
        /dev/disk/by-partlabel/disk-vdb-name with spaces
```

Legacy table style generates slightly different problems e.g.;

```sh
parted -s /dev/vdb -- mkpart name with spaces  1MiB 100MiB
```
2024-10-22 09:10:08 +00:00
Felix Uhl
dcabccaad6 swap: fix partition type
Fixes #391
2024-10-16 17:05:43 +00:00
Felix Uhl
aee84b5fb3 disko cli: add --version command
Fixes #745

This adds a script to create a release. Running it will create two
commits that would appear like this in `git log --oneline`:

    67b5fff (master) release: reset released flag
    0b808f3 (tag: v1.8.1) release: v1.8.1
    100d2f3 docs: last change before release

It also re-creates the `version.nix` file, which is used by the flake
to determine the final version the disko CLI will print.

If `disko --version` is run from exactly the commit tagged `v1.8.1`, it
will print `1.8.1`. If it is run from any commit past that (like
master), it will print `1.8.1-67b5fff`, and if it is run from a local
folder with uncommitted changes, it will print `1.8.1-67b5fff-dirty`.
2024-10-11 15:14:56 +00:00
Felix Uhl
ba436edc9d Test luks-encrypted btrfs raid 2024-10-01 19:34:46 +02:00
Jörg Thalheim
4e30bc7921 zfs-with-vdevs: increase pool import timeout
Fix fixes a long-standing test failures we have with the zfs-with-vdevs.
2024-10-01 10:08:10 +02:00
Felix Uhl
72c867c439 Run nix fmt 2024-09-26 15:36:54 +02:00
Michael Hoang
cc4d4a4b91 make-disk-image: convert into NixOS module
As `makeDiskImages` always requires a NixOS configuration, we can
simplify the code by convering it into a NixOS module. Then we can make
it responsible for populating `system.build.diskoImages` and
`system.build.diskoImagesScript`.
2024-09-14 19:35:44 +10:00
Jörg Thalheim
37c83c08d1 Merge pull request #723 from dmadisetti/dm/zfs-extra
zfs: add ZFS "topology" features like explicit vdevs, cache, and special
2024-09-03 17:07:39 +02:00
dylan madisetti
cf5d451adc test: Add cache specific test 2024-08-27 08:29:31 -04:00
matthewcroughan
cc86fe1a7c f2fs: init 2024-08-20 10:26:29 +01:00
dylan madisetti
8d071db09b test: fix and add stub test for zfs-with-vdevs 2024-08-05 12:11:35 -04:00
Matthew_Cash
b6a1262796 lvm_vg: add lvm thinpool/thinlv support
Co-authored-by: ajs124 <git@ajs124.de>
2024-06-26 11:36:52 +00:00
Jörg Thalheim
804ab2de77 treewide: reformat with nix fmt 2024-06-09 06:40:59 +00:00
Jörg Thalheim
398acc470f update to new nixos test api 2024-06-07 14:20:40 +00:00
Jörg Thalheim
babc1554e8 drop duplicated disko-install definition 2024-05-07 08:53:10 +02:00
Jörg Thalheim
cdefe26742 load database with checksum again but do the same in disko-install 2024-05-07 08:53:10 +02:00
Kira Bruneau
79eab0e82c types btrfs: fix format without swap or subvolumes 2024-04-08 21:37:04 +00:00
lassulus
e18e85ba3f tests/make-disk-image: increase memSize 2024-04-08 18:40:31 +02:00
Jörg Thalheim
72818e54ec move disko-install into disko package 2024-03-09 07:05:35 +00:00
Jörg Thalheim
0d11aa8d64 disko-install: add extra-files option 2024-03-05 09:52:34 +00:00
lassulus
05f0e3fd56 lib/tests: use startCommand for create_machine 2024-03-05 08:56:58 +01:00
Jörg Thalheim
0c9b003a48 bcachefs: drop zfs hack 2024-03-05 08:56:58 +01:00
lassulus
561579a631 add long-device-name test & example 2024-03-04 14:55:56 +01:00
Jörg Thalheim
bde7dd352c add disko-install command
disko-install combines disko and nixos-install into a single command.

Example usage:

  sudo ./disko-install --flake /someflake#eva --disk sda /dev/zvol/zroot/test
2024-03-01 09:48:08 +00:00
danjujan
f7424625dc Rework Hybrid MBR https://github.com/nix-community/disko/pull/168 (#508)
Add hybrid MBR functionality to the gpt type
2024-01-26 21:59:23 +01:00
Jörg Thalheim
c12719812d bcachefs: stick to nixos's default bcachefs kernel 2024-01-26 09:38:59 +00:00
Jörg Thalheim
38af7137e0 tests/bcachefs: switch to linux_latest 2024-01-15 14:29:04 +00:00
Michael Hoang
583bdf4fc6 tests: check canmount ZFS flag is respected 2024-01-01 01:09:11 +00:00