From eaf2cf1973fb76c13334505c85d858fe133bd9d3 Mon Sep 17 00:00:00 2001 From: Kabbone Date: Mon, 16 Oct 2023 17:05:17 +0200 Subject: [PATCH] hosts: dmz: add gitea-runner in microvm --- hosts/default.nix | 5 ++--- hosts/dmz/hardware-configuration.nix | 4 ++-- modules/services/dmz/gitea_runner.nix | 22 +++++++++++++++++----- modules/services/dmz/microvm.nix | 9 ++++----- 4 files changed, 25 insertions(+), 15 deletions(-) diff --git a/hosts/default.nix b/hosts/default.nix index 4a88a87..d0c92df 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -137,14 +137,13 @@ in dmz = lib.nixosSystem { # Desktop profile inherit system; - specialArgs = { inherit inputs usersdmz location nixos-hardware nur agenix; }; - user = userdmz; + specialArgs = { inherit inputs user location nixos-hardware nur agenix; }; modules = [ agenix.nixosModules.default nur.nixosModules.nur + microvm.nixosModules.host; ./dmz ./configuration_server.nix - nixos-hardware.nixosModules.common-cpu-amd nixos-hardware.nixosModules.common-pc-ssd home-manager.nixosModules.home-manager { diff --git a/hosts/dmz/hardware-configuration.nix b/hosts/dmz/hardware-configuration.nix index 7e84622..74d18b4 100644 --- a/hosts/dmz/hardware-configuration.nix +++ b/hosts/dmz/hardware-configuration.nix @@ -81,8 +81,8 @@ enable = true; networks = { "10-lan" = { - matchConfig.Name = "enp34s0"; - ntp = [ "192.168.2.1" ]; + matchConfig.Name = "enp6s18"; + ntp = [ "192.168.101.1" ]; domains = [ "home.opel-online.de" ]; networkConfig = { DHCP = "yes"; diff --git a/modules/services/dmz/gitea_runner.nix b/modules/services/dmz/gitea_runner.nix index d6526c8..2bd8364 100644 --- a/modules/services/dmz/gitea_runner.nix +++ b/modules/services/dmz/gitea_runner.nix @@ -9,16 +9,28 @@ }; services.gitea-actions-runner.instances = { - nixrunner-test = { + homerunner = { enable = true; url = "https://git.kabtop.de"; - name = "nix_runner_test"; - #tokenFile = "./gitea_token"; - token = "vlUBkX5IbJKTBO3HAGqFM1fEOw2UqXpX87LcdJRY"; + name = "Homerunner"; + tokenFile = config.age.secrets."services/gitea/runner-token".path; labels = [ "debian-latest:docker://node:18-bullseye" + "native:host" + ]; + hostPackages = with pkgs; [ + bash + curl + gitMinimal + coreutils + wget + gnused ]; }; }; - system.stateVersion = "23.11"; + + age.secrets."services/gitea/runner-token" = { + file = ../../../secrets/services/gitea/runner-token.age; + owner = "gitea-runner"; + }; } diff --git a/modules/services/dmz/microvm.nix b/modules/services/dmz/microvm.nix index ef65a6f..ef9d872 100644 --- a/modules/services/dmz/microvm.nix +++ b/modules/services/dmz/microvm.nix @@ -15,9 +15,8 @@ in config.allowUnfree = true; }; - imports = [( ./gitea_runner.nix )]; - config = { + imports = [( ./gitea_runner.nix )]; networking = { hostName = "${name}-runner"; @@ -68,7 +67,7 @@ in id = "vm-${name}"; mac = "04:00:00:00:00:01"; macvtap = { - link = "enp34s0"; + link = "enp6s18"; mode = "bridge"; }; } ]; @@ -78,8 +77,8 @@ in tag = "ro-store"; proto = "virtiofs"; }]; - writableStoreOverlay = "/nix/.rw-store"; - storeOnDisk = true; + #writableStoreOverlay = "/nix/.rw-store"; + #storeOnDisk = true; }; system.stateVersion = "23.05"; };