1
Fork 0
mirror of https://github.com/thegeneralist01/config.git synced 2026-10-09 12:55:25 +02:00

aerospace: assign apps to workspaces on-window-detected

This commit is contained in:
TheGeneralist 2026-08-02 15:20:42 +02:00
parent 691dfad298
commit ff7e33c0af
Signed by: thegeneralist01
SSH key fingerprint: SHA256:pp9qddbCNmVNoSjevdvQvM5z0DHN7LTa8qBMbcMq/R4
23 changed files with 572 additions and 4 deletions

74
modules/common/llm.nix Normal file
View file

@ -0,0 +1,74 @@
{
pkgs,
config,
lib,
...
}:
let
inherit (lib) getExe;
# OpenAI-compatible extras:
# - Factory/local proxy on :8317
# - LM Studio on :1234
extraOpenAiModels = ''
- model_id: sonnet
model_name: claude-sonnet-5
api_base: "http://127.0.0.1:8317/v1"
- model_id: gpt
model_name: gpt-5.6-terra
api_base: "http://127.0.0.1:8317/v1"
- model_id: gpt-mini
model_name: gpt-5.4-mini
api_base: "http://127.0.0.1:8317/v1"
- model_id: gemini
model_name: gemini-2.5-flash
api_base: "http://127.0.0.1:8317/v1"
- model_id: lmstudio-qwen
model_name: qwen/qwen3.5-9b
api_base: "http://127.0.0.1:1234/v1"
'';
# Datasette LLM user config dir (platform default).
llmUserRelPath =
if config.isDarwin then
"Library/Application Support/io.datasette.llm"
else
".config/io.datasette.llm";
uvBin = getExe pkgs.uv;
in
{
# uv itself lives in neovim.nix home.packages; keep this module focused on the tool.
# Module must be a function so home-manager injects its `lib` (with `lib.hm.dag`).
home-manager.sharedModules = [
(
{ lib, ... }:
{
# uv tool install puts shims here
home.sessionPath = [ "$HOME/.local/bin" ];
home.file."${llmUserRelPath}/extra-openai-models.yaml" = {
text = extraOpenAiModels;
force = true;
};
# Same pattern as Volta activation: Nix declares intent, tool manager installs.
home.activation.uvToolLlm = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
export PATH="${pkgs.uv}/bin:$HOME/.local/bin:$PATH"
if [ -n "''${DRY_RUN:-}" ]; then
echo "${uvBin} tool install llm"
else
# Idempotent: installs or refreshes the uv-managed tool env + ~/.local/bin/llm
${uvBin} tool install llm
fi
'';
}
)
];
}

View file

@ -1,7 +1,6 @@
{ config, pkgs, ...}: let
subs = [
"https://cache.thegeneralist01.com/"
"https://cache.garnix.io/"
"https://cache.nixos.org/"
"https://niri.cachix.org"
];
@ -23,7 +22,6 @@ in {
extra-trusted-public-keys = [
"cache.thegeneralist01.com:jkKcenR877r7fQuWq6cr0JKv2piqBWmYLAYsYsSJnT4="
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
"niri.cachix.org-1:Wv0OmO7PsuocRKzfDoJ3mulSl7Z6oezYhGhR+3W2964="
];

40
modules/common/omp.nix Normal file
View file

@ -0,0 +1,40 @@
{ lib, ... }:
let
inherit (lib)
filterAttrs
mapAttrs'
nameValuePair
;
ompDotfiles = ../dotfiles/omp;
# Only manage named files (force=true). Does NOT take over the whole agents/
# directory, so stock `omp agents unpack` files can coexist.
filesFromDir =
relDir: targetPrefix:
let
dir = ompDotfiles + "/${relDir}";
entries = filterAttrs (_: type: type == "regular") (builtins.readDir dir);
in
mapAttrs' (
name: _:
nameValuePair "${targetPrefix}/${name}" {
source = dir + "/${name}";
force = true;
}
) entries;
in
{
home-manager.sharedModules = [
{
home.file = {
".omp/agent/AGENTS.md" = {
source = ompDotfiles + "/AGENTS.md";
force = true;
};
}
// filesFromDir "agents" ".omp/agent/agents"
// filesFromDir "prompts" ".omp/agent/prompts";
}
];
}

View file

@ -1,6 +1,9 @@
{ pkgs, lib, ... }: let
inherit (lib) optionals;
in {
environment.variables = {
GOPATH = "$HOME/go";
};
environment.systemPackages =
(with pkgs; [
wget
@ -68,6 +71,11 @@ in {
mise
go
gopls
gofumpt
delve
mosh
])
++ optionals (pkgs ? bat-extras && pkgs.bat-extras ? core) [

View file

@ -210,6 +210,7 @@ in
if command -sq mise
mise activate fish | source
end
fish_add_path $HOME/go/bin
'';
functions = {