mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 07:00:43 +00:00
58ff402b40
With this OfBorg and similar tools won't report this derivation as changed every single time.
42 lines
946 B
Nix
42 lines
946 B
Nix
/*
|
|
|
|
This file is a test that makes sure that the `pkgs.nixos` and
|
|
`pkgs.nixosTest` functions work. It's far from a perfect test suite,
|
|
but better than not checking them at all on hydra.
|
|
|
|
To run this test:
|
|
|
|
nixpkgs$ nix-build -A tests.nixos-functions
|
|
|
|
*/
|
|
{ pkgs, lib, stdenv, ... }:
|
|
|
|
let
|
|
dummyVersioning = {
|
|
revision = "test";
|
|
versionSuffix = "test";
|
|
label = "test";
|
|
};
|
|
in lib.optionalAttrs stdenv.hostPlatform.isLinux (
|
|
pkgs.recurseIntoAttrs {
|
|
|
|
nixos-test = (pkgs.nixos {
|
|
system.nixos = dummyVersioning;
|
|
boot.loader.grub.enable = false;
|
|
fileSystems."/".device = "/dev/null";
|
|
}).toplevel;
|
|
|
|
nixosTest-test = pkgs.nixosTest ({ lib, pkgs, ... }: {
|
|
name = "nixosTest-test";
|
|
machine = { pkgs, ... }: {
|
|
system.nixos = dummyVersioning;
|
|
environment.systemPackages = [ pkgs.hello ];
|
|
};
|
|
testScript = ''
|
|
$machine->succeed("hello");
|
|
'';
|
|
});
|
|
|
|
}
|
|
)
|