Working on the zed2 file

This commit is contained in:
Alexandre 2025-12-28 01:29:07 +01:00
parent 2dcc1291c5
commit c6379fb2fd
3 changed files with 5 additions and 12 deletions

View File

@ -5,7 +5,7 @@
imports = [ imports = [
inputs.spicetify-nix.homeManagerModules.spicetify inputs.spicetify-nix.homeManagerModules.spicetify
../../modules/home-manager/spicetify.nix ../../modules/home-manager/spicetify.nix
../../modules/common/zed.nix ../../modules/common/zed2.nix
]; ];
@ -21,7 +21,7 @@
}; };
}; };
# Zed config # Zed config
zed-custom = { zed-ai = {
enable = true; enable = true;
}; };
}; };

View File

@ -104,11 +104,6 @@ in
}; };
config = lib.mkIf cfg.enable { 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 # MCP servers dynamiques
programs.zed-ai.mcpServers = lib.mkDefault ( programs.zed-ai.mcpServers = lib.mkDefault (
@ -121,7 +116,7 @@ in
github = lib.optionalAttrs (cfg.githubToken != null) { github = lib.optionalAttrs (cfg.githubToken != null) {
command = "npx"; command = "npx";
args = ["-y" "@modelcontextprotocol/server-github"]; 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"]; }; git = { command = "npx"; args = ["-y" "@modelcontextprotocol/server-git"]; };
@ -129,7 +124,7 @@ in
brave-search = lib.optionalAttrs (cfg.braveSearchApiKey != null) { brave-search = lib.optionalAttrs (cfg.braveSearchApiKey != null) {
command = "npx"; command = "npx";
args = ["-y" "@modelcontextprotocol/server-brave-search"]; 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; text = builtins.toJSON zedSettings;
}; };
# SOPS AGE keyFile portable
programs.sops.age.keyFile = "${homeDir}/.config/sops/age/keys.txt";
}; };
} }

View File

@ -5,6 +5,6 @@
defaultSopsFile = ../../secrets/secrets.yaml; defaultSopsFile = ../../secrets/secrets.yaml;
defaultSopsFormat = "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";
}; };
} }