feat: add nixd option completion, just-lsp config, and vscode nix settings
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
result
|
||||
.direnv
|
||||
.nixd.json
|
||||
|
||||
# Never commit plaintext secrets
|
||||
*.dec.yaml
|
||||
|
||||
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"nix.enableLanguageServer": true,
|
||||
"nix.serverPath": "nixd",
|
||||
"nix.serverSettings": {
|
||||
"nixd": {
|
||||
"formatting": {
|
||||
"command": ["nixfmt"]
|
||||
},
|
||||
"nixpkgs": {
|
||||
"expr": "import <nixpkgs> {}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -37,3 +37,14 @@ check:
|
||||
[linux]
|
||||
check:
|
||||
@nix eval .#nixosConfigurations.wsl.config.system.build.toplevel > /dev/null && echo "wsl: ok"
|
||||
|
||||
# Generate .nixd.json for nixd LSP option completion
|
||||
[macos]
|
||||
nixd host:
|
||||
@echo '{"options":{"nix-darwin":{"expr":"(builtins.getFlake (toString ./.)).darwinConfigurations.{{host}}.options"},"home-manager":{"expr":"(builtins.getFlake (toString ./.)).darwinConfigurations.{{host}}.options.home-manager.users.type.getSubOptions []"}}}' | jq . > .nixd.json
|
||||
@echo "Generated .nixd.json for {{host}}"
|
||||
|
||||
[linux]
|
||||
nixd host="wsl":
|
||||
@echo '{"options":{"nixos":{"expr":"(builtins.getFlake (toString ./.)).nixosConfigurations.{{host}}.options"},"home-manager":{"expr":"(builtins.getFlake (toString ./.)).nixosConfigurations.{{host}}.options.home-manager.users.type.getSubOptions []"}}}' | jq . > .nixd.json
|
||||
@echo "Generated .nixd.json for {{host}}"
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
{
|
||||
"$schema": "https://opencode.ai/config.json",
|
||||
"lsp": {
|
||||
"just": {
|
||||
"command": ["just-lsp"],
|
||||
"extensions": [""]
|
||||
}
|
||||
},
|
||||
"mcp": {
|
||||
"nixos": {
|
||||
"type": "local",
|
||||
|
||||
Reference in New Issue
Block a user