From 46159eec9ac126b6f67a659c32febfd8ab459a75 Mon Sep 17 00:00:00 2001 From: Adrian G L Date: Sun, 16 Jun 2024 18:11:01 +0200 Subject: [PATCH] buskerud: Temporarily added ozai and ozai-webui --- flake.nix | 15 +++++++++++++-- hosts/buskerud/configuration.nix | 2 ++ hosts/buskerud/services/ozai.nix | 33 ++++++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 hosts/buskerud/services/ozai.nix diff --git a/flake.nix b/flake.nix index 929c79d..6677dff 100644 --- a/flake.nix +++ b/flake.nix @@ -27,9 +27,15 @@ grzegorz.inputs.nixpkgs.follows = "nixpkgs-unstable"; grzegorz-clients.url = "github:Programvareverkstedet/grzegorz-clients"; grzegorz-clients.inputs.nixpkgs.follows = "nixpkgs"; + + ozai.url = "git+https://git.pvv.ntnu.no/Projects/ozai.git"; + ozai.inputs.nixpkgs.follows = "nixpkgs"; + ozai-webui.url = "git+https://git.pvv.ntnu.no/adriangl/ozai-webui.git"; + ozai-webui.inputs.nixpkgs.follows = "nixpkgs"; + }; - outputs = { self, nixpkgs, nixpkgs-unstable, pvv-nettsiden, sops-nix, disko, ... }@inputs: + outputs = { self, nixpkgs, nixpkgs-unstable, pvv-nettsiden, sops-nix, disko, ozai, ozai-webui, ... }@inputs: let nixlib = nixpkgs.lib; systems = [ @@ -121,7 +127,12 @@ inputs.grzegorz-clients.nixosModules.grzegorz-webui ]; }; - buskerud = stableNixosConfig "buskerud" { }; + buskerud = stableNixosConfig "buskerud" { + modules = [ + ozai.nixosModules.ozai + ozai-webui.nixosModules.ozai-webui + ]; + }; }; devShells = forAllSystems (system: { diff --git a/hosts/buskerud/configuration.nix b/hosts/buskerud/configuration.nix index 14eec65..52ce4b5 100644 --- a/hosts/buskerud/configuration.nix +++ b/hosts/buskerud/configuration.nix @@ -4,6 +4,8 @@ ./hardware-configuration.nix ../../base.nix ../../misc/metrics-exporters.nix + + ./services/ozai.nix ]; # buskerud does not support efi? diff --git a/hosts/buskerud/services/ozai.nix b/hosts/buskerud/services/ozai.nix new file mode 100644 index 0000000..f416a19 --- /dev/null +++ b/hosts/buskerud/services/ozai.nix @@ -0,0 +1,33 @@ +{ config, pkgs, lib, ... }: +let +domain = "buskerud.pvv.ntnu.no"; +in +{ + + services.ozai = { + enable = true; + host = "0.0.0.0"; + port = 8000; + }; + + services.ozai-webui = { + enable = true; + port = 8080; + host = "0.0.0.0"; + }; + + services.nginx.virtualHosts."${domain}" = { + forceSSL = true; + enableACME = true; + locations."/azul/" = { + proxyWebsockets = true; + proxyPass = "http://${config.services.ozai-webui.host}:${config.services.ozai-webui.port}"; + }; + locations."/ozai/" = { + proxyWebsockets = true; + proxyPass = "http://${config.services.ozai.host}:${config.services.ozai.port}"; + }; + }; + + +}