mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-14 13:39:15 +03:00
nixos/all-tests.nix: Add readOnlyPkgs module
This commit is contained in:
parent
cd358fe24e
commit
b213791e7e
2 changed files with 22 additions and 0 deletions
|
@ -17,6 +17,7 @@ let
|
||||||
virtualisation.qemu.package = testModuleArgs.config.qemu.package;
|
virtualisation.qemu.package = testModuleArgs.config.qemu.package;
|
||||||
})
|
})
|
||||||
({
|
({
|
||||||
|
key = "nodes.nix-pkgs";
|
||||||
config = {
|
config = {
|
||||||
# Ensure we do not use aliases. Ideally this is only set
|
# Ensure we do not use aliases. Ideally this is only set
|
||||||
# when the test framework is used by Nixpkgs NixOS tests.
|
# when the test framework is used by Nixpkgs NixOS tests.
|
||||||
|
|
|
@ -65,6 +65,27 @@ let
|
||||||
runTestOn
|
runTestOn
|
||||||
;
|
;
|
||||||
|
|
||||||
|
# Using a single instance of nixpkgs makes test evaluation faster.
|
||||||
|
# To make sure we don't accidentally depend on a modified pkgs, we make the
|
||||||
|
# related options read-only. We need to test the right configuration.
|
||||||
|
#
|
||||||
|
# If your service depends on a nixpkgs setting, first try to avoid that, but
|
||||||
|
# otherwise, you can remove the readOnlyPkgs import and test your service as
|
||||||
|
# usual.
|
||||||
|
readOnlyPkgs =
|
||||||
|
# TODO: We currently accept this for nixosTests, so that the `pkgs` argument
|
||||||
|
# is consistent with `pkgs` in `pkgs.nixosTests`. Can we reinitialize
|
||||||
|
# it with `allowAliases = false`?
|
||||||
|
# warnIf pkgs.config.allowAliases "nixosTests: pkgs includes aliases."
|
||||||
|
{
|
||||||
|
_class = "nixosTest";
|
||||||
|
defaults = {
|
||||||
|
nixpkgs.pkgs = pkgs;
|
||||||
|
imports = [ ../modules/misc/nixpkgs/read-only.nix ];
|
||||||
|
disabledModules = [{ key = "nodes.nix-pkgs"; }];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
in {
|
in {
|
||||||
|
|
||||||
# Testing the test driver
|
# Testing the test driver
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue