Merge pull request #20 from nix-community/hydra-20.03
Hydra + 20.03 upgrade
This commit is contained in:
commit
1dd8adcd62
11 changed files with 60 additions and 31 deletions
5
.github/workflows/nix.yml
vendored
5
.github/workflows/nix.yml
vendored
|
@ -7,9 +7,8 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: cachix/install-nix-action@v8
|
- uses: cachix/install-nix-action@v8
|
||||||
- uses: cachix/cachix-action@v5
|
- uses: numtide/cachix-action@only-cache
|
||||||
with:
|
with:
|
||||||
name: nix-community
|
name: nix-community
|
||||||
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
|
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
|
||||||
# Only needed for private caches
|
- run: nix-build
|
||||||
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
|
||||||
|
|
|
@ -1,17 +1,9 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
services.buildkite-agent = {
|
services.buildkite-agents.ci = {
|
||||||
enable = true;
|
enable = true;
|
||||||
tokenPath = "/run/keys/buildkite-token";
|
tokenPath = "/run/keys/buildkite-token";
|
||||||
openssh.privateKeyPath = builtins.toPath "/run/keys/buildkite-agent-key";
|
privateSshKeyPath = builtins.toPath "/run/keys/buildkite-agent-key";
|
||||||
openssh.publicKeyPath = builtins.toPath "/run/keys/buildkite-agent-key.pub";
|
|
||||||
|
|
||||||
runtimePackages = [
|
|
||||||
pkgs.gnutar
|
|
||||||
pkgs.bash
|
|
||||||
pkgs.nix
|
|
||||||
pkgs.gzip
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@ in
|
||||||
./buildkite.nix
|
./buildkite.nix
|
||||||
./gitlab.nix
|
./gitlab.nix
|
||||||
./hydra.nix
|
./hydra.nix
|
||||||
|
./hydra-declarative-projects.nix
|
||||||
./cache.nix
|
./cache.nix
|
||||||
./nixpkgs-update.nix
|
./nixpkgs-update.nix
|
||||||
|
|
||||||
|
@ -50,6 +51,9 @@ in
|
||||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||||
boot.supportedFilesystems = [ "zfs" ];
|
boot.supportedFilesystems = [ "zfs" ];
|
||||||
|
|
||||||
system.stateVersion = "19.09";
|
security.acme.email = "trash@nix-community.org";
|
||||||
|
security.acme.acceptTerms = true;
|
||||||
|
|
||||||
|
system.stateVersion = "20.03";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
13
build01/hydra-declarative-projects.nix
Normal file
13
build01/hydra-declarative-projects.nix
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
{ lib, pkgs, config, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
services.hydra.declarativeProjects = {
|
||||||
|
emacs-overlay = {
|
||||||
|
displayName = "Emacs Overlay";
|
||||||
|
inputValue = "https://github.com/nix-community/emacs-overlay";
|
||||||
|
specFile = "hydra/spec.json";
|
||||||
|
description = "Bleeding edge emacs overlay";
|
||||||
|
homepage = "https://github.com/nix-community/emacs-overlay";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -7,7 +7,7 @@ let
|
||||||
|
|
||||||
hydraPort = 3000;
|
hydraPort = 3000;
|
||||||
hydraAdmin = "admin";
|
hydraAdmin = "admin";
|
||||||
hydraAdminPasswordFile = "/var/keys/hydra-admin-password";
|
hydraAdminPasswordFile = "/run/keys/hydra-admin-password";
|
||||||
|
|
||||||
createDeclarativeProjectScript = pkgs.stdenv.mkDerivation {
|
createDeclarativeProjectScript = pkgs.stdenv.mkDerivation {
|
||||||
name = "create-declarative-project";
|
name = "create-declarative-project";
|
||||||
|
@ -84,7 +84,7 @@ in {
|
||||||
services.nginx = {
|
services.nginx = {
|
||||||
enable = true;
|
enable = true;
|
||||||
virtualHosts = {
|
virtualHosts = {
|
||||||
"hydra.nix-community.com" = {
|
"hydra.nix-community.org" = {
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
|
@ -138,7 +138,7 @@ in {
|
||||||
environment = {
|
environment = {
|
||||||
inherit (cfg.systemd.services.hydra-init.environment) HYDRA_DBI;
|
inherit (cfg.systemd.services.hydra-init.environment) HYDRA_DBI;
|
||||||
};
|
};
|
||||||
path = with pkgs; [ hydra netcat ];
|
path = with pkgs; [ hydra-unstable netcat ];
|
||||||
script = ''
|
script = ''
|
||||||
set -e
|
set -e
|
||||||
export HYDRA_ADMIN_PASSWORD=$(cat ${cfg.services.hydra.adminPasswordFile})
|
export HYDRA_ADMIN_PASSWORD=$(cat ${cfg.services.hydra.adminPasswordFile})
|
||||||
|
|
|
@ -8,7 +8,7 @@ let
|
||||||
inherit configuration system;
|
inherit configuration system;
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
pkgs.nix-community-infra // rec {
|
pkgs.nix-community-infra // rec {
|
||||||
build01 = importNixOS ./build01/configuration.nix "x86_64-linux";
|
build01 = importNixOS ./build01/configuration.nix "x86_64-linux";
|
||||||
build01-system = build01.system;
|
build01-system = build01.system;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
let
|
let
|
||||||
|
secrets = import ./secrets.nix;
|
||||||
secrets = import ./secrets;
|
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -18,19 +16,19 @@ in
|
||||||
|
|
||||||
deployment.keys.buildkite-token = {
|
deployment.keys.buildkite-token = {
|
||||||
text = secrets.buildkite-token;
|
text = secrets.buildkite-token;
|
||||||
user = "buildkite-agent";
|
user = "buildkite-agent-ci";
|
||||||
permissions = "0600";
|
permissions = "0600";
|
||||||
};
|
};
|
||||||
|
|
||||||
deployment.keys.buildkite-agent-key = {
|
deployment.keys.buildkite-agent-key = {
|
||||||
text = secrets.buildkite-agent-key;
|
text = secrets.buildkite-agent-key;
|
||||||
user = "buildkite-agent";
|
user = "buildkite-agent-ci";
|
||||||
permissions = "0600";
|
permissions = "0600";
|
||||||
};
|
};
|
||||||
|
|
||||||
deployment.keys."buildkite-agent-key.pub" = {
|
deployment.keys."buildkite-agent-key.pub" = {
|
||||||
text = secrets."buildkite-agent-key.pub";
|
text = secrets."buildkite-agent-key.pub";
|
||||||
user = "buildkite-agent";
|
user = "buildkite-agent-ci";
|
||||||
permissions = "0600";
|
permissions = "0600";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -81,7 +79,7 @@ in
|
||||||
|
|
||||||
deployment.keys.github-nixpkgs-swh-key = {
|
deployment.keys.github-nixpkgs-swh-key = {
|
||||||
text = secrets.github-nixpkgs-swh-key;
|
text = secrets.github-nixpkgs-swh-key;
|
||||||
user = "buildkite-agent";
|
user = "buildkite-agent-ci";
|
||||||
permissions = "0400";
|
permissions = "0400";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -5,10 +5,10 @@
|
||||||
"homepage": "https://github.com/NixOS/nixpkgs",
|
"homepage": "https://github.com/NixOS/nixpkgs",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs-channels",
|
"repo": "nixpkgs-channels",
|
||||||
"rev": "aa561c6fb4f48974639a9e2b76fdd3e15b2abfd4",
|
"rev": "b61999e4ad60c351b4da63ae3ff43aae3c0bbdfb",
|
||||||
"sha256": "15p0lbf227l26mvvpqi62nry3h0b249hig9fgpnsl6a3rlp6bj2v",
|
"sha256": "0cggpdks4qscyirqwfprgdl91mlhjlw24wkg0riapk5f2g2llbpq",
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
"url": "https://github.com/NixOS/nixpkgs-channels/archive/aa561c6fb4f48974639a9e2b76fdd3e15b2abfd4.tar.gz",
|
"url": "https://github.com/NixOS/nixpkgs-channels/archive/b61999e4ad60c351b4da63ae3ff43aae3c0bbdfb.tar.gz",
|
||||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
||||||
},
|
},
|
||||||
"nixpkgs-update": {
|
"nixpkgs-update": {
|
||||||
|
|
23
secrets.nix
Normal file
23
secrets.nix
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
with builtins;
|
||||||
|
let
|
||||||
|
# Copied from <nixpkgs/lib>
|
||||||
|
removeSuffix = suffix: str:
|
||||||
|
let
|
||||||
|
sufLen = stringLength suffix;
|
||||||
|
sLen = stringLength str;
|
||||||
|
in
|
||||||
|
if
|
||||||
|
sufLen <= sLen && suffix == substring (sLen - sufLen) sufLen str
|
||||||
|
then
|
||||||
|
substring 0 (sLen - sufLen) str
|
||||||
|
else
|
||||||
|
str;
|
||||||
|
|
||||||
|
# Copied from <nixpkgs/lib>
|
||||||
|
fileContents = file: removeSuffix "\n" (builtins.readFile file);
|
||||||
|
|
||||||
|
readSecret = name: fileContents (./secrets + "/${name}");
|
||||||
|
in
|
||||||
|
mapAttrs
|
||||||
|
(name: type: if type != "directory" then readSecret name else null)
|
||||||
|
(readDir ./secrets)
|
BIN
secrets/buildkite-token
Normal file
BIN
secrets/buildkite-token
Normal file
Binary file not shown.
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue