From 6f8d9f7c97fe4461061404c3b505ca12bf1da5d2 Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Sat, 9 Nov 2019 13:59:47 +0100 Subject: [PATCH] Merge common.nix and c3d2.nix to hq.nix --- hosts/containers/lxc-template.nix | 2 +- hosts/hydra/configuration.nix | 4 ++-- hosts/pulsebert/configuration.nix | 2 +- hosts/storage-ng/configuration.nix | 2 +- lib/common/common.nix | 29 ----------------------------- lib/{common/c3d2.nix => hq.nix} | 9 +++------ lib/lxc-container.nix | 1 + lib/{common => }/motd | 0 secrets | 2 +- 9 files changed, 10 insertions(+), 41 deletions(-) delete mode 100644 lib/common/common.nix rename lib/{common/c3d2.nix => hq.nix} (72%) rename lib/{common => }/motd (100%) diff --git a/hosts/containers/lxc-template.nix b/hosts/containers/lxc-template.nix index 64b5b318..7b226d2d 100644 --- a/hosts/containers/lxc-template.nix +++ b/hosts/containers/lxc-template.nix @@ -9,7 +9,7 @@ [ ../../lib/lxc-container.nix ../../lib/shared.nix ../../lib/admins.nix - ../../lib/common/common.nix + ../../lib/hq.nix ]; diff --git a/hosts/hydra/configuration.nix b/hosts/hydra/configuration.nix index e90fb91b..3d77c475 100644 --- a/hosts/hydra/configuration.nix +++ b/hosts/hydra/configuration.nix @@ -6,7 +6,7 @@ ./adc.nix ./hydra.nix ./cache.nix - ./../../lib/common/c3d2.nix + ./../../lib/hq.nix ./../../lib/yggdrasil.nix ]; @@ -30,7 +30,7 @@ device = "rootfs"; }; - networking.hostName = "192"; + networking.hostName = "hydra"; networking.useHostResolvConf = true; diff --git a/hosts/pulsebert/configuration.nix b/hosts/pulsebert/configuration.nix index 8e9c394e..dbf7cbd1 100644 --- a/hosts/pulsebert/configuration.nix +++ b/hosts/pulsebert/configuration.nix @@ -12,7 +12,7 @@ in { [ # Include the results of the hardware scan. ./hardware-configuration.nix ../../lib/admins.nix - ../../lib/common/common.nix + ../../lib/hq.nix ../../lib/users.nix ../../lib/mpd.nix ../../lib/yggdrasil.nix diff --git a/hosts/storage-ng/configuration.nix b/hosts/storage-ng/configuration.nix index 8183321e..0da134c8 100644 --- a/hosts/storage-ng/configuration.nix +++ b/hosts/storage-ng/configuration.nix @@ -8,7 +8,7 @@ imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix - ../../lib/common/c3d2.nix + ../../lib/hq.nix ../../lib/shared.nix ../../lib/users.nix ./ncdc.nix diff --git a/lib/common/common.nix b/lib/common/common.nix deleted file mode 100644 index 5354e987..00000000 --- a/lib/common/common.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ config, pkgs, ... }: - -{ - networking = { - nameservers = [ "172.20.72.6" "9.9.9.9" "74.82.42.42" ]; - }; - - # add central logging - services.journalbeat = { - enable = true; - extraConfig = '' - journalbeat: - seek_position: cursor - cursor_seek_fallback: tail - write_cursor_state: true - cursor_flush_period: 5s - clean_field_names: true - convert_to_numbers: false - move_metadata_to_field: journal - default_type: journal - kernel: true - output.logstash: - # Boolean flag to enable or disable the output module. - enabled: true - hosts: ["logging.serv.zentralwerk.org:5044", "172.20.73.13:5044"] - ''; - }; - -} diff --git a/lib/common/c3d2.nix b/lib/hq.nix similarity index 72% rename from lib/common/c3d2.nix rename to lib/hq.nix index 5d66d5d9..583d19ed 100644 --- a/lib/common/c3d2.nix +++ b/lib/hq.nix @@ -1,13 +1,9 @@ -{ config, pkgs, ... }: +{ config, ... }: { - imports = [ ./common.nix ]; - - users.motd = builtins.readFile ./motd; - networking.domain = "hq.c3d2.de"; - nix = if config.services.nix-serve.enable then + nix = if config.networking.hostName == "hydra" then { } else { binaryCaches = [ "https://nix-serve.hq.c3d2.de" ]; @@ -15,4 +11,5 @@ [ "nix-serve.hq.c3d2.de:FEi9GyFkou1Ua8INaEKmuGaww9E5y3XwrNGNRfKYeLo=" ]; }; + users.motd = builtins.readFile ./motd; } diff --git a/lib/lxc-container.nix b/lib/lxc-container.nix index 7e6aa5a5..3474a809 100644 --- a/lib/lxc-container.nix +++ b/lib/lxc-container.nix @@ -4,6 +4,7 @@ imports = [ + ./hq.nix ]; nix.useSandbox = false; nix.maxJobs = lib.mkDefault 1; diff --git a/lib/common/motd b/lib/motd similarity index 100% rename from lib/common/motd rename to lib/motd diff --git a/secrets b/secrets index 92b0134c..812dec2e 160000 --- a/secrets +++ b/secrets @@ -1 +1 @@ -Subproject commit 92b0134ccb8cb97a3d9bffb471d07654101a1aed +Subproject commit 812dec2ee93dc6f2f03fe764a196067f81449314