commit - 106c5083532b2fc0f296bc56f030182f6c432b06
commit + d3b08bec84ee7fff3aa0bd9b9d1306dcd10d4d47
blob - 4bc930ba52df1fb0ba2344d12e8c22ff6f74e198
blob + e74b242a8dcc3cec66d8a1da0eaaaec93d50aed3
--- flake.lock
+++ flake.lock
]
},
"locked": {
- "lastModified": 1789178892,
- "narHash": "sha256-9IcxPm9wfRIQqnVbChGNRF6PzfTRLp7iqTzKszCv5zU=",
+ "lastModified": 1789235087,
+ "narHash": "sha256-6hZ6Gy8isRQsWdI4l81Egag/PUIh68nSmFr2maInUNg=",
"owner": "nix-community",
"repo": "home-manager",
- "rev": "cd0e747f6af26cf4a699ce4b6dc1910dbe8af9a7",
+ "rev": "fe48612c5321a2cc09b0f563757a9c9733d641f8",
"type": "github"
},
"original": {
blob - 2e28e06bccf392842cf7a4ba7faf889fd9c03b8c
blob + a3f9a2790fc7e7c82358176b9d0040a0c28560c6
Binary files hosts/nixaran/configuration.nix and hosts/nixaran/configuration.nix differ
blob - 7718eb6c66b9bf05a762af0cf4bf8a629d4eaabd
blob + 3e8b715283a3f0035748bfdd8236c5f3599b67cb
--- modules/mixins/dotfiles/config/zsh/rc/llm
+++ modules/mixins/dotfiles/config/zsh/rc/llm
#!/usr/bin/env bash
paj() {
- local isolate candidates model provider rest fzf_status prov mid _
+ local isolate candidates model provider rest fzf_status pick=1 resume=
isolate=pisol
- case "${1:-}" in
- y | yikes)
- isolate=
- shift
- ;;
- esac
-
- candidates=
- {
- read -r _
- while read -r prov mid _; do
- [[ -n "${prov:-}" && -n "${mid:-}" ]] || continue
- candidates+="$prov $mid"$'\n'
- done
- } < <(pi --list-models 2>/dev/null)
- candidates=${candidates%$'\n'}
-
- model=$(printf '%s\n' "$candidates" | fzf)
- fzf_status=$?
- if [[ "$fzf_status" -eq 130 ]]; then
- return "$fzf_status"
- elif [[ "$fzf_status" -ne 0 ]]; then
- model=
- fi
-
- if [[ -n "$model" ]]; then
- case "$model" in
- *' '*)
- provider=${model%% *}
- rest=${model#* }
- set -- --provider "$provider" --model "$rest" "$@"
+ while :; do
+ case "${1:-}" in
+ y | yolo)
+ isolate=
+ shift
;;
+ r | res)
+ resume=1
+ pick=
+ shift
+ ;;
+ *)
+ break
+ ;;
esac
+ done
+ if [[ -n "$resume" ]]; then
+ set -- --resume "$@"
fi
+ if [[ -n "$pick" ]]; then
+ candidates=$(jaq -r '.enabledModels[]?' ~/.pi/agent/settings.json 2>/dev/null)
+ [[ -n "$candidates" ]] || {
+ echo 'paj: no enabledModels in ~/.pi/agent/settings.json' >&2
+ return 1
+ }
+
+ model=$(printf '%s\n' "$candidates" | fzf)
+ fzf_status=$?
+ if [[ "$fzf_status" -eq 130 ]]; then
+ return "$fzf_status"
+ elif [[ "$fzf_status" -ne 0 ]]; then
+ model=
+ fi
+
+ if [[ -n "$model" ]]; then
+ case "$model" in
+ *'/'*)
+ provider=${model%%/*}
+ rest=${model#*/}
+ set -- --provider "$provider" --model "$rest" "$@"
+ ;;
+ esac
+ fi
+ fi
+
if [[ -n "$isolate" ]]; then
"$isolate" pi "$@"
else
fi
}
-alias pajlo='paj yikes'
+alias par='paj res'
+alias parlo='par yolo'
+alias pajlo='paj yolo'
+
alias alpaq='alpaca quota'
alias alpac='alpaca compose'
blob - bf0c11a46d533fecfd42c60bfdbb74853a214d13
blob + c99bbc14c2d8a7ac28ad6521bf6361fd9f8eefc9
--- modules/services/static.nix
+++ modules/services/static.nix
};
endpoint = lib.mkOption {
type = lib.types.str;
+ default = "";
description = "Garage web endpoint (host:port); bucket is selected via the Host header";
};
+ root = lib.mkOption {
+ type = lib.types.str;
+ default = "";
+ description = "Local directory to serve with the Caddy file server; mutually exclusive with endpoint";
+ };
extraConfig = lib.mkOption {
type = lib.types.lines;
default = "";
};
config = lib.mkIf cfg.enable {
+ assertions = [
+ {
+ assertion = lib.all (opt: (opt.root == "") != (opt.endpoint == "")) (lib.attrValues cfg.domains);
+ message = "services.haravara.static.domains: each domain must set exactly one of root or endpoint";
+ }
+ ];
+
services.caddy.virtualHosts =
lib.mapAttrs' (
domain: opt: let
if opt.bucket != ""
then opt.bucket
else domain;
+ backend =
+ if opt.root != ""
+ then ''
+ root * ${opt.root}
+ file_server
+ ''
+ else ''
+ reverse_proxy ${opt.endpoint} {
+ header_up Host ${bucket}
+ }
+ '';
in
lib.nameValuePair domain {
- extraConfig =
- ''
- reverse_proxy ${opt.endpoint} {
- header_up Host ${bucket}
- }
- ''
- + opt.extraConfig;
+ extraConfig = backend + opt.extraConfig;
}
)
cfg.domains;