Skip to content

PassiveLemon/nix-xl

Repository files navigation

nix-xl

Declaratively configure Lite-XL languages, plugins, and libraries.

With automatic dependency resolution, nix-xl attempts to make Lite-XL configuration as simple as possible for Nix users without the need for lpm.

Note

I have not tested every single language, plugin, and library combination so there may be incompatibilities, missing features, or other issues.

The only included features are currently from lite-xl-plugins. Any additions must have their own repository. The only architecture currently supported is x86_64-linux. Others may be supported in the future.

Usage

Nix-XL is currently only supported as a home-manager module. It will not work in a NixOS configuration.

Add the flake to your inputs:

# flake.nix
{
  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";

    nix-xl.url = "github:passivelemon/nix-xl";
  };

  outputs = { ... } @ inputs: {
    # ...
  };
}

Import the module and enable it:

# home.nix
{
  imports = [
    inputs.nix-xl.homeModules.nix-xl
  ];
  
  programs.lite-xl = {
    enable = true;
  };
}

Languages

To enable syntax highlighting for languages, use the language option:

# home.nix
{
  programs.lite-xl = {
    enable = true;
    plugins.languages.enableList = [ "nix" "yaml" "zig" ];
  };
}
  • All available languages are on the official plugin repository with the following note
    • The language name is simply just everything after language_

Plugins

To enable plugins, use the plugin option:

# home.nix
{
  programs.lite-xl = {
    enable = true;
    plugins.enableList = [ "bracketmatch" "editorconfig" "gitdiff_highlight" "treeview-extender" ];
  };
}
  • All available plugins are on the official plugin repository with the following notes:
    • Plugin names are exactly as they appear in the repository.
    • ide_* plugins are not included since they are all links to the same ide plugin.

Libraries

To enable plugins, use the plugin option:

# home.nix
{
  programs.lite-xl = {
    enable = true;
    libraries.enableList = [ "font_symbols_nerdfont_mono_regular" "tree_sitter" "widget" ];
  };
}

Todo

Core:

  • Implement languages

    • Put them into their own /plugins/languages directory and create a lua file to require them
    • External repo languages
    • Custom languages
  • Implement libraries

    • Most libraries require some package building so we need some derivations
    • External repo libraries
    • Custom libraries
  • Implement plugins

    • External repo plugins
    • Custom plugins
    • Automatic library dependencies (Implemented, but not set up for everything)

Plugins:

  • The core part of these are included in plugins but currently you have to manually add the languages

  • Evergreen

    • Need to build the shared objects so we need some derivations
    • Put Evergreen highlights into their own /plugins/evergreen_languages directory and create a lua file to require them (Similar to languages)
    • Custom languages
    • Enable plugin if languages are specified
  • LSP

    • Library deps golang haxe jdk nodejs
    • Put lsp into their own /plugins/lsp_servers directory and create a lua file to require them (Similar to languages)
    • Custom servers
    • Enable plugin if servers are specified
  • Formatter

    • Put formats into their own /plugins/formatter directory and create a lua file to require them (Similar to languages)
    • Custom formats
    • Enable plugin if formatters are specified

Fonts:

  • Defined fonts
  • Custom fonts
  • Lua file to load fonts
  • Font size option

Themes:

  • Custom themes

Config:

  • Create an init.lua file that should load the fonts, themes and other config files.

General:

  • nvfetcher to update plugin versions. Check every couple days or so since plugins aren't updated too frequently
  • Handle undefined features (eg: no fonts specified)

Later:

  • Turn Evergreen patches into patchfiles
  • Complete refactoring
    • Move all packages to their own place (keep them out of modules) and rework their output structure
  • Docs for main features, customs, evergreen, formatters, lsp servers
  • Overlay local packages to add lite-xl plugins repo so we dont have to keep defining it
  • Contributing guidelines/template
  • Descriptions on module options
  • Switch everything from fetchgit to fetchFromGitHub where applicable
  • nonicons (TODO: Build nonicons because it is not in Nixpkgs)
  • www (TODO: Finish the package. Currently can't be built)

About

Declarative Lite-XL configuration

Topics

Resources

License

Stars

Watchers

Forks