summary refs log tree commit diff
path: root/pkgs/test/nixos-functions/default.nix
blob: bdd5e3c6d8b425724fdad52b6684f51b0cd40d65 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*

This file is a test that makes sure that the `pkgs.nixos` and
`pkgs.testers.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";
      system.stateVersion = lib.trivial.release;
    }).toplevel;

  }
)