added ozai

This commit is contained in:
Adrian Gunnar Lauterer 2024-05-29 19:33:24 +02:00
parent 92c6e605b4
commit 69e23e5624
4 changed files with 349 additions and 20 deletions

335
flake.lock generated
View File

@ -1,5 +1,48 @@
{
"nodes": {
"devenv": {
"inputs": {
"flake-compat": "flake-compat_2",
"nix": "nix",
"nixpkgs": "nixpkgs_4",
"pre-commit-hooks": "pre-commit-hooks"
},
"locked": {
"lastModified": 1706018268,
"narHash": "sha256-d24+re0t8b6HYGzAPZCIJed85n23RUFXQa2yuHoW0uQ=",
"owner": "cachix",
"repo": "devenv",
"rev": "ad0ae333b210e31237e1fc4a7ddab71a01785add",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "devenv",
"type": "github"
}
},
"fenix": {
"inputs": {
"nixpkgs": [
"ozai",
"nixpkgs"
],
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1706336364,
"narHash": "sha256-mJ5i2YIVKv6jTN2+l3oOUUej2NUVjJX/H3bAq6019ks=",
"owner": "nix-community",
"repo": "fenix",
"rev": "eb683549b7d76b12d1a009f888b91b70ed34485f",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "fenix",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
@ -16,6 +59,22 @@
"type": "github"
}
},
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
@ -34,6 +93,47 @@
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1685518550,
"narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"ozai",
"devenv",
"pre-commit-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1660459072,
"narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "a20de23b925fd8264fd7fad6454652e142fd7f73",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
@ -41,11 +141,11 @@
]
},
"locked": {
"lastModified": 1715381426,
"narHash": "sha256-wPuqrAQGdv3ISs74nJfGb+Yprm23U/rFpcHFFNWgM94=",
"lastModified": 1716729592,
"narHash": "sha256-Y3bOjoh2cFBqZN0Jw1zUdyr7tjygyxl2bD/QY73GZP0=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "ab5542e9dbd13d0100f8baae2bc2d68af901f4b4",
"rev": "2c78a57c544dd19b07442350727ced097e1aa6e6",
"type": "github"
},
"original": {
@ -55,6 +155,22 @@
"type": "github"
}
},
"lowdown-src": {
"flake": false,
"locked": {
"lastModified": 1633514407,
"narHash": "sha256-Dw32tiMjdK9t3ETl5fzGrutQTzh2rufgZV4A/BbxuD4=",
"owner": "kristapsdz",
"repo": "lowdown",
"rev": "d2c2b44ff6c27b936ec27358a2653caaef8f73b8",
"type": "github"
},
"original": {
"owner": "kristapsdz",
"repo": "lowdown",
"type": "github"
}
},
"matrix-synapse-next": {
"inputs": {
"nixpkgs": "nixpkgs"
@ -73,6 +189,31 @@
"type": "github"
}
},
"nix": {
"inputs": {
"lowdown-src": "lowdown-src",
"nixpkgs": [
"ozai",
"devenv",
"nixpkgs"
],
"nixpkgs-regression": "nixpkgs-regression"
},
"locked": {
"lastModified": 1676545802,
"narHash": "sha256-EK4rZ+Hd5hsvXnzSzk2ikhStJnD63odF7SzsQ8CuSPU=",
"owner": "domenkozar",
"repo": "nix",
"rev": "7c91803598ffbcfe4a55c44ac6d49b2cf07a527f",
"type": "github"
},
"original": {
"owner": "domenkozar",
"ref": "relaxed-flakes",
"repo": "nix",
"type": "github"
}
},
"nix-minecraft": {
"inputs": {
"flake-compat": "flake-compat",
@ -80,11 +221,11 @@
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1715995260,
"narHash": "sha256-3ASn2z6I9RL4ws4D6paZdVv1Z2UVBa0hxx+BhRON9/Q=",
"lastModified": 1716995137,
"narHash": "sha256-hEn9737jS0d12ubAUYh1N209LABdEgEouroPLfWpUC0=",
"owner": "Infinidoge",
"repo": "nix-minecraft",
"rev": "0e7e9e6919e4082f7add31892d1864e9d8fd6e8d",
"rev": "7ae2611869c843e6f62cab97a1a8a97944984022",
"type": "github"
},
"original": {
@ -108,13 +249,45 @@
"type": "indirect"
}
},
"nixpkgs-stable": {
"nixpkgs-regression": {
"locked": {
"lastModified": 1715458492,
"narHash": "sha256-q0OFeZqKQaik2U8wwGDsELEkgoZMK7gvfF6tTXkpsqE=",
"lastModified": 1643052045,
"narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "8e47858badee5594292921c2668c11004c3b0142",
"rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2",
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1685801374,
"narHash": "sha256-otaSUoFEMM+LjBI1XL/xGB5ao6IwnZOXc47qhIgJe8U=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "c37ca420157f4abc31e26f436c1145f8951ff373",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-23.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-stable_2": {
"locked": {
"lastModified": 1716655032,
"narHash": "sha256-kQ25DAiCGigsNR/Quxm3v+JGXAEXZ8I7RAF4U94bGzE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "59a450646ec8ee0397f5fa54a08573e8240eb91f",
"type": "github"
},
"original": {
@ -142,11 +315,11 @@
},
"nixpkgs_3": {
"locked": {
"lastModified": 1715948915,
"narHash": "sha256-dxMrggEogQuJQr6f02VAFtsSNtjEPkgxczeiyW7WOQc=",
"lastModified": 1716633019,
"narHash": "sha256-xim1b5/HZYbWaZKyI7cn9TJCM6ewNVZnesRr00mXeS4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "bacb8503d3a51d9e9b52e52a1ba45e2c380ad07d",
"rev": "9d29cd266cebf80234c98dd0b87256b6be0af44e",
"type": "github"
},
"original": {
@ -156,29 +329,136 @@
"type": "github"
}
},
"nixpkgs_4": {
"locked": {
"lastModified": 1678875422,
"narHash": "sha256-T3o6NcQPwXjxJMn2shz86Chch4ljXgZn746c2caGxd8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "126f49a01de5b7e35a43fd43f891ecf6d3a51459",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"ozai": {
"inputs": {
"devenv": "devenv",
"fenix": "fenix",
"nixpkgs": [
"unstable"
]
},
"locked": {
"lastModified": 1712434594,
"narHash": "sha256-Ct0StUM5GLxtA1NGhwekDbT0JLSrjwAmsXAODrjI9G4=",
"ref": "refs/heads/main",
"rev": "9844e6890892d22ac6c1164a6c6a18c4de6b2832",
"revCount": 27,
"type": "git",
"url": "https://git.pvv.ntnu.no/Projects/ozai.git"
},
"original": {
"type": "git",
"url": "https://git.pvv.ntnu.no/Projects/ozai.git"
}
},
"ozai-webui": {
"inputs": {
"nixpkgs": [
"unstable"
]
},
"locked": {
"lastModified": 1717002624,
"narHash": "sha256-HgPu7+J2wAAil7741FovwR5h180f1mn+h3PbPsgSjwY=",
"ref": "refs/heads/main",
"rev": "a624e3013fab375f2741957070c116638fd99fe6",
"revCount": 18,
"type": "git",
"url": "https://git.pvv.ntnu.no/adriangl/ozai-webui.git"
},
"original": {
"type": "git",
"url": "https://git.pvv.ntnu.no/adriangl/ozai-webui.git"
}
},
"pre-commit-hooks": {
"inputs": {
"flake-compat": [
"ozai",
"devenv",
"flake-compat"
],
"flake-utils": "flake-utils_2",
"gitignore": "gitignore",
"nixpkgs": [
"ozai",
"devenv",
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1704725188,
"narHash": "sha256-qq8NbkhRZF1vVYQFt1s8Mbgo8knj+83+QlL5LBnYGpI=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "ea96f0c05924341c551a797aaba8126334c505d2",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"type": "github"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"matrix-synapse-next": "matrix-synapse-next",
"nix-minecraft": "nix-minecraft",
"nixpkgs": "nixpkgs_3",
"ozai": "ozai",
"ozai-webui": "ozai-webui",
"sops-nix": "sops-nix",
"unstable": "unstable"
}
},
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1706295183,
"narHash": "sha256-VSyMaUsXfjb31B8/uT5cM5qXC1VOHLVsCi/bQuo3O/g=",
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "596e5c77cf5b2b660b3ac2ce732fa0596c246d9b",
"type": "github"
},
"original": {
"owner": "rust-lang",
"ref": "nightly",
"repo": "rust-analyzer",
"type": "github"
}
},
"sops-nix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
"nixpkgs-stable": "nixpkgs-stable_2"
},
"locked": {
"lastModified": 1715482972,
"narHash": "sha256-y1uMzXNlrVOWYj1YNcsGYLm4TOC2aJrwoUY1NjQs9fM=",
"lastModified": 1716692524,
"narHash": "sha256-sALodaA7Zkp/JD6ehgwc0UCBrSBfB4cX66uFGTsqeFU=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "b6cb5de2ce57acb10ecdaaf9bbd62a5ff24fa02e",
"rev": "962797a8d7f15ed7033031731d0bb77244839960",
"type": "github"
},
"original": {
@ -202,13 +482,28 @@
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"unstable": {
"locked": {
"lastModified": 1715961556,
"narHash": "sha256-+NpbZRCRisUHKQJZF3CT+xn14ZZQO+KjxIIanH3Pvn4=",
"lastModified": 1716769173,
"narHash": "sha256-7EXDb5WBw+d004Agt+JHC/Oyh/KTUglOaQ4MNjBbo5w=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "4a6b83b05df1a8bd7d99095ec4b4d271f2956b64",
"rev": "9ca3f649614213b2aaf5f1e16ec06952fe4c2632",
"type": "github"
},
"original": {

View File

@ -8,7 +8,13 @@
home-manager.url = "github:nix-community/home-manager/release-23.11";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
ozai.url = "git+https://git.pvv.ntnu.no/Projects/ozai.git";
ozai.inputs.nixpkgs.follows = "unstable";
ozai-webui.url = "git+https://git.pvv.ntnu.no/adriangl/ozai-webui.git";
ozai-webui.inputs.nixpkgs.follows = "unstable";
matrix-synapse-next.url = "github:dali99/nixos-matrix-modules";
nix-minecraft.url = "github:Infinidoge/nix-minecraft";
sops-nix.url = "github:Mic92/sops-nix";
@ -19,6 +25,8 @@
self
, home-manager
, matrix-synapse-next
, ozai
, ozai-webui
, nix-minecraft
, nixpkgs
, sops-nix
@ -74,6 +82,9 @@
({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; })
./machines/galadriel/configuration.nix
sops-nix.nixosModules.sops
ozai.nixosModules.ozai
ozai-webui.nixosModules.ozai-webui
];
};

View File

@ -22,6 +22,7 @@
../../services/wordpress.nix
../../services/torrent.nix
../../services/mc.nix
../../services/ozai.nix
#../../services/stableDiffusion.nix
../../services/rss.nix
../../services/shiori.nix

22
services/ozai.nix Normal file
View File

@ -0,0 +1,22 @@
{ config, pkgs, lib, ... }:
{
services.ozai.enable = true;
services.ozai.host = "0.0.0.0";
services.ozai.port = 8000;
services.ozai-webui = {
enable = true;
port = 8085;
host = "0.0.0.0";
};
services.nginx.virtualHosts."ozai.${config.networking.hostName}.${config.networking.domain}" = {
forceSSL = true;
#useACMEHost = config.networking.domain; #not sure if this will work, unless
locations."/" = {
proxyWebsockets = true;
proxyPass = "http://${config.services.ozai.host}:${config.services.ozai.port}";
};
};
}