Commit graph

1070 commits

Author SHA1 Message Date
Felix Uhl
ab58501b23 release: v1.9.0 2024-10-28 18:08:12 +01:00
Paul Haerle
3163b2724c
Merge pull request #851 from nix-community/fix-eval-error-unexpected-argument-customQemu
disk-image: Fix "unexpected argument 'customQemu'" eval error
2024-10-28 15:17:58 +01:00
Felix Uhl
bba79f6b5e disk-image: Fix "unexpected argument 'customQemu'" eval error
Previously, an error like

    error: function 'anonymous lambda' called with unexpected argument 'customQemu'

    at /nix/store/lbqj1cndic4121whnx8xm0jgb1c8x4xx-source/pkgs/build-support/vm/default.nix:1:1:

was printed when trying to evaluate `config.system.build.vmWithDisko` or
`config.system.build.diskoImagesScript` with nixpkgs 24.05 (and below).

This argument was added in
65c851cd75,
so technically the minimum version is 24.11.20240708.65c851c. However,
`versionAtLeast` only compares versions alphabetically, so the comparison's
result will be incorrect for other commits made on the same day.

Instead, we compare against 24.11.20240709, which is the next day.
This means this function returns false for some commits that DO support the
customQemu argument, but if it returns true, we can be 100% certain that this
is correct, and we can pass the customQemu argument to vmTools without an
evaluation error.

Fixes #850
2024-10-28 14:38:07 +01:00
iFreilicht
89e458a3bb UX: be specific if disko-install failed or succeeded (#847)
UX: be specific if disko-install failed or succeeded

* Output success message to stdout

Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com>
2024-10-27 16:12:03 +00:00
DavHau
58cd832497 lvm_vg: fix size=100% leading to crash
lvcreate -l does not accept a '100%' parameter which currently leads to a crash. THis change automatically changes `100%` to `100%FREE` leading to the intended behavior.
2024-10-26 11:42:42 +00:00
phaer
09a776702b fix: avoid calling splitString ""...
because it breaks evaluation on darwin with at least nix 2.18.

Evaluating `lib.splitString "" "foo"` throws the following:
`error: invalid regular expression ''`.

We could avoid that by using lib.stringToCharacters, but as
we are mapping over it anyway, lib.stringAsChars seems to be
an even better fit.

I tested the examples in hexEscapeUdevSymlinks docstring manually
in a nix repl.
2024-10-23 19:46:38 +00:00
Felix Uhl
4be2aadf13 lib: use lib.escapeShellArg for concatenated paths 2024-10-22 09:10:08 +00: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
a6a3179ddf cli: stop using system dependencies in destroy step
re-applying 15aa78e9a5 because I
accidentally overwrote it in 15aa78e9a5.
2024-10-18 21:59:08 +02:00
Felix Uhl
d7d57edb72 docs: Add docs for contributors
Fixes #334
2024-10-16 17:27:36 +00:00
Felix Uhl
15aa78e9a5 lib: Remove global with lib;
This is generally regarded as a code-smell. I did utilize `with lib;`
in some places where I felt it aided readability, but it's very clearly
scoped in those situations.

See https://github.com/nix-community/disko/pull/835#issuecomment-2416126497
2024-10-16 17:17:32 +00:00
Felix Uhl
dcabccaad6 swap: fix partition type
Fixes #391
2024-10-16 17:05:43 +00:00
Felix Uhl
c8760cee70 cli: stop using system dependencies in destroy step
Fixes #815
2024-10-16 09:22:47 +00:00
Felix Uhl
9ab6ae4e63 disko-install: make output deterministic
Fixes #827
2024-10-15 16:36:09 +00:00
qbisi
3b778f10eb docs: add docs on how to use imageName in disk type. 2024-10-14 16:16:13 +00:00
qbisi
ef408f7f9a options: add imageName option to disk type.
For disk type, option name used in disk partlabel
naming should be short. While setting a specialized
option imageName allow us to create image with long name
without side-effects.
2024-10-14 16:16:13 +00:00
qbisi
9938afb435 options: make extraPostVM mergable. 2024-10-14 16:16:13 +00:00
Felix Uhl
3b2e19fe7c disko cli: fix misleading error message
Found this while trying to repro #523
2024-10-14 10:36:55 +00:00
lassulus
b6215392ec
Merge pull request #828 from Mipsters/patch-1
fixed logo suffix in INDEX.md
2024-10-12 21:10:31 +01:00
Tom
ed8323704a
fixed logo suffix in INDEX.md 2024-10-12 21:22:11 +03:00
Roberto Abdelkader Martínez Pérez
bdbdb725d6 fix: wrong attr path
Fixes a wrong attribute path in the documentation.
2024-10-11 23:01:02 +00:00
Felix Uhl
8c1668edec release: fix wrong push command 2024-10-12 00:49:30 +02:00
Felix Uhl
a361933236 release: reset released flag 2024-10-11 21:02:24 +02:00
Felix Uhl
ff0a471763 release: v1.8.2 2024-10-11 21:02:24 +02:00
Felix Uhl
9788e5d458 release: Fix release script 2024-10-11 20:56:18 +02:00
Felix Uhl
c7ef3964b6 docs: add "latest" tag to flake references
This ensures that people will always use the latest release, not just
whatever the current master is.
2024-10-11 15:14:56 +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
6af4e02b9c Fix mergify deprecation warning 2024-10-11 11:13:39 +02:00
Felix Uhl
4c298a031a Fix issue when config path contains spaces 2024-10-11 08:37:28 +00:00
Felix Uhl
efe7528578 disko cli: remove requirement for leading ./
Fixes #536
2024-10-11 08:37:28 +00:00
dependabot[bot]
d39ee33498 build(deps): bump cachix/install-nix-action from 29 to 30
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 29 to 30.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/v29...v30)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-07 20:52:56 +00:00
Jörg Thalheim
48ebb57785 docs/interactive-vms: simplify usage to just one nix run 2024-10-05 06:23:52 +00:00
Jörg Thalheim
28c5af1e16 interactive-vm: allow to override virtualisation.memorySize
Users might set this value for building images but than need different
values when they run interactive virtual machines.
2024-10-05 06:23:52 +00:00
lassulus
574400001b
Merge pull request #809 from heytcass/patch-1
Grammar update on disko-install.md
2024-10-03 18:46:18 +01:00
Tom Cassady
1b17d96ac5
Grammar update on disko-install.md
Small typo fix going from "than" --> "then"
2024-10-03 13:32:50 -04:00
dependabot[bot]
568727a884 build(deps): bump cachix/install-nix-action from V28 to 29
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from V28 to 29. This release includes the previously tagged commit.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Commits](https://github.com/cachix/install-nix-action/compare/V28...v29)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-02 12:34:21 +00:00
Felix Uhl
fa0c181a83 docs: Fix grammar in offline installer
Fixes #607
2024-10-02 12:20:33 +00:00
Felix Uhl
da8f49246c docs: Fix /boot security hole warning in examples
The alternative would be to do this automatically if format=="vfat" and
mountpoint=="/boot", but it's better to be upfront about this.

Fixes #527
2024-10-02 08:12:14 +00:00
Felix Uhl
6c5ba9ec9d
Merge pull request #806 from iFreilicht/luks-btrfs-raid-example
Luks btrfs raid example
2024-10-01 21:09:40 +02:00
Felix Uhl
b9c99485aa Fix and comment luks-encrypted btrfs raid example 2024-10-01 19:35:27 +02:00
Felix Uhl
ba436edc9d Test luks-encrypted btrfs raid 2024-10-01 19:34:46 +02:00
Sk7Str1pe
c312692abe Create luks-btrfs-raid.nix 2024-10-01 19:34:46 +02:00
Felix Uhl
037be88911
Merge pull request #805 from nix-community/zfs-fix
Fix flaky zfs test
2024-10-01 19:34:16 +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
Jörg Thalheim
fc3ba6985f only set boot.initrd.preDeviceCommands if we boot with script-based stage1 2024-10-01 09:58:39 +02:00
Jörg Thalheim
91cd091669 zpool: fix default value for cache
we want an empty list instead of null
2024-10-01 08:55:41 +02:00
Michael Hoang
b709e1cc33 interactive-vm: override forceImportRoot
Some users will have `boot.zfs.forceImportRoot = false;` in their
configurations which conflicts with `boot.zfs.forceImportAll = true;`,
so we set it to `true` to match.
2024-09-28 13:50:34 +00:00
Jörg Thalheim
67dc29be30
Merge pull request #716 from beviu/fmt-check
Add --check option to formatter in flake
2024-09-26 15:59:51 +02:00
Felix Uhl
72c867c439 Run nix fmt 2024-09-26 15:36:54 +02:00