base | ||
editors | ||
languages | ||
LICENSES | ||
scratch | ||
screenshots | ||
.envrc | ||
.gitignore | ||
flake-module.nix | ||
flake.lock | ||
flake.lock.license | ||
flake.nix | ||
README.md |
❄️ Nix Flake base
Module that loads programs and settings for languages, editors, and the
repository. Can enable individual languages and editors in flake.nix
as
needed. For use in my projects.
⭐ Features
- 🧩
flake-parts
: Makes the Flake modular and reusable. Enables clean separation of components. - ✨
treefmt
(with Helix integration): Formats the code in this repository when modifying it. Enables features to check the Flake for consistent formatting. - ⌨️ Devshell: Clean shell management. Prints project-specific commands on launch with icons using Nerd Fonts.
- 💬 Language Server Protocol (LSP): Has language servers for defined languages. Works with Helix text editor. Defines each language's configuration in its own file. Allows for commands that launch different Helix LSP setups.
- 📝 Language tools: Checks for grammatical and styling issues using Vale,
Harper, LTeX (LanguageTool), and Typos. Centralizes the user dictionary for
these tools in
flake.nix
. Loads Vale styles specified inflake.nix
. - 🌐 qutebrowser: Launches a lightweight browser for supported languages to quickly view visual outputs.
- ⚙️ Git pre-commit hooks: Lints the files before making a commit. Supports both programming and natural languages.
- 🏛 REUSE: Simplifies software licensing and checks for errors.
💡 How it works
editors/helix
exposes a set of Nix options to write to languages.toml
. This
file defines the language servers used and the formatters. Although Helix does
not accept languages.toml
as an argument, it can read from
.helix/languages.toml
in the project directory. This setup uses a wrapper that
automatically creates this file when Helix launches.
Because some configuration options do not allow per-file configurations, a
wrapper creation script can generate Helix variations with different
configurations. For example, typst-default
launches a Helix instance where
tinymist
points to scratch/typst.typ
. typst-alt
launches a Helix instance
pointing to scratch/typst-alt.typ
.
flake-parts
allows different modules to build onto the configuration defined
in editors/helix
. Each language in languages
adds its own language
and
language-server
definitions when enabled.
🔧 Usage
Use this template.