flake.nix improvements

[?]
Sep 17, 2019, 3:25 PM
R5V57UKMZT6BWBQJHSAMCOLD4M6VEF4PQNZWBM5HHTYQQD6QIN2AC

Dependencies

  • [2] CLL3LBCD services.hydra -> services.hydra-dev
  • [3] GIBXI3X2 preHook -> shellHook
  • [4] 3CSPTBW5 Fix perl search path; avoid reference to build path (#471)
  • [5] LVTCDZTW Don't rely on ${LOGNAME:-foo} evaluating to a string
  • [6] EQ3F427Z also add CatalystXRoleApplicator
  • [7] LXDOBUVS Fix Linux build on Darwin
  • [8] ANJBFPBE Added the InfluxDBNotification plugin including a NixOS test
  • [9] JGWFBGDI Update flake.nix
  • [10] WOYOIGB7 Disable 32-bit builds again
  • [11] ICYJNJWH Revert "Move build logic for the core hydra package into its own default.nix."
  • [12] SAPEZKXH move file and add a basic README
  • [13] R6O64PAE Use a nicer version string
  • [14] DWQCLOPQ Tweaks for nix-shell
  • [15] J5LTAHYV Update flake.nix
  • [16] TEGLW4X3 * hydra/release.nix: remove supportOldDBs
  • [17] FV2M6MOT hydra: use autoconf/-make
  • [18] NIQ2WDFP keep build directory
  • [19] IZYR3KTL release.nix: Get rid of the "system" argument
  • [20] T4LLYESZ * Nix expression for building Hydra.
  • [21] D3MDJONY
  • [22] 55QLDPQD Use hydra-init / hydra-create-user in the tests
  • [23] ZXVPPARR Cleanup
  • [24] 2GYW62QS Allow running on i686-linux
  • [25] ABQZP7BB release.nix: Do not rely on currentSystem
  • [26] UHMUHQMU hydra: fix tarball build, add pre suffix to tarballs
  • [27] RJ5EREYU hydra: add bazaar to path
  • [28] 3PNG7NIB Remove trailing whitespace
  • [29] YWM3WYJW test.api: use Hydra perl dependencies to run `api-test.pl`
  • [30] HAJZXVXR Use nixFlakes in devShell
  • [31] IE6AMEHD fix hydra build on nixpkgs master
  • [32] GBCPEGYC Add a .gitignore
  • [33] LOHWNXEJ Cleanup
  • [34] WDNDBFSG 32-bit qemu can only do 2047 MB
  • [35] Z5OWQ4KZ Check Nix version
  • [36] P33UMMOO Use nixUnstable
  • [37] U2BNO3C5 hydra: fix build job
  • [38] IS22DF36 Handle building from a dirty Git tree
  • [39] 34UH6B6L Build against the bleeding edge of Nix
  • [40] XWNMTW6P Drop building on i686-linux
  • [41] ZYEFL36Q Ported/merged properties from the TUD configuration's hydra-module
  • [42] JUQJHSYJ release.nix: Add `--with-docbook-xsl' to the configure flags for `tarball'.
  • [43] C7CXMZ66 hydra: do not perform git clone every time. in stead work on local clone and pull
  • [44] X7IAG7JT Simplify running nix-shell
  • [45] TTZ26BJQ Unify Hydra's NixOS module with the one used for hydra.nixos.org
  • [46] ZGBU7H7P * Pass nixUnstable to the tarball build.
  • [47] LCRBIWH3 Fix building on Nixpkgs 17.09
  • [48] SFMN6AFQ * Include a license.
  • [49] G7MH6KS7 Add boost dependency
  • [50] UGA45FNC Add a plugin for backing up builds in s3
  • [51] FGI75W53 move nix-prefetch-* into tarball
  • [52] 7EYLYIJR For nix-shell, set some more variables in preHook
  • [53] QK2OXCKP hydra/release.nix: move manual to tarball build, restore version in store path for tarball build
  • [54] OEKXEMU2 hydra: Change the `tarball' job to use `--with-nix'.
  • [55] NVMDS7GE Add README.md
  • [56] F6LZSPNC Give services.hydra.package a reasonable default
  • [57] GUOCMPZ2 Use Nix 2.0 and default GCC
  • [58] FJ5H26J6 Fix building against nix master
  • [59] CCPSI3TP Add flake.nix
  • [60] HPIJ35SG
  • [61] X27GNHDV * Basic job info in the database.
  • [62] NDJ6PZB7 * Fix symbol to look for.
  • [63] 6A6CZ7SC draft manual
  • [64] GX5R7OKF Doh
  • [65] VPAUFJTI Use PostgreSQL 9.5
  • [66] QPDG4NEU release.nix: Use fetchGit to get Nixpkgs
  • [67] 6CZHII3Q Use <...> syntax
  • [68] RRUSDIBL Add a job for the manual
  • [69] GGWH5GY7 Remove unused dependency on aws-sdk-cpp
  • [70] AVGER75N release: bump to 19.03
  • [71] ZL4LHHZF Remove empty files
  • [72] 2IGIDHNA Replace shell.nix with a flake devShell attribute
  • [73] 5QYMALGU Fix Perl error in tests.api
  • [74] VM3TQZ65 * hydra: make manual.pdf
  • [75] JN7Y4DC2 Add hydra status dd timeboard expression
  • [76] BAUP4PCK inNixShell considered harmful
  • [77] KMQAEXZ2 Build using the nix flake
  • [78] PMDWFZHW hydra-module.nix: Fix setting the logo
  • [79] BGMBEXS6 Gradually increase maxHeapSize
  • [80] 4Y2EDQEG Add some flake checks
  • [81] G2ZB6464 first test, not yet in buildprocess
  • [82] WGDX4QRI Adjust to the NixOS/Nixpkgs merge
  • [83] 7XOH2DGH hydra-module.nix: Give types to options
  • [84] A3A2O37I Work around 9P corruption on 32-bit
  • [85] UBPWXGKF Move build logic for the core hydra package into its own default.nix.
  • [86] Y2BFYLLK * Install the SQL schemata in $out/share/hydra/sql.
  • [87] DO432JDJ * Build Hydra with the Nix Perl bindings.
  • [88] CLXEECMF * Start putting build results in a database.
  • [89] 6K5PBUUN Use buildEnv to combine Hydra's Perl dependencies
  • [90] WQ2VQ7H3 Use hydra-module.nix in the tests
  • [91] F6IBTEIB Disable the S3 backup test
  • [92] LZVO64YG Merge in the first bits of the API work
  • [93] 7C6HSXUQ * Start of a regression test for Hydra.
  • [94] YQWH4POV * Simplify.
  • [95] Q3VTDUSQ Fix the API test
  • [96] F3GR3UC5 * Actually, include jquery and tablesorter in the source tarball.
  • [97] SAFVRDTK * Put Hydra's dependencies so that they can easily be installed in a

Change contents

  • file deletion: release.nix (----------)
    [10.2][10.1856:1891](),[10.1891][10.1:1]()
    { hydraSrc ? builtins.fetchGit ./.
    , nixpkgs ? builtins.fetchGit { url = https://github.com/NixOS/nixpkgs-channels.git; ref = "nixos-19.03-small"; }
    , officialRelease ? false
    }:
    let
    genAttrs' = genAttrs [ "x86_64-linux" /* "i686-linux" */ ];
    hydraServer = hydraPkg:
    { config, pkgs, ... }:
    { imports = [ ./hydra-module.nix ];
    virtualisation.memorySize = 1024;
    services.hydra-dev.enable = true;
    services.hydra-dev.package = hydraPkg;
    services.hydra-dev.hydraURL = "http://hydra.example.org";
    services.hydra-dev.notificationSender = "admin@hydra.example.org";
    services.postgresql.enable = true;
    services.postgresql.package = pkgs.postgresql95;
    environment.systemPackages = [ pkgs.perlPackages.LWP pkgs.perlPackages.JSON ];
    };
    # FIXME: use commit date.
    version = builtins.readFile ./version + "." + toString hydraSrc.revCount or 0 + "." + hydraSrc.shortRev or "0000000";
    in
    rec {
    build = genAttrs' (system:
    let pkgs = import nixpkgs { inherit system; }; in
    let
    perlDeps = buildEnv {
    name = "hydra-perl-deps";
    paths = with perlPackages;
    [ ModulePluggable
    CatalystActionREST
    CatalystAuthenticationStoreDBIxClass
    CatalystDevel
    CatalystDispatchTypeRegex
    CatalystPluginAccessLog
    CatalystPluginAuthorizationRoles
    CatalystPluginCaptcha
    CatalystPluginSessionStateCookie
    CatalystPluginSessionStoreFastMmap
    CatalystPluginStackTrace
    CatalystPluginUnicodeEncoding
    CatalystTraitForRequestProxyBase
    CatalystViewDownload
    CatalystViewJSON
    CatalystViewTT
    CatalystXScriptServerStarman
    CryptRandPasswd
    DBDPg
    DBDSQLite
    DataDump
    DateTime
    DigestSHA1
    EmailMIME
    EmailSender
    FileSlurp
    IOCompress
    IPCRun
    JSONXS
    LWP
    LWPProtocolHttps
    NetAmazonS3
    NetStatsd
    PadWalker
    Readonly
    SQLSplitStatement
    SetScalar
    Starman
    SysHostnameLong
    TestMore
    TextDiff
    TextTable
    XMLSimple
    nix
    nix.perl-bindings
    git
    boehmgc
    ];
    };
    in
    releaseTools.nixBuild {
    name = "hydra-${version}";
    src = if shell then null else hydraSrc;
    buildInputs =
    [ makeWrapper autoconf automake libtool unzip nukeReferences pkgconfig sqlite libpqxx
    gitAndTools.topGit mercurial darcs subversion bazaar openssl bzip2 libxslt
    guile # optional, for Guile + Guix support
    perlDeps perl nix
    postgresql95 # for running the tests
    boost
    nlohmann_json
    ];
    hydraPath = lib.makeBinPath (
    [ sqlite subversion openssh nix coreutils findutils pixz
    gzip bzip2 lzma gnutar unzip git gitAndTools.topGit mercurial darcs gnused bazaar
    ] ++ lib.optionals stdenv.isLinux [ rpm dpkg cdrkit ] );
    postUnpack = optionalString (!shell) ''
    # Clean up when building from a working tree.
    (cd $sourceRoot && (git ls-files -o --directory | xargs -r rm -rfv)) || true
    '';
    configureFlags = [ "--with-docbook-xsl=${docbook_xsl}/xml/xsl/docbook" ];
    shellHook = ''
    PATH=$(pwd)/src/hydra-evaluator:$(pwd)/src/script:$(pwd)/src/hydra-eval-jobs:$(pwd)/src/hydra-queue-runner:$PATH
    ${lib.optionalString shell "PERL5LIB=$(pwd)/src/lib:$PERL5LIB"}
    '';
    preConfigure = "autoreconf -vfi";
    enableParallelBuilding = true;
    preCheck = ''
    patchShebangs .
    export LOGNAME=''${LOGNAME:-foo}
    '';
    postInstall = ''
    mkdir -p $out/nix-support
    for i in $out/bin/*; do
    read -n 4 chars < $i
    if [[ $chars =~ ELF ]]; then continue; fi
    wrapProgram $i \
    --prefix PERL5LIB ':' $out/libexec/hydra/lib:$PERL5LIB \
    --prefix PATH ':' $out/bin:$hydraPath \
    --set HYDRA_RELEASE ${version} \
    --set HYDRA_HOME $out/libexec/hydra \
    --set NIX_RELEASE ${nix.name or "unknown"}
    done
    ''; # */
    dontStrip = true;
    meta.description = "Build of Hydra on ${system}";
    passthru.perlDeps = perlDeps;
    });
    manual = pkgs.runCommand "hydra-manual-${version}"
    { build = build.x86_64-linux;
    }
    ''
    mkdir -p $out/share
    cp -prvd $build/share/doc $out/share/
    mkdir $out/nix-support
    echo "doc manual $out/share/doc/hydra" >> $out/nix-support/hydra-build-products
    '';
    tests.install = genAttrs' (system:
    with import (nixpkgs + "/nixos/lib/testing.nix") { inherit system; };
    simpleTest {
    machine = hydraServer build.${system};
    testScript =
    ''
    $machine->waitForJob("hydra-init");
    $machine->waitForJob("hydra-server");
    $machine->waitForJob("hydra-evaluator");
    $machine->waitForJob("hydra-queue-runner");
    $machine->waitForOpenPort("3000");
    '';
    });
    tests.api = genAttrs' (system:
    with import (nixpkgs + "/nixos/lib/testing.nix") { inherit system; };
    simpleTest {
    machine = hydraServer build.${system};
    testScript =
    ''
    $machine->waitForJob("hydra-init");
    # Create an admin account and some other state.
    $machine->succeed
    ( "su - hydra -c \"hydra-create-user root --email-address 'alice\@example.org' --password foobar --role admin\""
    , "mkdir /run/jobset /tmp/nix"
    , "chmod 755 /run/jobset /tmp/nix"
    , "cp ${./tests/api-test.nix} /run/jobset/default.nix"
    , "chmod 644 /run/jobset/default.nix"
    , "chown -R hydra /run/jobset /tmp/nix"
    );
    $machine->succeed("systemctl stop hydra-evaluator hydra-queue-runner");
    $machine->waitForJob("hydra-server");
    $machine->waitForOpenPort("3000");
    # Run the API tests.
    $machine->mustSucceed("su - hydra -c 'perl -I ${build.${system}.perlDeps}/lib/perl5/site_perl ${./tests/api-test.pl}' >&2");
    '';
    });
    tests.notifications = genAttrs' (system:
    with import (nixpkgs + "/nixos/lib/testing.nix") { inherit system; };
    simpleTest {
    machine = { pkgs, ... }: {
    imports = [ (hydraServer build.${system}) ];
    services.hydra-dev.extraConfig = ''
    <influxdb>
    url = http://127.0.0.1:8086
    db = hydra
    </influxdb>
    '';
    });
    tests.s3backup = genAttrs' (system:
    with import (nixpkgs + "/nixos/lib/testing.nix") { inherit system; };
    let hydra = build.${system}
    simpleTest {
    machine =
    { config, pkgs, ... }:
    { services.postgresql.enable = true;
    services.postgresql.package = pkgs.postgresql95;
    environment.systemPackages = [ hydra pkgs.rubyLibs.fakes3 ];
    virtualisation.memorySize = 2047;
    boot.kernelPackages = pkgs.linuxPackages_3_10;
    virtualisation.writableStore = true;
    networking.extraHosts = ''
    127.0.0.1 hydra.s3.amazonaws.com
    '';
    };
    testScript =
    ''
    $machine->waitForJob("postgresql");
    # Initialise the database and the state.
    $machine->succeed
    ( "createdb -O root hydra"
    , "psql hydra -f ${hydra}/libexec/hydra/sql/hydra-postgresql.sql"
    , "mkdir /var/lib/hydra"
    , "mkdir /tmp/jobs"
    , "cp ${./tests/s3-backup-test.pl} /tmp/s3-backup-test.pl"
    , "cp ${./tests/api-test.nix} /tmp/jobs/default.nix"
    );
    # start fakes3
    $machine->succeed("fakes3 --root /tmp/s3 --port 80 &>/dev/null &");
    $machine->waitForOpenPort("80");
    $machine->succeed("cd /tmp && LOGNAME=root AWS_ACCESS_KEY_ID=foo AWS_SECRET_ACCESS_KEY=bar HYDRA_DBI='dbi:Pg:dbname=hydra;user=root;' HYDRA_CONFIG=${./tests/s3-backup-test.config} perl -I ${hydra}/libexec/hydra/lib -I ${hydra.perlDeps}/lib/perl5/site_perl ./s3-backup-test.pl >&2");
    '';
    });
    */
    /*
    services.influxdb.enable = true;
    };
    testScript = ''
    $machine->waitForJob("hydra-init");
    # Create an admin account and some other state.
    $machine->succeed
    ( "su - hydra -c \"hydra-create-user root --email-address 'alice\@example.org' --password foobar --role admin\""
    , "mkdir /run/jobset"
    , "chmod 755 /run/jobset"
    , "cp ${./tests/api-test.nix} /run/jobset/default.nix"
    , "chmod 644 /run/jobset/default.nix"
    , "chown -R hydra /run/jobset"
    );
    # Wait until InfluxDB can receive web requests
    $machine->waitForJob("influxdb");
    $machine->waitForOpenPort("8086");
    # Create an InfluxDB database where hydra will write to
    $machine->succeed(
    "curl -XPOST 'http://127.0.0.1:8086/query' \\
    --data-urlencode 'q=CREATE DATABASE hydra'");
    # Wait until hydra-server can receive HTTP requests
    $machine->waitForJob("hydra-server");
    $machine->waitForOpenPort("3000");
    # Setup the project and jobset
    $machine->mustSucceed(
    "su - hydra -c 'perl -I ${build.${system}.perlDeps}/lib/perl5/site_perl ${./tests/setup-notifications-jobset.pl}' >&2");
    # Wait until hydra has build the job and
    # the InfluxDBNotification plugin uploaded its notification to InfluxDB
    $machine->waitUntilSucceeds(
    "curl -s -H 'Accept: application/csv' \\
    -G 'http://127.0.0.1:8086/query?db=hydra' \\
    --data-urlencode 'q=SELECT * FROM hydra_build_status' | grep success");
    '';
    let dbi = "dbi:Pg:dbname=hydra;user=root;"; in
    }
    $machine->succeed("curl --fail http://localhost:3000/");
    NIX_LDFLAGS = [ "-lpthread" ];
    JSON
    JSONAny
    CatalystXRoleApplicator
    with pkgs;
    # The following is to work around the following error from hydra-server:
    # [error] Caught exception in engine "Cannot determine local time zone"
    time.timeZone = "UTC";
    nix = {
    # The following is to work around: https://github.com/NixOS/hydra/pull/432
    buildMachines = [
    { hostName = "localhost";
    system = "x86_64-linux";
    }
    ];
    # Without this nix tries to fetch packages from the default
    # cache.nixos.org which is not reachable from this sandboxed NixOS test.
    binaryCaches = [];
    };
    virtualisation.writableStore = true;
    with pkgs.lib;
    , shell ? false
    , pkgs ? import nixpkgs { system = "x86_64-linux"; }
    , nix ? pkgs.nixUnstable or pkgs.nix
  • replacement in flake.nix at line 8
    [10.353][9.609:652]()
    outputs = { self, nixpkgs, nix }@inputs:
    [10.353]
    [10.326]
    outputs = { self, nixpkgs, nix }:
  • replacement in flake.nix at line 10
    [10.334][9.653:782]()
    nix = inputs.nix.hydraJobs.build.x86_64-linux // {
    perl-bindings = inputs.nix.hydraJobs.perlBindings.x86_64-linux;
    [10.334]
    [10.640]
    version = "${builtins.readFile ./version}.${builtins.substring 0 8 self.lastModified}.${self.shortRev}";
    # FIXME: use nix overlay?
    nix' = nix.hydraJobs.build.x86_64-linux // {
    perl-bindings = nix.hydraJobs.perlBindings.x86_64-linux;
    };
    pkgs = import nixpkgs {
    system = "x86_64-linux";
    overlays = [ self.overlay ];
  • edit in flake.nix at line 22
    [10.649]
    [10.335]
    # NixOS configuration used for VM tests.
    hydraServer =
    { config, pkgs, ... }:
    { imports = [ self.nixosModules.hydra ];
    virtualisation.memorySize = 1024;
    virtualisation.writableStore = true;
    services.hydra-dev.enable = true;
    services.hydra-dev.hydraURL = "http://hydra.example.org";
    services.hydra-dev.notificationSender = "admin@hydra.example.org";
    services.postgresql.enable = true;
    services.postgresql.package = pkgs.postgresql95;
    environment.systemPackages = [ pkgs.perlPackages.LWP pkgs.perlPackages.JSON ];
    # The following is to work around the following error from hydra-server:
    # [error] Caught exception in engine "Cannot determine local time zone"
    time.timeZone = "UTC";
    nix = {
    # The following is to work around: https://github.com/NixOS/hydra/pull/432
    buildMachines = [
    { hostName = "localhost";
    system = "x86_64-linux";
    }
    ];
    # Without this nix tries to fetch packages from the default
    # cache.nixos.org which is not reachable from this sandboxed NixOS test.
    binaryCaches = [];
    };
    };
  • replacement in flake.nix at line 59
    [10.349][10.349:390](),[10.390][9.783:835](),[9.835][10.456:477](),[10.456][10.456:477]()
    hydraJobs = import ./release.nix {
    hydraSrc = self;
    nixpkgs = nixpkgs;
    inherit nix;
    [10.349]
    [10.477]
    # A Nixpkgs overlay that provides a 'hydra' package.
    overlay = final: prev: {
    hydra = with final; let
    perlDeps = buildEnv {
    name = "hydra-perl-deps";
    paths = with perlPackages;
    [ ModulePluggable
    CatalystActionREST
    CatalystAuthenticationStoreDBIxClass
    CatalystDevel
    CatalystDispatchTypeRegex
    CatalystPluginAccessLog
    CatalystPluginAuthorizationRoles
    CatalystPluginCaptcha
    CatalystPluginSessionStateCookie
    CatalystPluginSessionStoreFastMmap
    CatalystPluginStackTrace
    CatalystPluginUnicodeEncoding
    CatalystTraitForRequestProxyBase
    CatalystViewDownload
    CatalystViewJSON
    CatalystViewTT
    CatalystXScriptServerStarman
    CatalystXRoleApplicator
    CryptRandPasswd
    DBDPg
    DBDSQLite
    DataDump
    DateTime
    DigestSHA1
    EmailMIME
    EmailSender
    FileSlurp
    IOCompress
    IPCRun
    JSON
    JSONAny
    JSONXS
    LWP
    LWPProtocolHttps
    NetAmazonS3
    NetStatsd
    PadWalker
    Readonly
    SQLSplitStatement
    SetScalar
    Starman
    SysHostnameLong
    TestMore
    TextDiff
    TextTable
    XMLSimple
    nix'
    nix'.perl-bindings
    git
    boehmgc
    ];
    };
    in stdenv.mkDerivation {
    name = "hydra-${version}";
    src = self;
    buildInputs =
    [ makeWrapper autoconf automake libtool unzip nukeReferences pkgconfig sqlite libpqxx
    gitAndTools.topGit mercurial darcs subversion bazaar openssl bzip2 libxslt
    guile # optional, for Guile + Guix support
    perlDeps perl nix'
    postgresql95 # for running the tests
    boost
    nlohmann_json
    ];
    hydraPath = lib.makeBinPath (
    [ sqlite subversion openssh nix' coreutils findutils pixz
    gzip bzip2 lzma gnutar unzip git gitAndTools.topGit mercurial darcs gnused bazaar
    ] ++ lib.optionals stdenv.isLinux [ rpm dpkg cdrkit ] );
    configureFlags = [ "--with-docbook-xsl=${docbook_xsl}/xml/xsl/docbook" ];
    shellHook = ''
    PATH=$(pwd)/src/hydra-evaluator:$(pwd)/src/script:$(pwd)/src/hydra-eval-jobs:$(pwd)/src/hydra-queue-runner:$PATH
    PERL5LIB=$(pwd)/src/lib:$PERL5LIB
    '';
    preConfigure = "autoreconf -vfi";
    NIX_LDFLAGS = [ "-lpthread" ];
    enableParallelBuilding = true;
    preCheck = ''
    patchShebangs .
    export LOGNAME=''${LOGNAME:-foo}
    '';
    postInstall = ''
    mkdir -p $out/nix-support
    for i in $out/bin/*; do
    read -n 4 chars < $i
    if [[ $chars =~ ELF ]]; then continue; fi
    wrapProgram $i \
    --prefix PERL5LIB ':' $out/libexec/hydra/lib:$PERL5LIB \
    --prefix PATH ':' $out/bin:$hydraPath \
    --set HYDRA_RELEASE ${version} \
    --set HYDRA_HOME $out/libexec/hydra \
    --set NIX_RELEASE ${nix'.name or "unknown"}
    done
    '';
    dontStrip = true;
    meta.description = "Build of Hydra on ${system}";
    passthru.perlDeps = perlDeps;
    };
    };
    hydraJobs = {
    build.x86_64-linux = packages.hydra;
    manual =
    pkgs.runCommand "hydra-manual-${version}" {}
    ''
    mkdir -p $out/share
    cp -prvd ${pkgs.hydra}/share/doc $out/share/
    mkdir $out/nix-support
    echo "doc manual $out/share/doc/hydra" >> $out/nix-support/hydra-build-products
    '';
    tests.install.x86_64-linux =
    with import (nixpkgs + "/nixos/lib/testing.nix") { system = "x86_64-linux"; };
    simpleTest {
    machine = hydraServer;
    testScript =
    ''
    $machine->waitForJob("hydra-init");
    $machine->waitForJob("hydra-server");
    $machine->waitForJob("hydra-evaluator");
    $machine->waitForJob("hydra-queue-runner");
    $machine->waitForOpenPort("3000");
    $machine->succeed("curl --fail http://localhost:3000/");
    '';
    };
    tests.api.x86_64-linux =
    with import (nixpkgs + "/nixos/lib/testing.nix") { system = "x86_64-linux"; };
    simpleTest {
    machine = hydraServer;
    testScript =
    let dbi = "dbi:Pg:dbname=hydra;user=root;"; in
    ''
    $machine->waitForJob("hydra-init");
    # Create an admin account and some other state.
    $machine->succeed
    ( "su - hydra -c \"hydra-create-user root --email-address 'alice\@example.org' --password foobar --role admin\""
    , "mkdir /run/jobset /tmp/nix"
    , "chmod 755 /run/jobset /tmp/nix"
    , "cp ${./tests/api-test.nix} /run/jobset/default.nix"
    , "chmod 644 /run/jobset/default.nix"
    , "chown -R hydra /run/jobset /tmp/nix"
    );
    $machine->succeed("systemctl stop hydra-evaluator hydra-queue-runner");
    $machine->waitForJob("hydra-server");
    $machine->waitForOpenPort("3000");
    # Run the API tests.
    $machine->mustSucceed("su - hydra -c 'perl -I ${pkgs.hydra.perlDeps}/lib/perl5/site_perl ${./tests/api-test.pl}' >&2");
    '';
    };
    tests.notifications.x86_64-linux =
    with import (nixpkgs + "/nixos/lib/testing.nix") { system = "x86_64-linux"; };
    simpleTest {
    machine = { pkgs, ... }: {
    imports = [ hydraServer ];
    services.hydra-dev.extraConfig = ''
    <influxdb>
    url = http://127.0.0.1:8086
    db = hydra
    </influxdb>
    '';
    services.influxdb.enable = true;
    };
    testScript = ''
    $machine->waitForJob("hydra-init");
    # Create an admin account and some other state.
    $machine->succeed
    ( "su - hydra -c \"hydra-create-user root --email-address 'alice\@example.org' --password foobar --role admin\""
    , "mkdir /run/jobset"
    , "chmod 755 /run/jobset"
    , "cp ${./tests/api-test.nix} /run/jobset/default.nix"
    , "chmod 644 /run/jobset/default.nix"
    , "chown -R hydra /run/jobset"
    );
    # Wait until InfluxDB can receive web requests
    $machine->waitForJob("influxdb");
    $machine->waitForOpenPort("8086");
    # Create an InfluxDB database where hydra will write to
    $machine->succeed(
    "curl -XPOST 'http://127.0.0.1:8086/query' \\
    --data-urlencode 'q=CREATE DATABASE hydra'");
    # Wait until hydra-server can receive HTTP requests
    $machine->waitForJob("hydra-server");
    $machine->waitForOpenPort("3000");
    # Setup the project and jobset
    $machine->mustSucceed(
    "su - hydra -c 'perl -I ${pkgs.hydra.perlDeps}/lib/perl5/site_perl ${./tests/setup-notifications-jobset.pl}' >&2");
    # Wait until hydra has build the job and
    # the InfluxDBNotification plugin uploaded its notification to InfluxDB
    $machine->waitUntilSucceeds(
    "curl -s -H 'Accept: application/csv' \\
    -G 'http://127.0.0.1:8086/query?db=hydra' \\
    --data-urlencode 'q=SELECT * FROM hydra_build_status' | grep success");
    '';
    };
  • replacement in flake.nix at line 295
    [10.109][10.600:653](),[10.653][10.535:536](),[10.535][10.535:536](),[10.536][10.654:693]()
    packages.hydra = hydraJobs.build.x86_64-linux;
    defaultPackage = packages.hydra;
    [10.109]
    [10.0]
    packages.hydra = pkgs.hydra;
    defaultPackage = pkgs.hydra;
  • replacement in flake.nix at line 298
    [10.1][10.694:735](),[10.735][9.836:888](),[9.888][10.801:873](),[10.801][10.801:873]()
    devShell = (import ./release.nix {
    hydraSrc = self;
    nixpkgs = nixpkgs;
    shell = true;
    inherit nix;
    }).build.x86_64-linux;
    [10.1]
    [10.145]
    nixosModules.hydra = {
    imports = [ ./hydra-module.nix ];
    nixpkgs.overlays = [ self.overlay ];
    };
  • replacement in hydra-module.nix at line 67
    [10.112][10.403:434](),[10.1282][10.403:434]()
    #default = pkgs.hydra;
    [10.112]
    [10.113]
    default = pkgs.hydra;
  • edit in hydra-module.nix at line 220
    [10.1193][10.1193:1194](),[10.1194][2.68:159]()
    services.hydra-dev.package = mkDefault ((import ./release.nix {}).build.x86_64-linux);