mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 08:43:00 +00:00
fix(aichat): read from envvar
This commit is contained in:
parent
2d4452d900
commit
4053e59e2e
4 changed files with 56 additions and 30 deletions
|
|
@ -92,6 +92,11 @@ in {
|
|||
app-id = "firefox$";
|
||||
title = "^Picture-in-Picture$";
|
||||
}
|
||||
# Anki add new flashcard
|
||||
{
|
||||
app-id = "^anki$";
|
||||
title = "^Add$";
|
||||
}
|
||||
];
|
||||
open-floating = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,34 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
home.packages = with pkgs; [
|
||||
sops
|
||||
];
|
||||
}: let
|
||||
secretPaths = {
|
||||
OPENROUTER_API_KEY = config.sops.secrets."OPENROUTER_API_KEY".path;
|
||||
TAVILY_API_KEY = config.sops.secrets."TAVILY_API_KEY".path;
|
||||
};
|
||||
|
||||
posixInit = builtins.concatStringsSep "\n" (
|
||||
lib.mapAttrsToList (name: path: ''
|
||||
if [ -r "${path}" ]; then
|
||||
export ${name}="$(< ${path})"
|
||||
fi
|
||||
'')
|
||||
secretPaths
|
||||
);
|
||||
|
||||
fishInit = builtins.concatStringsSep "\n" (
|
||||
lib.mapAttrsToList (name: path: ''
|
||||
if test -r ${path}
|
||||
set -gx ${name} (< ${path})
|
||||
end
|
||||
'')
|
||||
secretPaths
|
||||
);
|
||||
in {
|
||||
home.packages = [pkgs.sops];
|
||||
sops = {
|
||||
# enable = true;
|
||||
defaultSopsFile = ../../../secrets/secrets.yaml;
|
||||
age.keyFile = "${config.xdg.configHome}/sops/age/keys.txt";
|
||||
age.generateKey = true;
|
||||
|
|
@ -21,8 +42,9 @@
|
|||
};
|
||||
};
|
||||
|
||||
home.sessionVariables = {
|
||||
OPENROUTER_API_KEY = "$(cat ${config.sops.secrets."OPENROUTER_API_KEY".path})";
|
||||
TAVILY_API_KEY = "$(cat ${config.sops.secrets."TAVILY_API_KEY".path})";
|
||||
programs = {
|
||||
zsh.initContent = posixInit;
|
||||
bash.bashrcExtra = posixInit;
|
||||
fish.interactiveShellInit = fishInit;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue