feat: Use sops for getting api keys
This commit is contained in:
@@ -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"}'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user