move things around a bit (#61)
* keep ./services for instances ./profiles is for config-only modules ./services are like profiles, but configure a single instance of a service. Those are fronted by Nginx as the load-balancer and have a DNS entry as well. * ci: build build03 as well * move hydra to services * move matterbridge to services * move marvin-mk2 to services * build01: share the remainder profiles * build02: use the nix-community-cache * fixup kexec * rename profiles to roles * README: sync with reality
This commit is contained in:
parent
3fdc2d23d2
commit
37e48b712e
26 changed files with 47 additions and 73 deletions
27
README.md
27
README.md
|
@ -21,10 +21,13 @@ admin list below) or create an issue here:
|
||||||
|
|
||||||
## Services
|
## Services
|
||||||
|
|
||||||
* https://hydra.nix-community.org - on build01
|
|
||||||
* BuildKite agent - on build01
|
* BuildKite agent - on build01
|
||||||
* GitLab agent - on build01
|
* GitLab agent - on build01
|
||||||
* ryantm-updater bot - on build01
|
* hound - on build01
|
||||||
|
* https://hydra.nix-community.org - on build01
|
||||||
|
* marvin-mk2 - on build01
|
||||||
|
* matterbridge - on build01
|
||||||
|
* ryantm-updater bot - on build02
|
||||||
|
|
||||||
## Hosts
|
## Hosts
|
||||||
|
|
||||||
|
@ -46,14 +49,30 @@ This machine currently just runs r-ryantm/nixpkgs-update.
|
||||||
* RAM: 64GB DDR4 ECC
|
* RAM: 64GB DDR4 ECC
|
||||||
* Drives: 2 x 1 TB NVME in RAID 1
|
* Drives: 2 x 1 TB NVME in RAID 1
|
||||||
|
|
||||||
|
### `build03`
|
||||||
|
|
||||||
|
This machine is a replacement for build01.
|
||||||
|
|
||||||
|
* Provider: Hetzner
|
||||||
|
* CPU: AMD Ryzen 5 3600 6-Core Processor
|
||||||
|
* RAM: 64GB DDR4 ECC
|
||||||
|
* Drives: 2 x 512 TB NVME in RAID 1
|
||||||
|
|
||||||
## Cache
|
## Cache
|
||||||
|
|
||||||
All the builds on these machines are pushed to https://nix-community.cachix.org/
|
All the builds on these machines are pushed to https://nix-community.cachix.org/
|
||||||
|
|
||||||
Thanks to Cachix for sponsoring our binary cache!
|
Thanks to Cachix for sponsoring our binary cache!
|
||||||
|
|
||||||
## Usage
|
## File hierarchy
|
||||||
|
|
||||||
* `./deploy` - NixOps deployment
|
* ./build\d+ - build machines
|
||||||
|
* ./ci.sh - What is executed by CI
|
||||||
|
* ./deploy - NixOps deploy script
|
||||||
|
* ./nix - pinned Nix dependencies and overlays
|
||||||
|
* ./roles - shared NixOS configuration modules
|
||||||
|
* ./secrets - git-crypt encrypted secrets
|
||||||
|
* ./services - single instances of NixOS services
|
||||||
* ./terraform - Setup DNS
|
* ./terraform - Setup DNS
|
||||||
|
* ./users - NixOS configuration of our admins
|
||||||
|
|
||||||
|
|
|
@ -3,18 +3,16 @@
|
||||||
imports = [
|
imports = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
|
|
||||||
./buildkite.nix
|
../roles/buildkite.nix
|
||||||
./gitlab.nix
|
../roles/common.nix
|
||||||
./hydra.nix
|
../roles/docker.nix
|
||||||
./hydra-declarative-projects.nix
|
../roles/gitlab-runner.nix
|
||||||
./cache.nix
|
../roles/nginx.nix
|
||||||
./marvin-mk2.nix
|
../roles/nix-community-cache.nix
|
||||||
./matterbridge.nix
|
|
||||||
|
|
||||||
../profiles/common.nix
|
|
||||||
../services/docker.nix
|
|
||||||
../services/hound
|
../services/hound
|
||||||
../services/nginx.nix
|
../services/hydra
|
||||||
|
../services/marvin-mk2.nix
|
||||||
|
../services/matterbridge.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# /boot is a mirror raid
|
# /boot is a mirror raid
|
||||||
|
|
|
@ -1,48 +0,0 @@
|
||||||
{ config, pkgs, ... }:
|
|
||||||
let
|
|
||||||
postBuildHook = pkgs.writeScript "post-build-hook.sh" ''
|
|
||||||
#!${pkgs.runtimeShell}
|
|
||||||
export PATH=$PATH:${pkgs.nix}/bin
|
|
||||||
exec ${pkgs.cachix}/bin/cachix -c /var/lib/post-build-hook/nix-community-cachix.dhall push nix-community $OUT_PATHS
|
|
||||||
'';
|
|
||||||
|
|
||||||
sockPath = "/run/post-build-hook.sock";
|
|
||||||
|
|
||||||
queueBuildHook = pkgs.writeScript "post-build-hook.sh" ''
|
|
||||||
${pkgs.queued-build-hook}/bin/queued-build-hook queue --socket ${sockPath}
|
|
||||||
'';
|
|
||||||
|
|
||||||
sources = import ../nix/sources.nix;
|
|
||||||
|
|
||||||
in
|
|
||||||
{
|
|
||||||
|
|
||||||
nixpkgs.overlays = [
|
|
||||||
(self: super: {
|
|
||||||
queued-build-hook = (import sources.queued-build-hook { pkgs = super; });
|
|
||||||
})
|
|
||||||
];
|
|
||||||
|
|
||||||
systemd.sockets.queued-build-hook = {
|
|
||||||
description = "Post-build-hook socket";
|
|
||||||
wantedBy = [ "sockets.target" ];
|
|
||||||
socketConfig = {
|
|
||||||
ListenStream = sockPath;
|
|
||||||
SocketUser = "root";
|
|
||||||
SocketMode = "0600";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.services.queued-build-hook = {
|
|
||||||
description = "Post-build-hook service";
|
|
||||||
wantedBy = [ "multi-user.target" ];
|
|
||||||
after = [ "network.target" "queued-build-hook.socket" ];
|
|
||||||
requires = [ "queued-build-hook.socket" ];
|
|
||||||
serviceConfig.ExecStart = "${pkgs.queued-build-hook}/bin/queued-build-hook daemon --retry-interval 30 --hook ${postBuildHook}";
|
|
||||||
};
|
|
||||||
|
|
||||||
nix.extraOptions = ''
|
|
||||||
post-build-hook = ${queueBuildHook}
|
|
||||||
'';
|
|
||||||
|
|
||||||
}
|
|
|
@ -4,11 +4,11 @@
|
||||||
imports = [
|
imports = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
|
|
||||||
./cache.nix
|
|
||||||
./nixpkgs-update.nix
|
./nixpkgs-update.nix
|
||||||
|
|
||||||
../profiles/common.nix
|
../roles/common.nix
|
||||||
../services/nginx.nix
|
../roles/nginx.nix
|
||||||
|
../roles/nix-community-cache.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# /boot is a mirror raid
|
# /boot is a mirror raid
|
||||||
|
|
|
@ -10,8 +10,8 @@
|
||||||
imports = [
|
imports = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
|
|
||||||
../profiles/common.nix
|
../roles/common.nix
|
||||||
../profiles/hetzner-network.nix
|
../roles/hetzner-network.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# /boot is a mirror raid
|
# /boot is a mirror raid
|
||||||
|
|
|
@ -13,4 +13,6 @@ pkgs.nix-community-infra // rec {
|
||||||
build01-system = build01.system;
|
build01-system = build01.system;
|
||||||
build02 = importNixOS ./build02/configuration.nix "x86_64-linux";
|
build02 = importNixOS ./build02/configuration.nix "x86_64-linux";
|
||||||
build02-system = build02.system;
|
build02-system = build02.system;
|
||||||
|
build03 = importNixOS ./build02/configuration.nix "x86_64-linux";
|
||||||
|
build03-system = build03.system;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,12 +3,12 @@
|
||||||
{
|
{
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
|
./nix-daemon.nix
|
||||||
./security.nix
|
./security.nix
|
||||||
../services/nix-daemon.nix
|
./sshd.nix
|
||||||
../services/sshd.nix
|
./telegraf
|
||||||
../services/telegraf
|
|
||||||
./zfs.nix
|
|
||||||
./users.nix
|
./users.nix
|
||||||
|
./zfs.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
|
@ -4,7 +4,7 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./users.nix
|
./users.nix
|
||||||
../sshd.nix
|
./sshd.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,8 @@ let
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
imports = [ ./declarative-projects.nix ];
|
||||||
|
|
||||||
options.services.hydra = {
|
options.services.hydra = {
|
||||||
adminPasswordFile = mkOption {
|
adminPasswordFile = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
|
@ -1,3 +1,4 @@
|
||||||
|
# A single instance of matterbridge
|
||||||
{ ... }: {
|
{ ... }: {
|
||||||
services.matterbridge.enable = true;
|
services.matterbridge.enable = true;
|
||||||
services.matterbridge.configPath = "/run/keys/matterbridge.toml";
|
services.matterbridge.configPath = "/run/keys/matterbridge.toml";
|
Loading…
Add table
Reference in a new issue