diff --git a/hosts/sakura/default.nix b/hosts/sakura/default.nix index e0b2937..4355e29 100644 --- a/hosts/sakura/default.nix +++ b/hosts/sakura/default.nix @@ -3,11 +3,10 @@ _: { ./hardware.nix ./services ./networking.nix + ../common.nix ../../modules ]; - services.snowflake-proxy.enable = true; - users = { users.notoh.openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICqAjaV2D2J8ln4n39ZvszCF5Jql+0IaSpFCJlzDSLv6 sakura" diff --git a/hosts/sakura/hardware.nix b/hosts/sakura/hardware.nix index f0a6596..847c9d1 100644 --- a/hosts/sakura/hardware.nix +++ b/hosts/sakura/hardware.nix @@ -27,8 +27,8 @@ device = "/dev/disk/by-uuid/db3e4722-35a6-44fb-8e4d-a75166b845cb"; fsType = "ext4"; }; - "/home/notoh/justlog/logs" = { - device = "192.168.1.199:/mnt/Sutoreji/twitchlogs"; + "/home/notoh/rustlog/clickhouse" = { + device = "192.168.1.199:/mnt/Sutoreji/twitchlogs-rustlog"; fsType = "nfs"; }; "/nas/restic" = { diff --git a/hosts/sakura/services/default.nix b/hosts/sakura/services/default.nix index d2b33f8..8150a4a 100644 --- a/hosts/sakura/services/default.nix +++ b/hosts/sakura/services/default.nix @@ -9,6 +9,6 @@ ./vaultwarden.nix # ./conduit.nix ./tailscale.nix - ./justlog.nix + ./rustlog.nix ]; } diff --git a/hosts/sakura/services/justlog.nix b/hosts/sakura/services/justlog.nix deleted file mode 100644 index a2c785e..0000000 --- a/hosts/sakura/services/justlog.nix +++ /dev/null @@ -1,11 +0,0 @@ -_: { - networking.firewall.allowedTCPPorts = [8025]; - virtualisation.oci-containers.containers.justlog = { - image = "ghcr.io/gempir/justlog@sha256:44b2426c0057b44019b78b1daece13dac2356ff68f9f506f067c8c4c92f54f22"; - ports = ["8025:8025"]; - volumes = [ - "/home/notoh/justlog/config.json:/etc/justlog.json" - "/home/notoh/justlog/logs:/logs" - ]; - }; -} diff --git a/hosts/sakura/services/rustlog.nix b/hosts/sakura/services/rustlog.nix new file mode 100644 index 0000000..a51d2fb --- /dev/null +++ b/hosts/sakura/services/rustlog.nix @@ -0,0 +1,30 @@ +{lib, ...}: { + networking.firewall.allowedTCPPorts = [8025 8123]; + + systemd.services = { + docker-rustlog.serviceConfig = {PrivateNetwork = lib.mkForce false;}; + }; + + virtualisation.oci-containers.containers = { + clickhouse = { + image = "clickhouse/clickhouse-server:latest"; + environment = { + CLICKHOUSE_DB = "rustlog"; + CLICKHOUSE_HOST = "192.168.1.25"; + }; + extraOptions = ["--network=host"]; + volumes = [ + "/home/notoh/rustlog/clickhouse:/var/lib/clickhouse:rw" + ]; + }; + rustlog = { + image = "ghcr.io/boring-nick/rustlog:master"; + ports = ["8025:8025"]; + volumes = [ + "/home/notoh/rustlog/config.json:/config.json" + ]; + dependsOn = ["clickhouse"]; + extraOptions = ["--network=host"]; + }; + }; +}