Add a NixOS container to demo Hydra

[?]
Sep 24, 2019, 5:58 PM
6LB22PZNGFWY7O4LH63RG6YMKMPMRWWT62TNANHWAGD2NO54SFLAC

Dependencies

  • [2] GFT3FABQ Update lock file
  • [3] P3M6UFMP Merge remote-tracking branch 'origin/master' into flake
  • [4] JGWFBGDI Update flake.nix
  • [5] CCPSI3TP Add flake.nix
  • [6] T4LLYESZ * Nix expression for building Hydra.
  • [7] M32RT6PS Update flake.{nix,lock}

Change contents

  • replacement in flake.lock at line 18
    [4.567][2.419:621]()
    "narHash": "sha256-HGlE2VNbdEjCP76hWAS72kHBlMWhpvqWo58Obg1Vy6s=",
    "originalUri": "nixpkgs",
    "uri": "github:edolstra/nixpkgs/13e1bce51f4aebdf3db58ce8c4a93e904a272bff"
    [4.567]
    [4.157]
    "narHash": "sha256-qWEM8iYRYUdaVCHwTq13w69/11hAFWZplp5mqeU2qBM=",
    "originalUri": "nixpkgs/release-19.09",
    "uri": "github:edolstra/nixpkgs/7d9219a0adea88942b8d609f89cf4a1f86df1a9c"
  • edit in flake.nix at line 5
    [3.76]
    [3.76]
    inputs.nixpkgs.uri = "nixpkgs/release-19.09";
  • replacement in flake.nix at line 26
    [3.600][3.600:649]()
    { imports = [ self.nixosModules.hydra ];
    [3.600]
    [3.649]
    { imports = [ self.nixosModules.hydraTest ];
  • edit in flake.nix at line 30
    [3.741][3.741:1036]()
    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;
  • edit in flake.nix at line 32
    [3.1126][3.1126:1327]()
    # 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";
  • edit in flake.nix at line 34
    [3.1346][3.1346:1575]()
    # The following is to work around: https://github.com/NixOS/hydra/pull/432
    buildMachines = [
    { hostName = "localhost";
    system = "x86_64-linux";
    }
    ];
  • edit in flake.nix at line 285
    [3.10571]
    [3.10571]
    nix.package = nix';
  • edit in flake.nix at line 287
    [3.10580]
    [3.10580]
    nixosModules.hydraTest = {
    imports = [ self.nixosModules.hydra ];
  • edit in flake.nix at line 291
    [3.10581]
    [3.10581]
    services.hydra-dev.enable = true;
    services.hydra-dev.hydraURL = "http://hydra.example.org";
    services.hydra-dev.notificationSender = "admin@hydra.example.org";
    systemd.services.hydra-send-stats.enable = false;
    services.postgresql.enable = true;
    services.postgresql.package = pkgs.postgresql95;
    # 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";
    };
    nixosConfigurations.container = nixpkgs.lib.nixosSystem {
    system = "x86_64-linux";
    modules =
    [ { imports = [ self.nixosModules.hydraTest ];
    system.configurationRevision = self.rev;
    boot.isContainer = true;
    networking.useDHCP = false;
    networking.firewall.allowedTCPPorts = [ 80 ];
    networking.hostName = "hydra";
    nix.extraOptions = ''
    allowed-uris = https://github.com/
    '';
    services.hydra-dev.useSubstitutes = true;
    services.httpd = {
    enable = true;
    adminAddr = "hydra-admin@example.org";
    extraConfig = ''
    <Proxy *>
    Order deny,allow
    Allow from all
    </Proxy>
    ProxyRequests Off
    ProxyPreserveHost On
    ProxyPass /apache-errors !
    ErrorDocument 503 /apache-errors/503.html
    ProxyPass / http://127.0.0.1:3000/ retry=5 disablereuse=on
    ProxyPassReverse / http://127.0.0.1:3000/
    '';
    };
    }
    ];
    };