diff --git a/flake.nix b/flake.nix index 1dc0c9e2..19d6a492 100644 --- a/flake.nix +++ b/flake.nix @@ -564,6 +564,13 @@ ]; }; + oxigraph = nixosSystem' { + modules = [ + self.nixosModules.cluster-options + ./hosts/oxigraph + ]; + }; + prometheus = nixosSystem' { modules = [ self.nixosModules.microvm diff --git a/hosts/oxigraph/default.nix b/hosts/oxigraph/default.nix new file mode 100644 index 00000000..f71d6c5d --- /dev/null +++ b/hosts/oxigraph/default.nix @@ -0,0 +1,30 @@ +{ config, pkgs, ... }: + +{ + networking.hostName = "oxigraph"; + system.stateVersion = "22.11"; + c3d2.hq.statistics.enable = true; + deployment = { + mem = 8192; + }; + + users = { + groups.oxigraph = {}; + users.oxigraph = { + isSystemUser = true; + group = "oxigraph"; + home = "/var/lib/oxigraph"; + createHome = true; + }; + }; + + systemd.services.oxigraph = { + wantedBy = [ "multi-user.target" ]; + after = [ "network.target" ]; + serviceConfig = { + User = "oxigraph"; + Group = "oxigraph"; + ExecStart = "${pkgs.oxigraph}/bin/oxigraph_server serve -l ${config.users.users.oxigraph.home}/data"; + }; + }; +} diff --git a/hosts/public-access-proxy/default.nix b/hosts/public-access-proxy/default.nix index f33a28ea..4d0efb56 100644 --- a/hosts/public-access-proxy/default.nix +++ b/hosts/public-access-proxy/default.nix @@ -137,6 +137,9 @@ } { hostNames = [ "tmppleroma.hq.c3d2.de" ]; proxyTo.host = zentralwerk.lib.config.site.net.serv.hosts4.tmppleroma; + } { + hostNames = [ "oxigraph.hq.c3d2.de" ]; + proxyTo.host = zentralwerk.lib.config.site.net.serv.hosts4.oxigraph; } ]; }; diff --git a/overlays/default.nix b/overlays/default.nix index aa94fb94..3d77fc15 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -79,6 +79,8 @@ with final; { doCheck = false; }); + oxigraph = callPackage ./oxigraph.nix { }; + pile = callPackage ./pile.nix { }; pi-sensors = callPackage ./pi-sensors { }; diff --git a/overlays/oxigraph.nix b/overlays/oxigraph.nix new file mode 100644 index 00000000..937f4c56 --- /dev/null +++ b/overlays/oxigraph.nix @@ -0,0 +1,35 @@ +{ lib +, rustPlatform +, fetchFromGitHub +, pkg-config +, llvmPackages +}: + +rustPlatform.buildRustPackage rec { + pname = "oxigraph"; + version = "0.3.11"; + + src = fetchFromGitHub { + owner = pname; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-7KbDZKKJPk3QTp4siIbdB6xKbslw73Lhc7NoeOuA0Og="; + fetchSubmodules = true; + }; + + cargoSha256 = "sha256-Yqn6hwejg6LzcqW0MiUN3tqrOql6cpu/5plaOz+2/ns="; + + nativeBuildInputs = [ + pkg-config llvmPackages.clang + ]; + LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib"; + + preConfigure = '' + cd server + ''; + postBuild = '' + cd .. + ''; + + doCheck = false; +}