feat: Use sops for getting api keys

This commit is contained in:
uttarayan21
2024-12-14 04:59:22 +05:30
parent aa3f7e4cc6
commit 7e711c8639

View File

@@ -1,4 +1,8 @@
{pkgs, ...}: let {
pkgs,
config,
...
}: let
mkMappings = mappings: mkMappings = mappings:
[] []
++ (pkgs.lib.optionals (builtins.hasAttr "normal" mappings) (mkMode mappings.normal "n")) ++ (pkgs.lib.optionals (builtins.hasAttr "normal" mappings) (mkMode mappings.normal "n"))
@@ -20,8 +24,8 @@
${lua} ${lua}
''; '';
}; };
neovim = (pkgs.nixvim.makeNixvim config) // {config = config;}; neovim = (pkgs.nixvim.makeNixvim nvim-config) // {config = nvim-config;};
config = { nvim-config = {
plugins = { plugins = {
fugitive.enable = true; fugitive.enable = true;
gitsigns.enable = true; gitsigns.enable = true;
@@ -58,8 +62,7 @@
chatgpt = { chatgpt = {
enable = true; enable = true;
settings = { settings = {
api_key_cmd = ''${pkgs.writeShellScript api_key_cmd = "cat ${config.sops.secrets."openai/api_key".path}";
"openapikey" "op item get 'OpenAI API Token' --fields label='api key' --reveal"}'';
}; };
}; };