Commit graph

306 commits

Author SHA1 Message Date
Jörg Thalheim
6bb82b77ce luks: drop unnecessary subshell 2025-05-08 09:13:14 +00:00
Philipp Schmitt
06fb9283ca Unlock luks devices once and only once 2025-05-08 09:13:14 +00:00
Philipp Schmitt
69265ccde5 Fix _destroy 2025-05-08 09:13:14 +00:00
Philipp Schmitt
cbc1f418d0 Improve luks device detection 2025-05-08 09:13:14 +00:00
Philipp Schmitt
aa5d53aee8 Add disk.destroy option 2025-05-08 09:13:14 +00:00
Jörg Thalheim
c7e0b00007 diskoImagesScript: unset NIX_REMOTE
for some reason this is set and breaks running disko outside of the vm
2025-05-08 09:07:26 +00:00
Kyle Petryszak
8d78963819 fix: addresses: https://github.com/koverstreet/bcachefs/issues/812 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
Jeremy Fleischman
51d33bbb7f UI nit: remove unnecessary newline when prompting user for password 2025-04-18 01:42:02 +00:00
Jörg Thalheim
76c0a6dba3 udevadm settle: use timeout
there are cases where this can just indefinitly hang as we can see in VM
tests. Let's add a tie breaker.
2025-04-08 20:46:43 +00:00
Jörg Thalheim
8f806681d7 tree-wise: quote path correctlys 2025-04-08 15:36:04 +00:00
Ari Gato
329d3d7e8b interactive-vm: use disk.imageName instead of .name
Avoids a "No such file or directory" if a configuration uses a named disk image.
2025-04-02 12:57:47 +00:00
meck
9a7ab516cf Set buildPlatform in make-disk-image
Currently if building an image using cross compilation:

nixpkgs = {
  config.allowUnsupportedSystem = true;
  hostPlatform = "armv7l-linux";
  buildPlatform = "x86_64-linux";
};

And resetting the Disko packages for binFmt use:

disko.imageBuilder =
  let
    diskoPkgs = nixpkgs.legacyPackages."x86_64-linux";
  in
  {
    enableBinfmt = true;
    pkgs = diskoPkgs;
    kernelPackages = diskoPkgs.linuxPackages_latest;
  };

