From cbc3490882bf498d806eb1bf07e2c44b1c33e75e Mon Sep 17 00:00:00 2001 From: h7x4 Date: Sat, 19 Oct 2024 23:29:54 +0200 Subject: [PATCH] modules/grzegorz: use greg-ng --- flake.nix | 14 ++++++++++---- modules/grzegorz.nix | 44 +++++++++++++++++++------------------------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/flake.nix b/flake.nix index b09a986..4616461 100644 --- a/flake.nix +++ b/flake.nix @@ -23,8 +23,8 @@ nix-gitea-themes.url = "git+https://git.pvv.ntnu.no/oysteikt/nix-gitea-themes.git"; nix-gitea-themes.inputs.nixpkgs.follows = "nixpkgs"; - grzegorz.url = "git+https://git.pvv.ntnu.no/Projects/grzegorz.git"; - grzegorz.inputs.nixpkgs.follows = "nixpkgs"; + greg-ng.url = "git+https://git.pvv.ntnu.no/Projects/greg-ng.git"; + greg-ng.inputs.nixpkgs.follows = "nixpkgs"; grzegorz-clients.url = "git+https://git.pvv.ntnu.no/Projects/grzegorz-clients.git"; grzegorz-clients.inputs.nixpkgs.follows = "nixpkgs"; @@ -116,14 +116,20 @@ brzeczyszczykiewicz = stableNixosConfig "brzeczyszczykiewicz" { modules = [ - inputs.grzegorz.nixosModules.grzegorz-kiosk inputs.grzegorz-clients.nixosModules.grzegorz-webui + inputs.greg-ng.nixosModules.default + ]; + overlays = [ + inputs.greg-ng.overlays.default ]; }; georg = stableNixosConfig "georg" { modules = [ - inputs.grzegorz.nixosModules.grzegorz-kiosk inputs.grzegorz-clients.nixosModules.grzegorz-webui + inputs.greg-ng.nixosModules.default + ]; + overlays = [ + inputs.greg-ng.overlays.default ]; }; }; diff --git a/modules/grzegorz.nix b/modules/grzegorz.nix index 6c0600b..230dc46 100644 --- a/modules/grzegorz.nix +++ b/modules/grzegorz.nix @@ -1,31 +1,26 @@ {config, lib, pkgs, ...}: let - grg = config.services.grzegorz; + grg = config.services.greg-ng; grgw = config.services.grzegorz-webui; in { - services.pipewire.enable = true; - services.pipewire.alsa.enable = true; - services.pipewire.alsa.support32Bit = true; - services.pipewire.pulse.enable = true; - - users.users.pvv = { - isNormalUser = true; - description = "pvv"; + services.greg-ng = { + enable = true; + settings.host = "localhost"; + settings.port = 31337; + enableSway = true; + enablePipewire = true; }; - services.grzegorz.enable = true; - services.grzegorz.listenAddr = "localhost"; - services.grzegorz.listenPort = 31337; - - services.grzegorz-webui.enable = true; - services.grzegorz-webui.listenAddr = "localhost"; - services.grzegorz-webui.listenPort = 42069; - services.grzegorz-webui.listenWebsocketPort = 42042; - services.grzegorz-webui.hostName = "${config.networking.fqdn}"; - services.grzegorz-webui.apiBase = "http://${toString grg.listenAddr}:${toString grg.listenPort}/api"; + services.grzegorz-webui = { + enable = true; + listenAddr = "localhost"; + listenPort = 42069; + listenWebsocketPort = 42042; + hostName = "${config.networking.fqdn}"; + apiBase = "http://${grg.settings.host}:${toString grg.settings.port}/api"; + }; services.nginx.enable = true; - services.nginx.virtualHosts."${config.networking.fqdn}" = { forceSSL = true; enableACME = true; @@ -40,20 +35,19 @@ in { ''; locations."/" = { - proxyPass = "http://localhost:${builtins.toString config.services.grzegorz-webui.listenPort}"; + proxyPass = "http://${grgw.listenAddr}:${toString grgw.listenPort}"; }; # https://github.com/rawpython/remi/issues/216 locations."/websocket" = { - proxyPass = "http://localhost:${builtins.toString config.services.grzegorz-webui.listenWebsocketPort}"; + proxyPass = "http://${grgw.listenAddr}:${toString grgw.listenWebsocketPort}"; proxyWebsockets = true; }; locations."/api" = { - proxyPass = "http://localhost:${builtins.toString config.services.grzegorz.listenPort}"; + proxyPass = "http://${grg.settings.host}:${toString grg.settings.port}"; }; locations."/docs" = { - proxyPass = "http://localhost:${builtins.toString config.services.grzegorz.listenPort}"; + proxyPass = "http://${grg.settings.host}:${toString grg.settings.port}"; }; }; - }