Status: Very rough.
This is a nix flake that runs LibreTranslate as a local service.
To enable it in a flake.nix:
...
inputs.LibreTranslate.url = "github:jcumming/LibreTranslate-flake";
...
outputs = { self, nixpkgs, LibreTranslate, ... }:
nixosConfigurations.vane = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = attrs;
modules = [./machines/vane/configuration.nix LibreTranslate.nixosModules.default];
};
And configure it in configuration.nix:
services.libretranslate = {
enable = true;
debug = true;
host = "127.0.0.1";
port = 5000;
};
To require API Keys:
services.libretranslate = {
enable = true;
debug = true;
host = "127.0.0.1";
port = 5000;
req-limit = 0;
api-keys = true;
api-keyFiles = [ sops.xxx sops.yyy ];
};
- systemd unit
- options
- enable testing somehow?
- perhaps by providing packages for the models?
- local testing
- api key testing
- update api-key configuration to be a list of attrsets [ { key=; req-limit=; } ]
- sample nginx config
- upstream this flake into the LibreTranslate Repo