style(jeeves): improve nix usage in ollama and wireguard modules

- Update `OLLAMA_API_BASE_URL` to use the port from `config.services.ollama.port` in `ollama` module
- Replace direct calls to `wg` command with `lib.getExe'` to in `wireguard` module
This commit is contained in:
reo101 2024-09-15 16:00:10 +03:00
parent 2b8287dca8
commit 21bcbdb893
Signed by: reo101
GPG key ID: 675AA7EF13964ACB
2 changed files with 3 additions and 3 deletions

View file

@ -32,7 +32,7 @@
DO_NOT_TRACK = "True";
SCARF_NO_ANALYTICS = "True";
TRANSFORMERS_CACHE = "${config.services.open-webui.stateDir}/cache";
OLLAMA_API_BASE_URL = "http://127.0.0.1:11434";
OLLAMA_API_BASE_URL = "http://127.0.0.1:${builtins.toString config.services.ollama.port}";
# Disable authentication
WEBUI_AUTH = "False";
};

View file

@ -15,8 +15,8 @@
rekeyFile = "${inputs.self}/secrets/home/jeeves/wireguard/key.age";
generator = {
script = { lib, pkgs, file, ... }: /* bash */ ''
priv=$(${pkgs.wireguard-tools}/bin/wg genkey)
${pkgs.wireguard-tools}/bin/wg pubkey <<< "$priv" > ${lib.escapeShellArg (lib.removeSuffix ".age" file + ".pub")}
priv=$(${lib.getExe' pkgs.wireguard-tools "wg"} genkey)
${lib.getExe' pkgs.wireguard-tools "wg"} pubkey <<< "$priv" > ${lib.escapeShellArg (lib.removeSuffix ".age" file + ".pub")}
echo "$priv"
'';
};