Commit graph

107 commits

Author SHA1 Message Date
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
Sergey Kazenyuk
099b6cca33 btrfs: add swap priority, options 2024-09-03 14:06:14 +00:00
Sergey Kazenyuk
39b4091769 swap: add mountOptions 2024-09-03 14:06:14 +00:00
zerox
70a22d25a2 Switch to qcow2 in the interactive VM. 2024-08-31 09:57:41 +05:00
Dylan Madisetti
071306e76a
tidy: apply suggestions from code review
Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com>
2024-08-26 14:13:07 -04:00
dylan madisetti
c9d3bc3755
fix: properly apply oneOf 2024-08-26 14:00:44 -04:00
dylan madisetti
ea3ce722ea
zfs: fix test and add documentation 2024-08-26 13:03:25 -04:00
dylan madisetti
cc2e247193
zfs: make topology a mode type 2024-08-26 12:27:04 -04:00
zerox
540cd416f6
zfs: add ability to specify full path of to the disk. 2024-08-26 09:48:53 +05:00
Felix Uhl
435737144b swap: don't create filesystem if randomEncryption is enabled
This is not an issue when initially creating the partition because
device mapper will just map on top of the filesystem, but it breaks
incremental updates because the check for `TYPE=` will fail, and the
subsequent attempt to run `mkswap` also fails:

mkswap: cannot open /dev/disk/by-partlabel/disk-nix-store-swap: Device or resource busy

Instead, just don't do anything, NixOS will take care of it.
2024-08-22 17:59:43 +00:00
Felix Uhl
f6b2e0052d zfs_fs: Fix errors when not changing mountpoint
Running `zfs set mountpoint=/mnt/my-ds tank/my-ds`, ZFS may try to
unmount the dataset even if the mountpoint didn't change.
To avoid the confusing error message, this command is now only run when
the mountpoint actually changes.
2024-08-22 17:50:13 +00:00
lassulus
6433571556
Merge pull request #713 from nix-community/interactiveVM
add interactive VMs
2024-08-21 16:12:23 +02: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
dylan madisetti
6bebcc728e
tidy: move relevant variables and format script block 2024-08-01 15:59:33 -04:00
dylan madisetti
b2a106f8ed
zfs: Add topology attribute to zpool 2024-08-01 15:41:09 -04:00
lassulus
5a9f2498fb luks: add testmode password "disko" 2024-07-21 22:45:12 +02:00
lassulus
6208b31a73 nix fmt 2024-07-21 16:44:30 +02:00
Jörg Thalheim
05f4e223b5 gpt: move boot partitions to the front of disko
Than we no longer need to do this in our examples.

Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
2024-06-30 07:50:33 +00:00
Jörg Thalheim
115311bc39 zfs: try to import zpool in incremental mode
if the pool is not imported, zfs list will return a value. So to check
that the pool does not exist, we also import it.

fixes https://github.com/nix-community/disko/issues/690
2024-06-28 13:52:20 +00:00
Jörg Thalheim
96cab883db zfs: when dataset already exist, only update dataset options 2024-06-28 13:53:07 +02: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
lassulus
a77fb7dde9 add table-to-gpt migration guide 2024-05-30 21:28:52 +02:00
Jared Baur
e9dd5abae3
Add coreutils to list of dependencies
This allows for the disko scripts to be ran in more foreign environments
where we can't assume the basic utilities coreutils provides are
available or aren't 1-for-1 compatible (e.g. busybox utilities).
2024-05-15 09:57:53 -07:00
Giel van Schijndel
f236f6df36 swap: forward discardPolicy option to randomEncryption.allowDiscards
I.e. instead of effectively ignoring `discardPolicy` when combined with
`randomEncryption`, or adding a second option requiring the user to
repeat themselves (DRY violation), just enable both when requested via
`discardPolicy`.

