mirror of
https://github.com/Alexandre1a/NixOSDots.git
synced 2026-03-10 00:09:46 +01:00
Working on the zed2 file
This commit is contained in:
parent
2dcc1291c5
commit
c6379fb2fd
@ -5,7 +5,7 @@
|
||||
imports = [
|
||||
inputs.spicetify-nix.homeManagerModules.spicetify
|
||||
../../modules/home-manager/spicetify.nix
|
||||
../../modules/common/zed.nix
|
||||
../../modules/common/zed2.nix
|
||||
];
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
};
|
||||
};
|
||||
# Zed config
|
||||
zed-custom = {
|
||||
zed-ai = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
@ -104,11 +104,6 @@ in
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
# Déclarer secrets SOPS dans HM
|
||||
sops.secrets = lib.mkIf (cfg.githubToken != null || cfg.braveSearchApiKey != null) {
|
||||
"zed/github_token" = lib.mkIf (cfg.githubToken != null) {};
|
||||
"zed/brave_api_key" = lib.mkIf (cfg.braveSearchApiKey != null) {};
|
||||
};
|
||||
|
||||
# MCP servers dynamiques
|
||||
programs.zed-ai.mcpServers = lib.mkDefault (
|
||||
@ -121,7 +116,7 @@ in
|
||||
github = lib.optionalAttrs (cfg.githubToken != null) {
|
||||
command = "npx";
|
||||
args = ["-y" "@modelcontextprotocol/server-github"];
|
||||
env = { GITHUB_PERSONAL_ACCESS_TOKEN = "$(cat ${config.sops.secrets."zed/github_token".path})"; };
|
||||
env = { GITHUB_PERSONAL_ACCESS_TOKEN = cfg.githubToken; };
|
||||
};
|
||||
|
||||
git = { command = "npx"; args = ["-y" "@modelcontextprotocol/server-git"]; };
|
||||
@ -129,7 +124,7 @@ in
|
||||
brave-search = lib.optionalAttrs (cfg.braveSearchApiKey != null) {
|
||||
command = "npx";
|
||||
args = ["-y" "@modelcontextprotocol/server-brave-search"];
|
||||
env = { BRAVE_API_KEY = "$(cat ${config.sops.secrets."zed/brave_api_key".path})"; };
|
||||
env = { BRAVE_API_KEY = cfg.braveSearchApiKey; };
|
||||
};
|
||||
} {}
|
||||
);
|
||||
@ -139,7 +134,5 @@ in
|
||||
text = builtins.toJSON zedSettings;
|
||||
};
|
||||
|
||||
# SOPS AGE keyFile portable
|
||||
programs.sops.age.keyFile = "${homeDir}/.config/sops/age/keys.txt";
|
||||
};
|
||||
}
|
||||
|
||||
@ -5,6 +5,6 @@
|
||||
defaultSopsFile = ../../secrets/secrets.yaml;
|
||||
defaultSopsFormat = "yaml";
|
||||
|
||||
age.keyFile = "${config.home.homeDirectory}/.config/sops/age/keys.txt";
|
||||
age.keyFile = "${config.home-manager.users.alex.home.homeDirectory}/.config/sops/age/keys.txt";
|
||||
};
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user