Commit Graph

1083 Commits

Author SHA1 Message Date
Masum Reza
e13831335f
treewide: stdenv.is -> stdenv.hostPlatform.is (#356363)
* treewide: stdenv.is -> stdenv.hostPlatform.is

* treewide: nixfmt due to ci error
2024-11-17 16:11:54 +05:30
Jack Wilsdon
2223312e3d nixos/networkd: allow byte values to be integers 2024-11-03 18:26:20 +00:00
Will Fancher
37ee6ba681 Revert "NixOS apply script"
Reverts #344407

This has broken nixos-rebuild switch so that it no longer updates the profile, which has bad consequences including not updating the systemd-boot menu with new generations.
2024-11-01 20:18:09 -04:00
Robert Hensing
7902cea1de nixos: Update documentation to refer to bin/apply 2024-10-30 00:21:21 +01:00
Sandro Jäckel
729a6f3bd7
nixos/lib/testing: remove alias usage 2024-10-26 14:30:45 +02:00
Jörg Thalheim
ef9502a009 nixos/test-driver: fix resource cleanup of vlan/qmp objects
Using __del__ is somewhat unsound resource cleanup in our clase the
logger already closed its logfile and therefor fails with exception
before the rest of the resources can be cleaned up.
2024-10-16 19:46:38 +03:00
Will Fancher
a6e54f566a
nixos/networkd: support systemd-creds in WireGuard (#346964) 2024-10-15 14:31:27 -04:00
Silvan Mosberger
c5cea342ce
lib.oldestSupportedReleaseIsAtLeast: rename from bad name (#347258) 2024-10-09 02:20:39 +02:00
r-vdp
2b224f0e3c
nixos/systemd: allow using writeShellApplication for systemd unit scripts 2024-10-08 12:01:48 +02:00
Robert Hensing
729225e355 treewide: lib.isInOldestRelease -> lib.oldestSupportedReleaseIsAtLeast 2024-10-08 11:14:24 +02:00
James Atkins
42f5ecde9d nixos/networkd: support systemd-creds in WireGuard
systemd 256 supports network.wireguard.* credentials (https://github.com/systemd/systemd/pull/30826).
Check whether PrivateKey / PresharedKey starts with an @, if so it is a credential.
2024-10-06 18:38:40 -05:00
K900
1f9fc918ce treewide: use pkgs.nixos-enter instead of config.system.build.nixos-enter 2024-09-21 16:13:36 +03:00
K900
2bc5aac960 nixos/lib/testing: enable stc by default for installBootLoader VMs 2024-09-12 15:44:02 +03:00
K900
4cfbbb3c1d nixos/tests: don't include switch-to-configuration in DUT by default 2024-09-08 17:04:44 +03:00
Ganga Ram
0c848e9ef0 fix build: sdimage
Increase extra space to 20% to accomodate file system overhead.
Align image size to 1 MiB.

Signed-off-by: Ganga Ram <Ganga.Ram@tii.ae>
2024-08-28 11:32:36 +04:00
Adam Stephens
9277993de4
make-squashfs: add support for generating hydra build products
left default to write the image directly to the store, but enabling hydraBuildProduct
will create $out as a directory
2024-08-17 09:00:43 -04:00
František Hanzlík
8b4cd01f90
nixos/networkd: allow specifying FirewallMark mask 2024-08-01 22:22:01 +02:00
Philip Taron
2b67819d55 nixos-test-driver: avoid top-level with in shell.nix 2024-07-29 19:46:18 +02:00
Will Fancher
6f959a9e96 nixos/make-initrd-ng: dlopen ELF notes 2024-07-21 06:31:42 -04:00
Will Fancher
e6c544270c nixos/make-initrd-ng: Pass contents as JSON 2024-07-21 06:31:42 -04:00
nikstur
d4a80b6d0c systemd: 255.6 -> 256.2 2024-07-21 06:31:37 -04:00
Philip Taron
f56ba38335
make-disk-image.nix: avoid top-level with statement (#327020) 2024-07-19 11:19:19 +02:00
Frédéric Christ
c6f6c28218 nixos/testing: Add ipv6 configuration
This contribution enables a working IPv6 setup by default. This works
analog to the current automatic IPv4 setup.
2024-07-18 10:22:32 +02:00
Jörg Thalheim
d1b9c95fdf
Merge pull request #325284 from trueNAHO/docs-fix-broken-nix-dev-urls
treewide: fix broken `nix.dev` URLs
2024-07-07 17:41:07 +02:00
NAHO
a7cc1dcd68
treewide: fix broken 'nix.dev' URLs 2024-07-07 17:15:35 +02:00
Lin Yinfeng
01543e789c
nixos/utils: support JSON secret files in genJqSecretsReplacementSnippet
genJqReplacementSnippet quotes the content of the secret file in the
output json file, which prevents structured secret, such as a list or
an object, from being used.

This commit adds a `quote = true|false` option to the `{ _secret =
"/path/to/secret"; }` attribute set. `quote = true` treats the
content of /path/to/secret as string, while `quote = false` treats
the content of /path/to/secret as a JSON document.

`quote = true` is the default, maintaining backward compatibility.
2024-07-07 19:22:10 +08:00
Jörg Thalheim
2654628f2c
Merge pull request #319238 from Mic92/digital-ocean
make-disk-image: fix build for systems that use boot.loader.grub.devices
2024-06-23 13:28:50 +02:00
Silvan Mosberger
b3ad661e9f nixos/lib/test-driver: Prevent unnecessary rebuilds
E.g. when only Nix files change
2024-06-14 20:42:16 +02:00
Jörg Thalheim
d0126c0508 make-disk-image: fix build for systems that use boot.loader.grub.devices
config.boot.loader.grub.device is just an alias that gets assigned to config.boot.loader.grub.devices.
If config.boot.loader.grub.device is set to null, it will fail with the following error
as described in https://github.com/nix-community/nixos-generators/issues/339
2024-06-12 08:27:18 +02:00
Jared Baur
b867cc215f
nixos/systemd-networkd: add PREF64 related options 2024-06-09 20:41:32 -07:00
Martin Weinelt
ab897a8c62
nixos/test-driver: fix return value of subtest function
Mypy since version 1.10.0 complains about this:

> test_driver/driver.py:109: error: No return value expected  [return-value]
2024-06-06 01:07:39 +02:00
Franz Pletz
4e1b4397d9
Merge pull request #312472 from Ma27/networkd-option-rename
nixos/networkd: get rid of *Config attributes in lists
2024-05-30 04:06:01 +02:00
Gaetan Lepage
622ccf42c2 nixosTests.nixos-test-driver: fix ruff check 2024-05-23 14:30:23 +02:00
Dawid Dziurla
f8a88fd22c
nixos/test-driver: adjust to ruff changes 2024-05-22 11:29:02 +02:00
nikstur
cf1909ddd0
Merge pull request #301772 from hertrste/junit-xml-prod
nixos/test-driver: Add Junit XML report creation
2024-05-21 15:07:10 +02:00
Maximilian Bosch
c4fd7cf16d
nixos/networkd: get rid of *Config attributes in lists
This patch is about removing `wireguardPeerConfig`,
`dhcpServerStaticLeaseConfig` - a.k.a. the
AbstractSingletonProxyFactoryBean of nixpkgs - and friends.

As a former colleague said

> worst abstraction ever

I second that. I've written enough networkd config for NixOS systems so
far to have a strong dislike. In fact, these don't even make sense:
`netdevs.wireguardPeers._.wireguardPeerConfig` will be rendered into
the key `[WireGuardPeer]` and every key from `wireguardPeerConfig` is in
there. Since it's INI, there's no place where sections on the same level
as wireguardPeerConfig fit into. Hence, get rid of it all.

For the transition, using the old way is still allowed, but gives a
warning. I think we could drop this after one release.

The tests of rosenpass and systemd-networkd-dhcpserver-static-leases
were broken on the rev before, hence they were updated, but are still
not building.
2024-05-20 17:26:42 +02:00
Donovan Glover
4afa9444ae
nixos/testing: fix markdown link in enableOCR description 2024-05-14 21:22:09 -04:00
Stefan Hertrampf
d07866cddc nixos/test-driver: rm global logger
We remove the global rootlog in favor of instantiating the logger as
required in the __init__.py and pass it down as a parameter (of our
AbstractLogger type).
2024-05-07 15:17:17 +02:00
Stefan Hertrampf
303618c7e1 nixos/test-driver: enable XML log selectively
Previously, the XML logging was always present and only created an
output file if a special environment variable was present. We now only
create the XML logger if the environment variable is present, saving us
from logging to XML internally if it is not required.
2024-05-07 15:17:17 +02:00
Stefan Hertrampf
9e8d6bbe24 nixos/test-driver: add junit-xml logger
We add a new logger that allows generating a junit-xml compatible report
listing the subtests used in the nixos integration test. Junit-xml is a
widely used standard for test reports. The report can be used for quick
evaluation of which subtest failed.
2024-05-07 15:17:16 +02:00
Stefan Hertrampf
9d90df51a9 nixos/test-driver: Separate XML and Terminal log
We use the newly AbstractLogger class and separate the XML and Terminal
logging that is currently mixed into one class. We restore the old
behavior by introducing a CompositeLogger that takes care of logging
both to terminal and XML.
2024-05-07 15:17:16 +02:00
Stefan Hertrampf
b505db6f6d nixos/test-driver: add AbstractLogger interface 2024-05-07 15:17:15 +02:00
Jared Baur
38907ef84d
nixos/systemd-lib: fix assertRangeOrOneOf when value is not comparable
We cannot compare non-numerical values to a min or max value in a range.
2024-05-06 10:41:20 -07:00
stove
a7931adab8 nixos/lib/qemu-common: add riscv{32,64}-linux to qemu guest matrix 2024-04-29 14:05:39 +02:00
Florian Klink
5a2d4496d3
Merge pull request #297726 from r-vdp/systemd-unit-names
systemd: add a name option to all systemd units
2024-04-23 12:58:51 +03:00
Stefan Hertrampf
a6160e5763 nixos/test-driver: use function instead of var
Use a proper function to enable serial log printing instead of setting
class member variables directly.
2024-04-22 13:35:25 +02:00
Stefan Hertrampf
c2c525f5bc nixos/test-driver: add junit-xml python package 2024-04-22 13:35:24 +02:00
Stefan Hertrampf
0d015895de nixos/test-driver: separate the subtest log call
We do not use the generic "nested" function but introduce a separate
subtest log call. This will later allow us to track subtests and account
logs to specific subtests.
2024-04-22 13:35:24 +02:00
Ryan Hendrickson
61153af068
Merge pull request #298983 from illustris/mysql
nixos/systemd-lib: fix restart/reloadTriggers when passing paths
2024-04-21 17:45:16 -04:00
illustris
4a9c962aca
nixos/systemd-lib: fix restart/reloadTriggers when passing paths
When passing a path to restartTriggers or reloadTriggers, X-Restart/Reload-Triggers
will get populated by the absolute path of the file on the machine where the
config is evaluated. This patch corrects this behavior.
2024-04-21 09:40:17 +05:30