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

README: Add installation and integration docs #243

Merged
merged 3 commits into from
Aug 29, 2024
Merged

Conversation

dasJ
Copy link
Member

@dasJ dasJ commented Aug 28, 2024

No description provided.

Copy link

github-actions bot commented Aug 28, 2024

Nixpkgs diff

@dasJ dasJ force-pushed the feat/install-instructions branch from 0887200 to 44b3e27 Compare August 28, 2024 10:55
@dasJ dasJ linked an issue Aug 28, 2024 that may be closed by this pull request
Copy link
Member

@infinisil infinisil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor improvements, but this is great!

Feel free to merge yourself when addressed :)

README.md Outdated
### treefmt

[treefmt](https://github.com/numtide/treefmt) can be used to format repositories consisting of different languages with one command.
A possible configuration for `nixfmt` in `.treefmt.toml` looks like this:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
A possible configuration for `nixfmt` in `.treefmt.toml` looks like this:
A possible configuration for `nixfmt` in `treefmt.toml` looks like this:

README.md Outdated
Comment on lines 21 to 23
`nixfmt` was used as the basis for the official Nix formatter with a standardized formatting.
The new formatting differs considerably from the original one.
This is why two packages are in nixpkgs: `nixfmt-classic` with the non-standardized formatting and `nixfmt-rfc-style`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`nixfmt` was used as the basis for the official Nix formatter with a standardized formatting.
The new formatting differs considerably from the original one.
This is why two packages are in nixpkgs: `nixfmt-classic` with the non-standardized formatting and `nixfmt-rfc-style`.
A recent nixfmt version is available as `pkgs.nixfmt-rfc-style` in Nixpkgs. The formatting of this version differs considerably from the original nixfmt that was used as the basis for the standardised official formatter, which is also still available as `pkgs.nixfmt-classic` for now, though unmaintained.

Just a rewording to make the distinction clearer

README.md Outdated
### From the repository

It's also possible to install `nixfmt` directly from the repository using `nix-env`.
This allows the newest changes to be used, which may not be equal to the `nixfmt` version used to format nixpkgs, so this should be done with care!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This applies to all methods here. I think there should be an additional section referring to how the nix-shell in Nixpkgs provides the correct version for Nixpkgs. Alternatively, let's just drop this sentence, otherwise it implies the above would be the correct version. As an upstream project we shouldn't really have to document downstream uses.

Suggested change
This allows the newest changes to be used, which may not be equal to the `nixfmt` version used to format nixpkgs, so this should be done with care!

README.md Outdated
}
```

More information about configuration can be found in [the official README](https://github.com/numtide/treefmt-nix?tab=readme-ov-file#integration-into-nix).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
More information about configuration can be found in [the official README](https://github.com/numtide/treefmt-nix?tab=readme-ov-file#integration-into-nix).
More information about configuration can be found in [the README](https://github.com/numtide/treefmt-nix?tab=readme-ov-file#integration-into-nix).

Just a minor precaution, we don't want people to think that treefmt is also an official Nix project.

README.md Outdated
Comment on lines 48 to 56
```
{
outputs = { nixpkgs, self }: {
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-rfc-style;
};
}
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```
{
outputs = { nixpkgs, self }: {
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-rfc-style;
};
}
```
```nix
{
outputs =
{ nixpkgs, self }:
{
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-rfc-style;
};
}
```

We should adhere to our own formatting :P

@dasJ dasJ force-pushed the feat/install-instructions branch from 3c967d0 to 19b8be8 Compare August 29, 2024 07:41
@dasJ dasJ linked an issue Aug 29, 2024 that may be closed by this pull request
7 tasks
@dasJ dasJ force-pushed the feat/install-instructions branch 2 times, most recently from 0f4cbcf to e4033f6 Compare August 29, 2024 07:49
@dasJ dasJ force-pushed the feat/install-instructions branch from 469aa5b to 3d18524 Compare August 29, 2024 17:08
@dasJ dasJ merged commit 625158a into master Aug 29, 2024
2 checks passed
@dasJ dasJ deleted the feat/install-instructions branch August 29, 2024 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add usage instructions for different tools to README Help setup with nixld and Neovim
2 participants