Commit Graph

1026 Commits

Author SHA1 Message Date
Jacek Galowicz
aaef13b238
Merge pull request #301799 from alyssais/QEMU_OPTS
nixos/test-driver: don't add QEMU_OPTS twice
2024-04-05 14:56:09 +02:00
Alyssa Ross
4491b9ec0d
nixos/test-driver: don't add QEMU_OPTS twice
As the TODO says, this is already included by the script.

If adding a device, including this again here would result in either
two devices being added, or, if they were explicitly named, an error
due to reuse of the name.
2024-04-05 12:30:36 +02:00
K900
7b602cff5c nixos/tests/installer: avoid create_machine, clean up
- use normal VM nodes for target, with some extra trickery
- rename preBootCommands to postBootCommands to match its actual intent
- rename VMs to installer and target, so they're not all called machine
- set platforms on non-UEFI tests properly
- add missing packages for systemd-boot test
- fix initrd secrets leaking into the store and having wrong paths
2024-04-03 16:16:11 +03:00
Philip Taron
ebde306504
nixos/lib, doc: remove references to mdDoc (#300738)
* doc: remove references to mdDoc in nixos/doc/manual/development/option-declarations.section.md

* nixos/lib: remove mdDoc in nixos/lib/make-options-doc/default.nix

* nixos/lib: remove mdDoc in nixos/lib/systemd-types.nix

* nixos/lib: remove mdDoc in nixos/lib/systemd-unit-options.nix

* nixos/lib: remove mdDoc in nixos/lib/testing/driver.nix

* nixos/lib: remove mdDoc in nixos/lib/testing/interactive.nix

* nixos/lib: remove mdDoc in nixos/lib/testing/meta.nix

* nixos/lib: remove mdDoc in nixos/lib/testing/name.nix

* nixos/lib: remove mdDoc in nixos/lib/testing/network.nix

* nixos/lib: remove mdDoc in nixos/lib/testing/nodes.nix

* nixos/lib: remove mdDoc in nixos/lib/testing/run.nix

* nixos/lib: remove mdDoc in nixos/lib/testing/testScript.nix
2024-04-01 16:58:23 -07:00
Florian Klink
27968a064c
Merge pull request #299652 from philiptaron/issue-208242/nixos/lib/systemd
Avoid top-level `with ...;` in `nixos/lib/systemd*`
2024-04-01 17:19:15 +02:00
Silvan Mosberger
1f7ac8f58b
Merge pull request #296384 from pennae/remove-docbook-docs-support
nixos/docs: remove docbook support machinery
2024-03-28 18:03:31 +01:00
pennae
02aff756c3 nixos/doc: remove optionsDocBook
these were deprecated in 23.11 and slated for removal in 24.05. 24.05 is
soon enough, so we should probably make good on this promise.
2024-03-28 17:21:37 +01:00
Philip Taron
546fc67242
Avoid top-level with ...; in nixos/lib/utils.nix 2024-03-27 22:04:17 -07:00
Philip Taron
ad920b32c2
Avoid top-level with ...; in nixos/lib/systemd-unit-options.nix 2024-03-27 22:00:34 -07:00
Philip Taron
7d130cf752
Avoid top-level with ...; in nixos/lib/systemd-types.nix 2024-03-27 21:56:52 -07:00
Philip Taron
d509d28475
Avoid top-level with ...; in nixos/lib/systemd-network-units.nix 2024-03-27 21:43:22 -07:00
Philip Taron
f290c5901b
Avoid top-level with ...; in nixos/lib/systemd-lib.nix 2024-03-27 21:42:17 -07:00
Will Fancher
7935db1456 nixos/tests: Remove unnecesary wait from initrdBackdoor 2024-03-26 23:40:05 -04:00
Martin Weinelt
a4b6e457b8
nixos/lib: Support derivations in escapeSystemdExecArg
They can be transformed into their outpath string, which is useful for
config generators.
2024-03-23 15:59:50 +01:00
Johannes Kirschbauer
9a21db7be8
doc: write improved documentation for nixosOptionsDoc (#295279)
* doc: write improved documentation for nixosOptionsDoc

* Apply suggestions from @infinisil

Co-authored-by: Silvan Mosberger <github@infinisil.com>

* doc: minor fixup

---------

Co-authored-by: Silvan Mosberger <github@infinisil.com>
2024-03-21 16:07:18 +01:00
Will Fancher
486e837cbe
Merge pull request #293710 from B4dM4n/networkd-policy-rule-port-range
nixos/networkd: allow RoutingPolicyRule port ranges
2024-03-17 12:36:30 -07:00
K900
77536af43b nixos/iso-image: extremely cursed performance optimization for Hydra
Right now the worst case chain of events for building an ISO on Hydra is

    - copy everything to squashfs builder
    - run squashfs builder
    - download squashfs from builder
    - compress squashfs
    - upload squashfs to S3
    - copy squashfs to ISO builder
    - run ISO builder
    - download ISO from builder
    - compress ISO
    - upload ISO to S3

This inlines the squashfs build into the ISO build, which makes it

    - copy everything to ISO builder
    - run ISO builder
    - download ISO from builder
    - compress ISO
    - upload ISO to S3

Which should reduce queue runner load by $alot per ISO, which we have four of on small channels
(one release, one test per arch) and a lot more than four of on large channels (with various desktops)
2024-03-12 15:41:59 +03:00
K900
7764fc5335 nixos/lib/test-driver: fix mypy errors after staging-next merge 2024-03-08 15:33:48 +03:00
Fabian Möller
f753e58e6e
nixos/networkd: allow RoutingPolicyRule port ranges
Linux and Systemd allow port ranges to be used in routing policy rules.

https://www.freedesktop.org/software/systemd/man/latest/systemd.network.html#SourcePort=
2024-03-06 09:11:54 +01:00
Gabriella Gonzalez
b8698cd8d6
macOS support for NixOS tests (#282401)
Closes #193336
Closes #261694
Related to #108984

The goal here was to get the following flake to build and run on
`aarch64-darwin`:

```nix
{ inputs.nixpkgs.url = <this branch>;

  outputs = { nixpkgs, ... }: {
    checks.aarch64-darwin.default =
      nixpkgs.legacyPackages.aarch64-darwin.nixosTest {
        name = "test";

        nodes.machine = { };

        testScript = "";
      };
  };
}
```

… and after this change it does.  There's no longer a need for the
user to set `nodes.*.nixpkgs.pkgs` or
`nodes.*.virtualisation.host.pkgs` as the correct values are inferred
from the host system.
2024-03-02 06:33:14 +01:00
Arian van Putten
b75a29cb6c nixos/lib/make-disk-image.nix: fix systemd-boot-builder clobbering /homeless-shelter
systemd-boot-builder.py calls nix-env --list-generations which creates
$HOME/.nix-defexpr/channels/nixos if it doesn't exist. This would cause a folder
/homeless-shelter to show up in the final image which in turn breaks nix builds
in the target image if sandboxing is turned off (as /homeless-shelter is never
allowed to exist).
2024-03-01 12:52:48 +01:00
K900
e758ca61fe nixos/lib/test-driver: make the warning message more noticeable 2024-03-01 13:20:09 +03:00
Franz Pletz
317a383090
Merge pull request #292189 from nagisa/fixes-systemd-upheldBy-propagation 2024-02-29 02:08:56 +01:00
Simonas Kazlauskas
34c5cc74a1 systemd: fix propagation of upheldBy option to units 2024-02-29 02:01:24 +02:00
K900
d53c203739
Merge pull request #291544 from K900/ovmf-oof
nixos/tests: drop LegacyStartCommand
2024-02-28 09:32:26 +03:00
K900
bdacdc46e4 nixos/lib/test-driver: provide legacy path for create_machine({"startCommand": "..."}) 2024-02-28 09:32:11 +03:00
Will Fancher
f5622df470
Merge pull request #290946 from ju1m/systemd-option-list
nixos/systemd: merge unit options as lists when at least one value is a list
2024-02-27 20:49:39 -05:00
Will Fancher
a587a6a357
Merge pull request #285401 from sdht0/systemd-boot-xbootldr
nixos/systemd-boot: Add support for an XBOOTLDR partition
2024-02-27 20:35:03 -05:00
K900
d93db9066a nixos/lib/testing: remove yet another source of unnecessary test rebuilds 2024-02-27 23:35:05 +03:00
K900
423098c284 nixos/lib/test-driver: drop LegacyStartCommand, clean up create_machine API
We can finally do this now that it's no longer used.
2024-02-27 23:15:59 +03:00
K900
d9a37adc04 lib/test-driver: don't swallow qemu stderr 2024-02-27 23:15:58 +03:00
K900
bde7471aa2 nixos/lib/testing: remove another source of unnecessary test rebuilds 2024-02-27 18:00:58 +03:00
Siddhartha
04beb0aea2 nixos/lib/make-disk-image: Add ability to setup an XBOOTLDR partition 2024-02-26 21:51:41 -05:00
Adam C. Stephens
af810fc67e
Merge pull request #284874 from shlevy/ovmf-ms
Enable MS-compatible secure boot with OVMF
2024-02-25 22:34:05 -05:00
Julien Moutinho
7d0c812963 nixos/systemd: merge unit options as lists when at least one value is a list 2024-02-25 01:20:29 +01:00
Michael Schneider
fe4edb712c nixos/testDriver: remove pinned mypy python version 2024-02-23 02:36:58 +00:00
Shea Levy
9188bb5186
OVMF: Add test with secure boot enabled
Co-authored-by: Arthur Gautier <arthur.gautier@arista.com>
2024-02-15 12:13:05 -05:00
Silvan Mosberger
1cd71881f2 nixos/systemd: Support notify-reload service Type
Support for this was added in systemd 253:
https://github.com/systemd/systemd/releases/tag/v253
2024-02-14 17:52:13 +01:00
Simonas Kazlauskas
fd5664871f review 2024-02-10 22:25:24 +02:00
Simonas Kazlauskas
74eeb75af1 systemd: add support for upholds and upheldBy 2024-02-10 13:48:40 +02:00
Yureka
c94d63a527
nixos/utils: fix stack overflow in genJqReplacementSnippet (#284027)
When the input contains derivations, don't attempt to recurse into them
2024-01-30 11:00:08 +01:00
K900
07e7fcc46f nixos/test-driver: black 2024-01-26 16:27:53 +03:00
Jacek Galowicz
d6318f4a86
Merge pull request #262772 from RaitoBezarius/qemu-vm/wait-for-event
nixos/lib/test-driver: add `wait_for_qmp_event`
2024-01-26 08:27:06 +01:00
Raito Bezarius
1196ae6e6b nixos/lib/test-driver: add wait_for_qmp_event
Adds a function to wait for a new QMP event with a model filter
so that you can expect specific type of events with specific payloads.

e.g. a guest-reset-induced shutdown event.
2024-01-25 20:50:20 +01:00
Robert Hensing
e0000983db
Merge pull request #279170 from SuperSandro2000/nixos-repl-lib
nixos-rebuild: add lib to repl to make debugging even easier
2024-01-19 12:29:04 +01:00
K900
3d6a5ad604 systemd-lib: fix automount generation after 9fbf82d9cb
This one got missed in the refactor.
2024-01-18 08:33:46 +03:00
Will Fancher
59ba511744
Merge pull request #266370 from SuperSandro2000/systemd-install-wantedby
systemd-lib: add Install WantedBy section to make units similar to upstream ones
2024-01-17 13:04:03 -05:00
Robert Hensing
8e934650ce nixos: Expose lib attribute on configuration for repl 2024-01-15 00:28:07 +01:00
Ryan Lahfa
b5a944511d
Merge pull request #256709 from colemickens/make-squashfs-skip-compression
nixos/lib/make-squashfs.nix: allow disabling compression
2024-01-13 20:23:25 +01:00
Ryan Lahfa
f520eb3f0c
Merge pull request #263658 from siriobalmelli-foss/sb/zfs-image
openstack-image-zfs and make-single-disk-zfs-image: optionally specify qemu instance memory
2024-01-12 20:25:26 +01:00