Without this `discardPolicy` is a NOP when `randomEncryption` is
enabled.
2024-05-14 21:30:40 +00:00
Giel van Schijndel
c5a25d5ced
swap: support swapDevices.*.priority option
This just forwards to the underlying NixOS option and expands the mount
script to exhibit the same behavior.
2024-05-06 12:11:58 +02:00
Giel van Schijndel
8a02c0507c
swap: support swapDevices.*.discardPolicy option 2024-05-06 12:11:58 +02:00
Qubasa
9f5d4e45cd nix fmt 2024-04-29 14:57:02 +00:00
0x4A6F
07b7d662d8
make partitions.alignment configurable 2024-04-09 21:45:35 +02:00
Kira Bruneau
79eab0e82c types btrfs: fix format without swap or subvolumes 2024-04-08 21:37:04 +00:00
lassulus
89b617b99d idempotent gpt 2024-04-07 12:47:36 +02:00
lassulus
f6f2e009d6 types zpool: create pool if device is a zfs_member 2024-03-21 05:36:42 +01:00
lassulus
b7a91b50fd types table: fix duplicate create run 2024-03-20 03:26:36 +01:00
lassulus
f6b72bfed7 types *: make create idempotent 2024-03-13 09:58:33 +01:00
Maximilian Bosch
007625baaa
Fix manual build
The option `disko.devices.lvm_vg.<name>.lvs.<name>.priority` depends on
a different option that's unset by default breaking the manual build
like this:

    … while evaluating the attribute 'optionalValue.value'

     at /nix/store/lwyjz70qh12nq6cb7fixl85vryzxqm3c-source/lib/modules.nix:856:5:

      855|
      856|     optionalValue =
         |     ^
      857|       if isDefined then { value = mergedValue; }

    … while evaluating a branch condition

     at /nix/store/lwyjz70qh12nq6cb7fixl85vryzxqm3c-source/lib/modules.nix:857:7:

      856|     optionalValue =
      857|       if isDefined then { value = mergedValue; }
         |       ^
      858|       else {};

    (stack trace truncated; use '--show-trace' to show the full trace)

    error: The option `disko.devices.lvm_vg.<name>.lvs.<name>.size' is used but not defined.

This is especially noticeable when using `documentation.nixos.includeAllModules` locally.

Fixed the issue itself by adding a `defaultText` and added the
`disko-doc` job to the `checks` output so that CI hopefully catches this
from now on.
2024-03-05 17:35:13 +01:00
lassulus
56f6d3d4af types gpt: hash label if it's > 36 characters 2024-03-04 14:55:56 +01:00
ivan770
2ca4b06bdf lvm_vg: add priority option 2024-03-02 13:08:52 -05:00
lassulus
0661bb800c types table: add deprecation warning 2024-02-17 05:31:02 +01:00
lassulus
c13d481b78 hybrid-mbr: cleanup test, wait for udev after paritioning 2024-02-17 04:06:51 +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
Ivan Shapovalov
036d480ae8 lib/types/gpt: do not hard-code alignment to 2048 sectors
On 4Kn disks, 2048-sector alignment is equivalent to 8 MiB which is
excessive. Moreover, there is no point in specifying _any_ alignment
at all because sgdisk defaults to 1 MiB already.

Fixes #497.
2024-01-14 11:28:10 +00:00
misumisumi
fa5db12d76 zfs: Tolerate no mountable dataset 2024-01-11 23:54:13 +00:00
r-vdp
aef9a509db lib/types/gpt: accept GUID type to set the partition type
See [the wikipedia article on GUID types][wiki_guid]
and the sgdisk man page on `--typecode`.

[wiki_guid]: https://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_type_GUIDs
2024-01-03 21:55:10 +00:00
0xadk
f772d2045e luks: apply flags set in config.settings 2024-01-01 01:16:28 +00:00
Michael Hoang
ce3b896151 zfs: respect canmount
Also refactor `zpool` type to use `zfs_fs` to construct the root dataset
for the zpool, which means we no longer need to duplicate the dataset
create and mount logic inside the `zpool` type.
2024-01-01 01:09:11 +00:00
Michael Hoang
2791cedcba zpool: only unmount when root dataset is mounted
Fixes #486
2024-01-01 01:09:11 +00:00
Michael Hoang
9f9ff673d1 zpool: fix default dataset getting shadowed
If the zpool's root dataset is not the rootfs and gets mounted on
creation, the actual rootfs will get mounted later and shadow the
current mountpoint.

Running `zfs unmount` is the easiest way to unmount the zpool's root
dataset on creation without messing up the value of the `mountpoint`
setting.
2023-12-19 23:49:30 +11:00
matthewcroughan
d5cf2e3d61 lib/types/gpt.nix: default = [] -> default = {}
This must have accidentally creeped in during a refactor
2023-12-14 13:55:39 +00:00
Ctem
169e99dc3d fix: create btrfs subvolume parent directories
Fixes #409
2023-12-13 14:58:36 +00:00
Jörg Thalheim
1144887c6f lvm: update kernel modules when creating raid 2023-12-06 23:28:45 +00:00