Commit Graph

17 Commits

Author SHA1 Message Date
Silvan Mosberger
4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00
Yueh-Shun Li
97a7ce7aa6 nixosTests.nixops: remove dead code from Nix expression 2024-03-19 05:30:53 +08:00
Robert Hensing
76fc2db1f5 nixosTests.nixops_unstable: Set memorySize to 2G
Give the evaluator some breathing room.
2024-03-06 22:47:23 +01:00
Robert Hensing
663b3d4be7 nixops_unstable*: Make withPlugins.*.tests.nixos behave correctly 2024-03-06 22:47:22 +01:00
Sergei Trofimovich
8f809e4630 nixops_unstable: fix tests eval with allowAliases = false;
Without the change `tests` eval fails as:

    $ nix build --no-link -f. nixops_unstable.tests --arg config '{ allowAliases = false; }'
    error:
       error: attribute 'nixosTest' missing
           22|   testLegacyNetwork = { nixopsPkg, ... }: pkgs.nixosTest ({
             |                                           ^
           23|     name = "nixops-legacy-network";
       Did you mean nixosTests?

The alias is defined as:

    pkgs/top-level/aliases.nix:  nixosTest = testers.nixosTest; # Added 2022-05-05
2023-12-31 20:45:39 +00:00
Sergei Trofimovich
51d29a4759 nixosTests.nixops: Revert "tests.nixops: fix broken eval" to fix eval
This reverts commit c946245c7a.

Without the change test eval fail at top level of `nixpkgs` as:

    $ nix build --no-link -f. nixosTests.nixops
       error: function 'anonymous lambda' called without required argument 'testers'
2023-12-28 00:37:57 +00:00
Adam Joseph
c946245c7a tests.nixops: fix broken eval 2023-11-29 09:44:46 +01:00
Robert Hensing
4b51c5360f nixops_unstable: Fix tests attribute
The .overrideAttrs part is ok now, but a "passthru' workaround is
necessary now. See https://github.com/NixOS/nixpkgs/pull/247520
2023-08-09 15:47:13 +02:00
Robert Hensing
816b884b5c nixosTests.nixops.unstable.legacyNetwork: Use system.includeBuildDependencies 2023-03-15 13:37:59 +01:00
Robert Hensing
e260018f9c nixos/tests: Add names 2022-09-24 17:38:09 +01:00
Robert Hensing
04c9dd89bf nixos/tests/nixops: Remove sanitizeDerivationName 2022-03-30 10:30:20 +02:00
Robert Hensing
d2c3410efd nixopsUnstable -> nixops_unstable
Conform to https://nixos.org/manual/nixpkgs/unstable/#sec-package-naming
2022-03-03 12:50:15 +01:00
polykernel
4a9d9928dc nixos/nix-daemon: use structural settings
The `nix.*` options, apart from options for setting up the
daemon itself, currently provide a lot of setting mappings
for the Nix daemon configuration. The scope of the mapping yields
convience, but the line where an option is considered essential
is blurry. For instance, the `extra-sandbox-paths` mapping is
provided without its primary consumer, and the corresponding
`sandbox-paths` option is also not mapped.

The current system increases the maintenance burden as maintainers have to
closely follow upstream changes. In this case, there are two state versions
of Nix which have to be maintained collectively, with different options
avaliable.

This commit aims to following the standard outlined in RFC 42[1] to
implement a structural setting pattern. The Nix configuration is encoded
at its core as key-value pairs which maps nicely to attribute sets, making
it feasible to express in the Nix language itself. Some existing options are
kept such as `buildMachines` and `registry` which present a simplified interface
to managing the respective settings. The interface is exposed as `nix.settings`.

Legacy configurations are mapped to their corresponding options under `nix.settings`
for backwards compatibility.

Various options settings in other nixos modules and relevant tests have been
updated to use structural setting for consistency.

The generation and validation of the configration file has been modified to
use `writeTextFile` instead of `runCommand` for clarity. Note that validation
is now mandatory as strict checking of options has been pushed down to the
derivation level due to freeformType consuming unmatched options. Furthermore,
validation can not occur when cross-compiling due to current limitations.

A new option `publicHostKey` was added to the `buildMachines`
submodule corresponding to the base64 encoded public host key settings
exposed in the builder syntax. The build machine generation was subsequently
rewritten to use `concatStringsSep` for better performance by grouping
concatenations.

[1] - https://github.com/NixOS/rfcs/blob/master/rfcs/0042-config-option.md
2022-01-26 21:04:50 -05:00
Artturin
54ece050b8 nixos/qemu-vm: default memorySize 384 -> 1024
the default hasn't been changed since 2009
this can improve our test performances

nixos/tests: remove explicit memorySize <1024

1024MiB is now the default
2021-11-21 17:27:58 +02:00
Robert Hensing
739c51ae4e nixosTests: Redirect stdout to stderr when detaching
Avoids blocking on stdout.
2021-11-05 02:41:26 +01:00
Robert Hensing
78cf2dda33 nixosTests.nixops: Fix deprecation warning 2021-10-31 13:36:14 +01:00
Robert Hensing
c64881b6da nixopsUnstable: Add test 2021-10-18 12:07:01 +02:00