Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: move docs into nixd/ subfolder #281

Merged
merged 2 commits into from
Dec 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
.github/CODEOWNERS @inclyc

# Public documentation
/docs @Ruixi-rebirth @573
/nixd/docs @Ruixi-rebirth @573
/README.md @Ruixi-rebirth @573

# Packaging
Expand Down
25 changes: 12 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Some notable features provided by linking with the Nix library include:

![options-example](https://github.com/nix-community/nixd/assets/36667224/43e00a8e-c2e6-4598-b188-f5e95d708256)

See how to configure option system: https://github.com/nix-community/nixd/blob/main/docs/user-guide.md#options
See how to configure option system: https://github.com/nix-community/nixd/blob/main/nixd/docs/user-guide.md#options

</details>

Expand All @@ -39,7 +39,7 @@ See how to configure option system: https://github.com/nix-community/nixd/blob/m

<details><summary>Native cross-file analysis</summary>

![package](docs/images/3e4fc99c-7a20-42be-a337-d1746239c731.png)
![package](nixd/docs/images/3e4fc99c-7a20-42be-a337-d1746239c731.png)

We support goto-definition on nix derivations!
Just `Ctrl + click` to see where is a package defined.
Expand All @@ -50,52 +50,51 @@ And also for nix lambda:

![lambda-location](https://github.com/nix-community/nixd/assets/36667224/5792da0b-8152-4e51-9b0e-0387b045eeb5)

See how to configure the evaluator for cross-file analysis: https://github.com/nix-community/nixd/blob/main/docs/user-guide.md#evaluation
See how to configure the evaluator for cross-file analysis: https://github.com/nix-community/nixd/blob/main/nixd/docs/user-guide.md#evaluation

</details>

<details><summary>Handle evaluations exactly same as nix evaluator</summary>

![infinte-recursion](docs/images/9ed5e08a-e439-4b09-ba78-d83dc0a8a03f.png)
![infinte-recursion](nixd/docs/images/9ed5e08a-e439-4b09-ba78-d83dc0a8a03f.png)

</details>

<details><summary>Support *all* builtins</summary>

![eval-builtin-json](docs/images/59655838-36a8-4145-9717-f2009e0efef9.png)
![eval-builtin-json](nixd/docs/images/59655838-36a8-4145-9717-f2009e0efef9.png)

And diagnostic:

![eval-builtin-diagnostic](docs/images/f6e10994-41e4-4a03-84a2-ef275fb402fd.png)
![eval-builtin-diagnostic](nixd/docs/images/f6e10994-41e4-4a03-84a2-ef275fb402fd.png)

</details>

## Get Started

You can *try nixd without installation*.
We have tested some working & reproducible [editor environments](/editors/editors.md) and example [configurations & workspaces](/docs/examples).
We have tested some working & reproducible [editor environments](/nixd/docs/editors/editors.md) and example [configurations & workspaces](/nixd/docs/examples).

## Resources

- [Editor Setup](docs/editor-setup.md)
- [User Guide](docs/user-guide.md)
- [Configuration Examples](docs/examples)
- [Developers' Manual](docs/dev.md) (internal design, contributing):
- [Editor Setup](nixd/docs/editor-setup.md)
- [User Guide](nixd/docs/user-guide.md)
- [Configuration Examples](nixd/docs/examples)
- [Developers' Manual](nixd/docs/dev.md) (internal design, contributing):
- Project matrix room: https://matrix.to/#/#nixd:matrix.org

## Project Structure

```
.
├── default.nix
├── docs
├── editors
├── flake.lock
├── flake.nix
├── LICENSE
├── lspserver # The C++ library for writing LSP servers.
├── meson.build
├── nixd # Modularized nixd components, test suite, and tools (binary)
│ ├── docs # Documentation
│ ├── include # General header files
│ ├── lib
│ │ ├── AST # AST library for nix expressions, static analysis (rename, completion, location, range) & evaluation bindings.
Expand Down
4 changes: 2 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@
nativeBuildInputs = [
nixd
pkgs.nixpkgs-fmt
(import ./editors/nvim-lsp.nix { inherit pkgs; })
(import ./nixd/docs/editors/nvim-lsp.nix { inherit pkgs; })
];
};
devShells.vscodium = pkgs.mkShell {
nativeBuildInputs = [
nixd
pkgs.nixpkgs-fmt
(import ./editors/vscodium.nix { inherit pkgs; })
(import ./nixd/docs/editors/vscodium.nix { inherit pkgs; })
];
};
};
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions docs/editor-setup.md → nixd/docs/editor-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Please update this doc (tweaks, tricks, or how to setup for another editor)!
This is the description about how to setup your editor to use nixd.
Before you do these steps, please ensure that you have a working nixd binary.

Refer to https://github.com/nix-community/nixd/blob/main/docs/user-guide.md#installation for more information.
Refer to https://github.com/nix-community/nixd/blob/main/nixd/docs/user-guide.md#installation for more information.


### VSCode
Expand Down Expand Up @@ -50,4 +50,4 @@ A simple Emacs Lisp configuration that adds nixd to LSP Mode in the mean time is
:major-modes '(nix-mode)
:priority 0
:server-id 'nixd)))
```
```
4 changes: 2 additions & 2 deletions editors/editors.md → nixd/docs/editors/editors.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

### VSCodium

We provide a test environment with the *vscode-nix-ide* plugin, and the repository has some [configuration examples](/docs/examples) that you can try.
We provide a test environment with the *vscode-nix-ide* plugin, and the repository has some [configuration examples](/nixd/docs/examples) that you can try.

Start up the test environment:

Expand All @@ -23,7 +23,7 @@ $ nvim-lsp /tmp/test/default.nix

```

tip: If you want to configure lsp itself, see [configuration](/docs/user-guide.md#configuration), and the following tree-like directory
tip: If you want to configure lsp itself, see [configuration](/nixd/docs/user-guide.md#configuration), and the following tree-like directory

```console
# tree -a /tmp/test
Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 2 additions & 4 deletions docs/examples/README.md → nixd/docs/examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,14 @@ For vim users:
do not:

```
vi nixd/docs/examples/options/nixos/module.nix
vi nixd/nixd/docs/examples/options/nixos/module.nix
```

instead:

```
cd nixd/docs/examples/options/nixos
cd nixd/nixd/docs/examples/options/nixos
vi module.nix
```

For vscode users: please open each folder as your "workspace".


File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 2 additions & 3 deletions docs/user-guide.md → nixd/docs/user-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ nix build -L .#
### Configuration


- [Configuration Examples](/docs/examples)
- [Configuration Examples](/nixd/docs/examples)

We support LSP standard `workspace/configuration` for server configurations.

Expand Down Expand Up @@ -317,5 +317,4 @@ So tldr, to use `nixd` in your flake project, you have to:
1. Turn your project into a legacy one, by using `flake-compat`
2. Use `inclyc/flake-compat` which will not fetch git repository in nix store

We have a working example [here](/docs/examples/flake/)

We have a working example [here](/nixd/docs/examples/flake/)