From 7cb55cd7b2650e37c73871b9e23fbb3209300d2a Mon Sep 17 00:00:00 2001 From: Erwin Boskma Date: Fri, 10 Dec 2021 15:58:04 +0100 Subject: [PATCH] Initial drone container config --- krops.nix | 1 + machines/drone/configuration.nix | 40 +++++++++++++++++++++++ machines/drone/hardware-configuration.nix | 6 ++++ modules/element-web/default.nix | 2 +- 4 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 machines/drone/configuration.nix create mode 100644 machines/drone/hardware-configuration.nix diff --git a/krops.nix b/krops.nix index 474d18c..df588e5 100644 --- a/krops.nix +++ b/krops.nix @@ -32,4 +32,5 @@ rec { # nix-build ./krops.nix -A loki && ./result loki = createHost "loki" "root@loki"; + drone = createHost "drone" "root@10.0.0.185"; } diff --git a/machines/drone/configuration.nix b/machines/drone/configuration.nix new file mode 100644 index 0000000..8cf7ec9 --- /dev/null +++ b/machines/drone/configuration.nix @@ -0,0 +1,40 @@ +{ self, ... }: +{ + imports = [ + ./hardware-configuration.nix + ../../users/root + ../../users/erwin + ]; + + eboskma = { + docker.enable = true; + nix-common.enable = true; + }; + + boot.isContainer = true; + + time.timeZone = "Europe/Amsterdam"; + + system.configurationRevision = self.inputs.nixpkgs.lib.mkIf (self ? rev) self.rev; + + networking = { + hostName = "drone"; + useDHCP = false; + + interfaces = { + eth0 = { + ipv4.addresses = [{ + address = "10.0.0.202"; + prefixLength = "24"; + }]; + }; + }; + + defaultGateway = "10.0.0.1"; + nameservers = [ "10.0.0.254" ]; + }; + + services.openssh.enable = true; + + system.stateVersion = "21.11"; +} diff --git a/machines/drone/hardware-configuration.nix b/machines/drone/hardware-configuration.nix new file mode 100644 index 0000000..cea2ee0 --- /dev/null +++ b/machines/drone/hardware-configuration.nix @@ -0,0 +1,6 @@ +{ config, lib, pkgs, modulesPath, ... }: +{ + imports = [ + (modulesPath + "/virtualisation/lxc-container.nix") + ]; +} diff --git a/modules/element-web/default.nix b/modules/element-web/default.nix index 3f6f94c..5e1b62c 100644 --- a/modules/element-web/default.nix +++ b/modules/element-web/default.nix @@ -10,7 +10,7 @@ in config = mkIf cfg.enable { - config.eboskma.docker.enable = true; + eboskma.docker.enable = true; virtualisation.oci-containers.containers = { element-web = {