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).
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.
This hopefully fixes the large memory consumption we have seen in the
past. Also presumably coreutils cp is more tuned for performance than
whatever nix does.
closure-info has one flaw, it's possible that this file contains stale
information when build are not reproducible and the local checksum
doesn't match what the remote build created.
The work-around here is that we disregard the hashes and re-compute with
what nar's we actually have locally instead.
The destroy script already has a bash interpreter in use, but when the
`disk-deactivate` script is ran, it calls out to /usr/bin/env to query
for a bash interpreter. When running the destroyScript in unique places
(such as the stage-1 initrd), /usr/bin/env might not exist, so we can
make destroyScript more self-contained by reusing the same bash.
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.
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.
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.
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.
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.
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.