Skip to content

feat(aliases)!: add commonly used aliases by default#185

Merged
water-sucks merged 2 commits intonix-community:mainfrom
Sporif:feat-aliases-add-default
Feb 23, 2026
Merged

feat(aliases)!: add commonly used aliases by default#185
water-sucks merged 2 commits intonix-community:mainfrom
Sporif:feat-aliases-add-default

Conversation

@Sporif
Copy link
Copy Markdown
Collaborator

@Sporif Sporif commented Feb 21, 2026

Draft because the doc formatting isn't great. I'm open to any ideas on how to improve it.

@water-sucks
Copy link
Copy Markdown
Collaborator

Hmm, this is a good start.

With regards to doc formatting, it is pretty scrappy, frankly. I think I am going to replace the whole thing with just encoding the TOML values directly using the underlying pelletier/go-toml dependency that koanf itself uses, and deciding to wrap it in a large code block if it's multiline, or in an inline one if it is one line. That way we don't introduce any actually new dependencies just for serialization for docs. You can refactor your PR to reflect after I finish that tonight probably.

I do have one concern though. I am not using any of the NixOS aliases, so there should be a way to disable this, since it may come across as surprising for some longtime users of this application, and clutter up alias descriptions. This can probably come in the form of another setting, UseNixOSRebuildAliases or something similar, set to true by default.

@Sporif Sporif force-pushed the feat-aliases-add-default branch from 11b8111 to ecc2fd5 Compare February 22, 2026 15:11
@Sporif
Copy link
Copy Markdown
Collaborator Author

Sporif commented Feb 22, 2026

I added an option to disable it, but I think calling it use_default_aliases is better as we will add aliases that are not nixos-rebuild commands, e.g eval as part of #193.

I also had to format them a different way as the default for the aliases setting is now not changed.

@water-sucks
Copy link
Copy Markdown
Collaborator

I added an option to disable it, but I think calling it use_default_aliases is better as we will add aliases that are not nixos-rebuild commands

Agreed, I couldn't come up with a better name at the time LOL.

I've made a PR that normalizes the value serialization stuff; that might make your work on this much easier and you can probably remove most of the manual refactoring for formatting values in the docgen.

@Sporif Sporif force-pushed the feat-aliases-add-default branch from ecc2fd5 to 5aaaedb Compare February 23, 2026 07:29
@Sporif
Copy link
Copy Markdown
Collaborator Author

Sporif commented Feb 23, 2026

I've made a PR that normalizes the value serialization stuff; that might make your work on this much easier and you can probably remove most of the manual refactoring for formatting values in the docgen.

I had to resort to displaying the defaults in the description for use_default_aliases using a custom formatting function. I would add the default to Aliases instead, but I don't know how to make it conditional on use_default_aliases.

Copy link
Copy Markdown
Collaborator

@water-sucks water-sucks left a comment

Choose a reason for hiding this comment

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

Couple of thoughts about this, would like to hear your opinion.

@Sporif Sporif changed the title feat(aliases): add nixos-rebuild aliases by default feat(aliases)!: add commonly used aliases by default Feb 23, 2026
@Sporif Sporif marked this pull request as ready for review February 23, 2026 21:51
@water-sucks water-sucks merged commit 1097d85 into nix-community:main Feb 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants