| Crates.io | systemd-lsp |
| lib.rs | systemd-lsp |
| version | 0.2.0 |
| created_at | 2025-07-17 17:51:59.306812+00 |
| updated_at | 2026-01-17 20:38:57.969612+00 |
| description | Language Server Protocol implementation for systemd unit files |
| homepage | https://github.com/jfryy/systemd-lsp |
| repository | https://github.com/jfryy/systemd-lsp |
| max_upload_size | |
| id | 1757893 |
| size | 1,049,488 |
A Language Server Protocol (LSP) implementation for systemd unit files, providing editing support with syntax highlighting, diagnostics, autocompletion, and documentation.

cargo install systemd-lsp
The binary will be installed to ~/.cargo/bin/systemd-lsp (or %USERPROFILE%\.cargo\bin\systemd-lsp on Windows).
git clone https://github.com/jfryy/systemd-lsp.git
cd systemd-lsp
cargo build --release
The binary will be available at target/release/systemd-lsp.
The project is built using Cargo, Rust's package manager. The --release flag optimizes the build for performance. For development, you can use cargo build for faster compilation times with debug information.
Add this configuration to your Neovim setup:
-- Automatically set filetype and start LSP for systemd and Podman Quadlet unit files
vim.api.nvim_create_autocmd("BufEnter", {
pattern = {
-- systemd unit files
"*.service", "*.socket", "*.timer", "*.mount", "*.automount",
"*.swap", "*.target", "*.path", "*.slice", "*.scope", "*.device",
-- Podman Quadlet files
"*.container", "*.volume", "*.network", "*.kube", "*.pod", "*.build", "*.image"
},
callback = function()
vim.bo.filetype = "systemd"
vim.lsp.start({
name = 'systemd_ls',
cmd = { '/path/to/systemd-lsp' }, -- Update this path to your systemd-lsp binary
root_dir = vim.fn.getcwd(),
})
end,
})
With LSP, add to your vimrc
call LspAddServer([#{name: 'systemd_ls',
\ filetype: 'systemd',
\ path: 'systemd-lsp',
\ }])
(with-eval-after-load 'eglot
(add-to-list 'eglot-server-programs
'(systemd-mode "/path/to/systemd-lsp")))
Replace /path/to/systemd-lsp with the actual path to your built binary.
You can run the language server directly, although there is little reason to do so except for debugging purposes. An editor typically starts and stops the server implicitly.
./target/release/systemd-lsp
Embedded Documentation - All manual pages built into the binary
No External Dependencies - Single binary with everything included
Cross-Platform - Works on Linux, macOS, and Windows
LSP Standard Compliant - Compatible with all LSP-capable editors
This project is designed to simplify the editing of Unit files by providing validation, autocompletion, and formatting features commonly available for modern languages and file formats. Inspired by systemd-language-server, it offers enhanced functionality and improved performance, leveraging Rust's memory safety and efficiency. I don't always have a ton of time for staying up to date with all the changes that occur to systemd, so contributions or other maintainers of this language server are greatly appreciated. This language server has the somewhat unique difficulty of maintaing a large static list of directives for sections that can change on occasion rather than having the challenge of maintaining an AST for an actual programming language. Any systemD experts would be appreciated for their input, feedback, or maintaining of this language server while the latter half of bugs are squashed out.
Contributions are always encouraged and welcome. Please provide details and tests if appropriate for your changes.