From 654f2ecf1f3c80ea318250d0ca3da3303d729248 Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Mon, 20 Jan 2020 14:24:31 +0100 Subject: [PATCH] Move hail into the c3d2 module --- hosts/containers/grafana/configuration.nix | 3 +-- hosts/containers/mpd-index/configuration.nix | 16 +++++++++----- hosts/glotzbert/configuration.nix | 22 ++++++++++--------- hosts/pulsebert/configuration.nix | 23 ++++++++++---------- lib/default.nix | 18 ++++++++++++++- lib/hail.nix | 9 -------- 6 files changed, 52 insertions(+), 39 deletions(-) delete mode 100644 lib/hail.nix diff --git a/hosts/containers/grafana/configuration.nix b/hosts/containers/grafana/configuration.nix index 29eb76f4..e47ad8d7 100644 --- a/hosts/containers/grafana/configuration.nix +++ b/hosts/containers/grafana/configuration.nix @@ -7,13 +7,12 @@ ../../../lib/lxc-container.nix ../../../lib/shared.nix ../../../lib/admins.nix - ../../../lib/hail.nix ]; c3d2 = { isInHq = true; - mapHqHosts = true; hq.interface = "eth0"; + enableHail = true; }; services.openssh.enable = true; diff --git a/hosts/containers/mpd-index/configuration.nix b/hosts/containers/mpd-index/configuration.nix index ced34e48..9c47c9ee 100644 --- a/hosts/containers/mpd-index/configuration.nix +++ b/hosts/containers/mpd-index/configuration.nix @@ -9,14 +9,20 @@ ../../../lib/lxc-container.nix ../../../lib/shared.nix ../../../lib/admins.nix - ../../../lib/hail.nix + ../../../lib ]; - environment.systemPackages = with pkgs; [ - ncmpcpp - ]; + c3d2 = { + isInHq = true; + enableHail = true; + }; - fileSystems."/mnt/music" = { fsType = "nfs"; device = "172.22.99.10:/mnt/zroot/storage/rpool/Music"; }; + environment.systemPackages = with pkgs; [ ncmpcpp ]; + + fileSystems."/mnt/music" = { + fsType = "nfs"; + device = "172.22.99.10:/mnt/zroot/storage/rpool/Music"; + }; networking.hostName = "mpd-index"; diff --git a/hosts/glotzbert/configuration.nix b/hosts/glotzbert/configuration.nix index b9bf9264..6cb02832 100644 --- a/hosts/glotzbert/configuration.nix +++ b/hosts/glotzbert/configuration.nix @@ -6,21 +6,23 @@ let #x11vnc-service = with pkgs; import ./x11vnc-service.nix { inherit stdenv pkgs; }; -in -{ +in { nixpkgs.config.allowUnfree = true; nix = { useSandbox = true; buildCores = 2; }; - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - ../../lib/default-gateway.nix - ../../lib/hail.nix - ../../lib/hq.nix - ../../lib/yggdrasil.nix - ]; + imports = [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ../../lib + ../../lib/yggdrasil.nix + ]; + + c3d2 = { + isInHq = true; + mapHqHosts = true; + enableHail = true; + }; # Use the systemd-boot EFI boot loader. boot.loader.systemd-boot.enable = true; diff --git a/hosts/pulsebert/configuration.nix b/hosts/pulsebert/configuration.nix index 67a7a657..bb0ac903 100644 --- a/hosts/pulsebert/configuration.nix +++ b/hosts/pulsebert/configuration.nix @@ -8,24 +8,23 @@ let ympdPort = 8080; mpdVhost = "mpd.hq.c3d2.de"; in { - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - ../../lib - ../../lib/admins.nix - ../../lib/hq.nix - ../../lib/users.nix - ../../lib/mpd.nix - ../../lib/yggdrasil.nix - ../../lib/hail.nix - ../../lib/emery.nix + imports = [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ../../lib + ../../lib/admins.nix + ../../lib/hq.nix + ../../lib/users.nix + ../../lib/mpd.nix + ../../lib/yggdrasil.nix + ../../lib/emery.nix ./mpdConsole.nix - ]; + ]; c3d2 = { isInHq = true; mapHqHosts = true; hq.interface = "eno1"; + enableHail = true; }; # Use the systemd-boot EFI boot loader. diff --git a/lib/default.nix b/lib/default.nix index 93c59388..906c8a33 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -55,12 +55,19 @@ in { mapHqHosts = mkOption { type = bool; - default = false; + default = cfg.isInHq; description = '' Whether to add all internal HQ host mappings to /etc/hosts. ''; }; + enableHail = mkOption { + type = bool; + default = false; + description = + "Whether to enable Hail continuous deployment from the local Hydra."; + }; + hq = { /* externalInterface = mkOption { @@ -208,6 +215,15 @@ in { ''; }; + services.hail = lib.mkIf cfg.enableHail { + enable = true; + hydraJobUri = + "https://hydra.hq.c3d2.de/job/c3d2/hail/${config.networking.hostName}-activator "; + # pad the end so the URL doesn't break when systemshit puts a ; on the end + package = (import { }).haskellPackages.hail; + # Only builds > 19.09 + }; + }; meta.maintainers = with lib.maintainers; [ ehmry ]; diff --git a/lib/hail.nix b/lib/hail.nix deleted file mode 100644 index cbf7adb5..00000000 --- a/lib/hail.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ config, ... }: { - - services.hail = { - enable = true; - hydraJobUri = "https://hydra.hq.c3d2.de/job/c3d2/hail/${config.networking.hostName}-activator"; - # Only builds > 19.09 - package = (import {}).haskellPackages.hail; - }; -}