bandwhich: 0.23.0 -> 0.23.1; move to by-name; nixfmt; useFetchCargoVendor (#356934)
[NixPkgs.git] / nixos / tests / hydra / common.nix
blob0e58e49b1bcdc1d6b42ef8c96e0ad147d8f8fe75
1 { system, ... }:
3   baseConfig =
4     { pkgs, ... }:
5     let
6       trivialJob = pkgs.writeTextDir "trivial.nix" ''
7         { trivial = builtins.derivation {
8             name = "trivial";
9             system = "${system}";
10             builder = "/bin/sh";
11             allowSubstitutes = false;
12             preferLocalBuild = true;
13             args = ["-c" "echo success > $out; exit 0"];
14           };
15         }
16       '';
18       createTrivialProject = pkgs.stdenv.mkDerivation {
19         name = "create-trivial-project";
20         dontUnpack = true;
21         nativeBuildInputs = [ pkgs.makeWrapper ];
22         installPhase = "install -m755 -D ${./create-trivial-project.sh} $out/bin/create-trivial-project.sh";
23         postFixup = ''
24           wrapProgram "$out/bin/create-trivial-project.sh" --prefix PATH ":" ${
25             pkgs.lib.makeBinPath [ pkgs.curl ]
26           } --set EXPR_PATH ${trivialJob}
27         '';
28       };
29     in
30     {
31       virtualisation.memorySize = 2048;
32       time.timeZone = "UTC";
33       environment.systemPackages = [
34         createTrivialProject
35         pkgs.jq
36       ];
37       services.hydra = {
38         enable = true;
39         # Hydra needs those settings to start up, so we add something not harmfull.
40         hydraURL = "example.com";
41         notificationSender = "example@example.com";
42         extraConfig = ''
43           email_notification = 1
44         '';
45       };
46       services.postfix.enable = true;
47       nix.settings.substituters = [ ];
48     };