Commit Graph

154 Commits

Author SHA1 Message Date
Jörg Thalheim
72818e54ec move disko-install into disko package 2024-03-09 07:05:35 +00: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
lassulus
3cb3775f9b lib/tests: use startCommand for create_machine 2024-03-04 01:51:42 +01:00
ivan770
2ca4b06bdf lvm_vg: add priority option 2024-03-02 13:08:52 -05:00
Jörg Thalheim
590245271a add assertion if mirroredBoots is used in vm test 2024-02-22 00:01:18 +00: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
Wim de With
f78b6498f6 make-disk-image: optionally include ZFS module in kernel 2024-01-12 15:58:58 +00:00
Wim de With
b4afc8bab8 make-disk-image: set image format explicitly
QEMU warns if format=raw is implied, and protects block 0 from getting
overwritten.
2024-01-12 15:54:48 +00:00
Wim de With
c38f369ee4 make-disk-image: umount filesystems after install
The vmTools in nixpkgs shuts the VM down with poweroff -f, which does
not cleanly umount the filesystems. This may lead to filesystem
corruption on the newly created image.
2024-01-12 15:54:48 +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
4c4634bbcb make-disk-image: allow extra dependencies to be passed into image builder 2023-12-14 14:24:37 +00:00
matthewcroughan
bb75ad0b1d make-disk-image: inherit kernel from nixosConfiguration 2023-12-14 14:05:13 +00: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
matthewcroughan
bd8fbc3f27 make-disk-image: make memSize configurable per disk
Sometimes the VM builder can run out of memory and fail to allocate memory when installing the system toplevel
2023-12-13 15:02:45 +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
Jörg Thalheim
3cb78c93e6 swap: don't activate random encrypted swap files
This requires more code and is not implemented just now.
2023-11-25 15:47:29 +00:00
Andrew Marshall
2d7d77878c Implement preMountHook & postMountHook
These options previously existed but had no effect. Now they are
implemented. They only affect mount during disko’s filesystem creation,
not during any later mounts.

Adding test case to existing “complex” example and test mostly because
couldn’t think of any better place to put it.
2023-11-12 09:36:50 +00:00
Janik H
4fec5f515c make-disk-image: make generating the image more efficent 2023-11-11 16:14:15 +01:00
Janik H
b6fb19891f make-disk-image: add --build-memory 2023-11-11 16:14:15 +01:00
Janik H
da38eb67aa make-disk-image: improve --help 2023-11-11 16:14:15 +01:00
Aleksander Heintz
72bc152626 add btrfs swap support 2023-11-08 22:36:40 +00:00
Felix Buehler
548962c50b luks: use allowDiscards option 2023-11-04 12:09:41 +00:00
williamvds
4122a18340 Fix read shellcheck warning SC2162
Use `-r` to avoid mangling backslashes, use `IFS=` to not discard leading and
trailing whitespace.
2023-10-22 17:30:12 +00:00
Maximilian Bosch
e738cac18e luks: fix interactive mount
Before that it was only attempted to unlock luks with the key from
`$password`, however that variable didn't exist before.
2023-10-13 20:52:36 +00:00
lassulus
0d39ae5a5b types luks: add password prompt 2023-10-02 16:57:23 +00:00
Jörg Thalheim
b18f43a9c2 luks: don't leak secret in debug logs 2023-09-27 05:52:36 +00:00
lassulus
2bf4fc166b flake: deprecate .lib.lib 2023-09-26 14:00:14 +00:00
lassulus
d48930701c lib.makeDiskImages: also execute postVM 2023-09-26 13:29:13 +00:00
Janik H
fbfd7567c2 make-disk-image: allow secrets-pre-install but after portioning 2023-09-25 16:45:37 +00:00
cvoges12
4a4d77a9ae added raid5 and raid6 to lvm 2023-09-25 14:09:47 +00:00
Sam Hug
a14a3fb0a8 zfs_volume: fix /dev/zvol/ symlink race 2023-09-25 08:57:40 +00:00
lassulus
98a6ab9b52 make-disk-image: fix pre/post files with empty glob 2023-09-22 10:56:30 +00:00
lassulus
9f29cedac7 rename makeDiskImage -> makeDiskImages 2023-09-18 12:16:33 +00:00
Jörg Thalheim
9ab96378f8 reformat tree 2023-09-17 04:43:25 +00:00
David Arnold
0faae8adf6 fix: avoid external probing effects from other devices 2023-09-15 20:04:52 +00:00
Rudolf Vesely
8aa6ec5ff2 Changing how to open LUKS. 2023-09-15 07:39:16 +00:00
Rudolf Vesely
91af5b4a53 Add extra args into swap. 2023-09-14 17:02:49 +00:00
lassulus
689873ae4f types *: run udevadm settle after partprobe 2023-09-13 22:07:35 +00:00
Rudolf Vesely
38daf3c84a Specify alignment for sgdisk. 2023-09-13 21:53:35 +00:00
lassulus
79785c1cfc add pkgs.parted where partprobe is needed 2023-09-12 09:45:57 +00:00