From 671a28d9f51037738f03f694aa20e1e7e065cb2d Mon Sep 17 00:00:00 2001 From: Adrian Gunnar Lauterer Date: Wed, 29 May 2024 17:31:59 +0200 Subject: [PATCH] Update flake.nix --- flake.nix | 74 +++++++++++++++++++++++++++---------------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/flake.nix b/flake.nix index 5d7b924..ea6e558 100644 --- a/flake.nix +++ b/flake.nix @@ -30,45 +30,45 @@ }); nixosModules = forAllSystems (system: let - ozaiWebui = import ./default.nix { inherit (pkgs.${system}) pkgs; }; - lib = pkgs.${system}.lib; - types = pkgs.${system}.lib.types; - in { - ozai-webui = { config, pkgs, ... }: { - options.services.ozai-webui = { - enable = lib.mkEnableOption "Ozai WebUI"; - host = lib.mkOption { - type = types.str; - default = "127.0.0.1"; - description = "The host to run the server on"; - }; - port = lib.mkOption { - type = types.int; - default = 8080; - description = "The port to run the server on"; - }; - ozaiUrl = lib.mkOption { - type = types.str; - default = "http://localhost:8000/api/"; - description = "The URL of the Ozai server"; - }; - secretKey = lib.mkOption { - type = types.str; - default = "secret_key"; - description = "The secret key for the Flask app"; - }; - }; - config = lib.mkIf config.services.ozai-webui.enable { - systemd.services.ozai-webui = { - description = "Ozai WebUI"; - after = [ "network.target" ]; - wantedBy = [ "multi-user.target" ]; - serviceConfig = { - ExecStart = "${ozaiWebui}/bin/ozai-webui --port ${toString config.services.ozai-webui.port} --host '${config.services.ozai-webui.host}' --ozai_url '${config.services.ozai-webui.ozaiUrl}' --secret_key '${config.services.ozai-webui.secretKey}' --static_folder '/share/ozai-webui/static' --template_folder '/share/ozai-webui/templates'"; - Restart = "always"; + ozai-webui = import ./default.nix { inherit (pkgs.${system}) pkgs; }; + lib = pkgs.${system}.lib; + types = pkgs.${system}.lib.types; + in { + ozai-webui = { config, pkgs, ... }: { + options.services.ozai-webui = { + enable = lib.mkEnableOption "Ozai WebUI"; + host = lib.mkOption { + type = types.str; + default = "127.0.0.1"; + description = "The host to run the server on"; + }; + port = lib.mkOption { + type = types.int; + default = 8080; + description = "The port to run the server on"; + }; + ozaiUrl = lib.mkOption { + type = types.str; + default = "http://localhost:8000/api/"; + description = "The URL of the Ozai server"; + }; + secretKey = lib.mkOption { + type = types.str; + default = "secret_key"; + description = "The secret key for the Flask app"; + }; + }; + config = lib.mkIf config.services.ozai-webui.enable { + systemd.services.ozai-webui = { + description = "Ozai WebUI"; + after = [ "network.target" ]; + wantedBy = [ "multi-user.target" ]; + serviceConfig = { + ExecStart = "${ozaiWebui}/bin/ozai-webui --port ${toString config.services.ozai-webui.port} --host '${config.services.ozai-webui.host}' --ozai_url '${config.services.ozai-webui.ozaiUrl}' --secret_key '${config.services.ozai-webui.secretKey}' --static_folder '/share/ozai-webui/static' --template_folder '/share/ozai-webui/templates'"; + Restart = "always"; + }; }; }; - }; }; });