Commit Graph

1014 Commits

Author SHA1 Message Date
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
K900
9490738be7 nixos/lib/test-driver: add setuptools build dep 2024-01-12 13:58:07 +03:00
Cole Mickens
5a718794d0
nixos/lib/make-squashfs.nix: allow disabling compression 2024-01-07 22:46:20 -06:00
Sandro Jäckel
9fbf82d9cb
systemd-lib: add Install WantedBy section to make units similar to upstream ones
and make them better grepable
2024-01-02 23:09:03 +01:00
github-actions[bot]
b3ceb9c6b7
Merge staging-next into staging 2023-12-26 18:01:24 +00:00
Martin Weinelt
0392a07511
nixos/lib/make-disk-image: Create build products metadata
For hydra to expose built images for direct download, listing the
relevant files in nix-support/hydra-build-products is required.
2023-12-26 16:02:51 +01:00
Sandro Jäckel
e2702f5aee
treewide: don't use python3Minimal where it is not required
Building a python environment with python3Minimal requires hydra
to bootstrap pip and build all packages used in the environment
which would otherwise not be built. This reduces cache re-use and duplicates things.

Also common dependencies normally included in python itself
are not properly checked and can cause hard to debug errors
because everyone just assumes those modules are there.
2023-12-21 02:21:48 +01:00
Jacek Galowicz
66ca9c90e2
Merge pull request #267937 from SomeoneSerge/fix/test-driver-activestate
nixos/lib/test-driver: make wait_for_unit ask for ActiveState only
2023-12-14 06:55:06 +01:00
Philip Taron
bc7a939ced nixos/networkd: add [IPVLAN] and [IPVTAP] configuration options to systemd.netdev files
[IPVLAN](https://www.freedesktop.org/software/systemd/man/latest/systemd.netdev.html#%5BIPVLAN%5D%20Section%20Options)
[IPVTAP](https://www.freedesktop.org/software/systemd/man/latest/systemd.netdev.html#%5BIPVTAP%5D%20Section%20Options)
2023-11-18 08:43:21 +01:00
Someone Serge
392fbc90a8
nixos/lib/test-driver: make wait_for_unit ask for ActiveState only
This is a hotfix for https://github.com/NixOS/nixpkgs/issues/266690,
where `systemctl show $unit` sometimes randomly leaves ActiveState out
2023-11-16 18:25:42 +00:00
Ryan Lahfa
b8218af2e6
Merge pull request #256226 from ElvishJerricco/systemd-stage-1-testing-backdoor 2023-11-10 14:08:07 +01:00
Will Fancher
9a0f523372 systemd-stage-1: Enable backdoor in nixos tests 2023-11-09 17:53:48 -05:00
Will Fancher
c20ad5d379
Merge pull request #266369 from SuperSandro2000/systemd-unit-empty-lines
systemd-lib: cleanup empty lines in unit files
2023-11-09 16:49:11 -05:00