From 21bcbdb89364380857d1db8f8b8bad7131c51ef6 Mon Sep 17 00:00:00 2001 From: reo101 Date: Sun, 15 Sep 2024 16:00:10 +0300 Subject: [PATCH] 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 --- hosts/nixos/jeeves/ollama.nix | 2 +- hosts/nixos/jeeves/wireguard.nix | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hosts/nixos/jeeves/ollama.nix b/hosts/nixos/jeeves/ollama.nix index 87ac9ac..5f3a822 100644 --- a/hosts/nixos/jeeves/ollama.nix +++ b/hosts/nixos/jeeves/ollama.nix @@ -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"; }; diff --git a/hosts/nixos/jeeves/wireguard.nix b/hosts/nixos/jeeves/wireguard.nix index 35c31ec..7a6e164 100644 --- a/hosts/nixos/jeeves/wireguard.nix +++ b/hosts/nixos/jeeves/wireguard.nix @@ -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" ''; };