This commit is contained in:
Adrian Gunnar Lauterer 2024-09-08 03:00:34 +02:00
parent 07573f4067
commit 9876606788
4 changed files with 16 additions and 13 deletions

View File

@ -20,6 +20,7 @@
]; ];
in in
{ {
packages.x86_64-linux.default = pkgs.python3Packages.buildPythonPackage rec { packages.x86_64-linux.default = pkgs.python3Packages.buildPythonPackage rec {
pname = "ozai-webui"; pname = "ozai-webui";
version = "0.1.1"; version = "0.1.1";
@ -37,6 +38,7 @@
mkdir -p $out/lib/python3.11/site-packages/static mkdir -p $out/lib/python3.11/site-packages/static
mkdir -p $out/lib/python3.11/templates mkdir -p $out/lib/python3.11/templates
mkdir -p $out/lib/python3.11/static mkdir -p $out/lib/python3.11/static
install -Dm444 ${src}/static/* $out/share/ozai_webui/static/ install -Dm444 ${src}/static/* $out/share/ozai_webui/static/
install -Dm444 ${src}/templates/* $out/share/ozai_webui/templates/ install -Dm444 ${src}/templates/* $out/share/ozai_webui/templates/
cp -r $src/templates $out/lib/python3.11/site-packages/ozai_webui/templates cp -r $src/templates $out/lib/python3.11/site-packages/ozai_webui/templates
@ -132,8 +134,9 @@ packages.x86_64-linux.ozai-webui-run = pkgs.stdenv.mkDerivation rec {
serviceConfig = { serviceConfig = {
#ExecStart = "${self.packages.x86_64-linux.ozai-webui-run}/bin/run ${config.services.ozai-webui.host} ${toString(config.services.ozai-webui.port)} ${self.packages.x86_64-linux.default}/bin"; #ExecStart = "${self.packages.x86_64-linux.ozai-webui-run}/bin/run ${config.services.ozai-webui.host} ${toString(config.services.ozai-webui.port)} ${self.packages.x86_64-linux.default}/bin";
ExecStart = "${self.packages.x86_64-linux.ozai-webui-run}/bin/run ${config.services.ozai-webui.host} ${toString(config.services.ozai-webui.port)} ${self.packages.x86_64-linux.default}/lib/python3.11/site-packages/"; # ExecStart = "${self.packages.x86_64-linux.ozai-webui-run}/bin/run ${config.services.ozai-webui.host} ${toString(config.services.ozai-webui.port)} ${self.packages.x86_64-linux.default}/lib/python3.11/site-packages/";
#ExecStart = "${self.packages.x86_64-linux.default}/bin/ozai_webui"; # ExecStart = "${self.packages.x86_64-linux.ozai-webui}/bin/ozai-webui";
ExecStart = "${self.packages.x86_64-linux.default}/bin/ozai_webui";
Restart = "always"; Restart = "always";
}; };
}; };

2
result
View File

@ -1 +1 @@
/nix/store/22y4lw54f6yp05f6h0876m4rwfk7hi0k-ozai-webui-run-0.1.1 /nix/store/v6rmds7152d3cg3h77kjsg1kfvmgz108-ozai-webui-run-0.1.1

View File

@ -1 +0,0 @@
/nix/store/f0rv69ig250np27kqx6ag8sbyx5f05fy-python3.11-ozai-webui-0.1.1

View File

@ -221,8 +221,9 @@ def ws_message(data):
socketio.emit('move_status', response.text, room=game_id) socketio.emit('move_status', response.text, room=game_id)
def main (): def main ():
return app.run(host=ozai_webui_host, port=ozai_webui_port) # return app.run(host=ozai_webui_host, port=ozai_webui_port)
#return socketio.run(app, debug=False, host=ozai_webui_host, port=ozai_webui_port, allow_unsafe_werkzeug=True) #return socketio.run(app, debug=False, host=ozai_webui_host, port=ozai_webui_port, allow_unsafe_werkzeug=True)
return socketio.run(app, debug=False, host=ozai_webui_host, port=ozai_webui_port)
if __name__ == '__main__': if __name__ == '__main__':
main() main()