Something will differ between host/build Platform in diskoPkgs (Not sure
what, they look the same when tracing but there is functions that maybe
differ) causing it to miss the nixpkgs cache and rebuilding for x86_64-linux.
Also resettings buildPlatform fixes this.
2025-03-12 08:35:27 +01:00
rszyma
19c1140419 fix schellcheck warning failing build 2025-02-25 12:19:28 +00:00
lassulus
fa5746ecea types disk: fix deviceOrdering 2025-02-15 15:53:51 +00:00
DavHau
ff2d853a84 treewide: format all files 2025-02-15 10:08:56 +00:00
Rua
a825e29a3b Use regex for UUID, adjust documentation a bit 2025-02-15 01:27:47 +00:00
Rua
bf440582c4 Use concatMapStrings 2025-02-15 01:27:47 +00:00
Rua
54be8abff0 Add configration option for partition UUIDs 2025-02-15 01:27:47 +00:00
danjujan
e51159153b make-disk-image: format natively 2025-02-14 10:39:29 +00:00
Sávio
6438340415 make-disk-image: add binfmt emulation 2025-02-14 10:39:29 +00:00
lassulus
85942f35d3 Revert "Fix: Device dependencies not sorting correctly"
This reverts commit 40da43e8e5.
2025-02-14 07:40:53 +00:00
Kyle Petryszak
40da43e8e5 Fix: Device dependencies not sorting correctly 2025-02-14 07:22:23 +00:00
Sávio
fa88901f1e make-disk-image: fix virtiofs 2025-02-14 06:27:20 +00:00
Sávio
9503f225a4 make-disk-image: fix build environment variables 2025-02-14 06:27:20 +00:00
lassulus
26ade10051 lib: fix recursiveUpdate not merging lists 2025-02-12 10:45:46 +01:00
nhnn
ff3568858c style: make it prettier 2025-02-05 17:19:22 +03:00
nhnn
68ef26bb78 fix: use zfs kernel module which corresponds to user-space tools 2025-02-05 15:20:10 +03:00
Leonie Marcy Vack
c53bfaa13a zfs_volume: fix eval of _unmount if content is null 2025-01-16 14:46:04 +01:00
whs
ade21e2c96 Fix typo 2025-01-11 09:56:21 +00:00
Sávio
fe89f379e7 make-disk-image: fix function precedence breaks customQemu 2025-01-10 20:23:13 -03: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
2ee76c861a
Merge pull request #921 from nix-community/zfs-fix
zfs: run load-key on mount/unmount
2024-12-20 14:26:41 +01:00
Jörg Thalheim
d8f3cfc582 zfs: run load-key on mount 2024-12-20 14:24:53 +01:00
Jörg Thalheim
dcd15a37f7 make-disk-image fix virtiofs support 2024-12-16 09:27:07 +01:00
Jörg Thalheim
2097ca7a9e
Merge pull request #916 from 0x450x6c/zvol_extra_args
Add extraArgs to zfs_volume.
2024-12-13 12:07:58 +01:00
neox
a0c967fef4 Add extraArgs to zfs_volume.
Update lib/types/zfs_volume.nix
2024-12-13 11:16:40 +01:00
Jörg Thalheim
22cd4b7e49 check for db.sqlite rather than /nix/store
since we initialize the database last, it's safe to use the database as
a sentinel path
2024-12-05 13:05:22 +01:00
Jörg Thalheim
98894c8598 make-disk-image: create directories images in out path
In case we are crossing some filesystem boundary (i.e. /tmp -> /nix/store),
this is faster. Also tmpfs might be probelemantic regarding memory usage.
2024-12-05 13:05:22 +01:00
Felix Uhl
67a130b984 tree-wide: Remove all uses of lib.mdDoc
This was deprecated in 24.05 already, and removed in 24.11.
2024-12-02 20:28:17 +01:00
Felix Uhl
3faa300212 disk-image: Fix compatibility with nixpkgs unstable
Fixes #900

This was caused by https://github.com/NixOS/nixpkgs/pull/354535
originally. The breaking changes introduced there have been resolved by
https://github.com/NixOS/nixpkgs/pull/360413, but one addition survived,
which was the line `source $stdenv/setup`.

Because we used `>` instead of `>>`, `saved-env` was overwritten, so
even with the second PR, the script failed with the following error:

    /nix/store/pw...ykc-vm-run-stage2: line 16: stdenv: unbound variable

Once this and the second PR mentioned above are merged, #903 will be
unblocked.
2024-11-30 17:36:29 +01:00
Jörg Thalheim
b71e3faca9
Merge pull request #906 from nix-community/fix-904
make-disk-image: Compare against correct nixpkgs version
2024-11-29 23:29:22 +01:00
Felix Uhl
5655a13ac9 make-disk-image: Compare against correct nixpkgs version
It seems that there is a difference between how `pkgs` and `lib` get
passed to NixOS modules: `pkgs` is the unmodified original, `lib` is the
final version after overrides etc.

This causes `pkgs.lib.version` to be `24.11git` in some cases, while
`lib.version` is `24.11.20241123.0c58267`.
Maybe this can be fixed in nixpkgs? Either way, this change fixes that
issue.

Fixes #904
2024-11-29 19:38:31 +01:00
Jörg Thalheim
aa006252c8 add unmount feature 2024-11-29 14:44:15 +01:00
Gary Guo
3e83c11038 Fix evaluation when a GPT partition is left unformatted 2024-11-25 02:10:48 +00:00
Jörg Thalheim
47bc8dfb6f
Merge pull request #895 from nix-community/fix-mountoptions
also passthrough rootfs mountoptions
2024-11-24 22:11:48 +01:00
Jörg Thalheim
0433c7e883 also passthrough rootfs mountoptions 2024-11-24 18:39:57 +01:00
Jörg Thalheim
abc8baff33
Merge pull request #890 from nix-community/disko-install
disko-install: dry-run improvements
2024-11-22 15:10:44 +01:00
Jörg Thalheim
fd3e326e9a disable swap in disko-install
Update disko-install

Co-authored-by: Michael Hoang <Enzime@users.noreply.github.com>
2024-11-22 12:45:57 +01:00