Skip to content

Expose optional DB drivers in the Nix flake#178

Merged
Maxteabag merged 2 commits intomainfrom
nix-extras
Apr 18, 2026
Merged

Expose optional DB drivers in the Nix flake#178
Maxteabag merged 2 commits intomainfrom
nix-extras

Conversation

@Maxteabag
Copy link
Copy Markdown
Owner

@Maxteabag Maxteabag commented Apr 18, 2026

Supersedes #126 and fixes #154. Current flake.nix on main ships zero DB drivers — a Nix install only works for SQLite files, because there's no pipx-style post-install inject on Nix. Two separate users have reported this (#126, #154).

This:

  • Adds a makeSqlit helper with an extras list that mirrors the names in pyproject.toml's project.optional-dependencies, limited to drivers nixpkgs actually packages.
  • Default sqlit now pulls in every such extra (ssh, postgres, cockroachdb, mysql, duckdb, bigquery, snowflake, d1) so nix run works out of the box.
  • Exposes lib.makeSqlit so custom flakes can opt into a different subset: makeSqlit { extras = [ "postgres" ]; }.
  • Drivers not in nixpkgs (mssql-python, oracledb, mariadb, ibm_db, hdbcli, teradatasql, trino, presto-python-client, redshift-connector, clickhouse-connect, libsql, firebirdsql, pyathena, adbc-driver-flightsql) are noted in a single flake comment rather than as 14 no-op flags.

I don't have Nix locally — would appreciate a nix flake check on a Nix host before merging.

Currently the flake installs only core deps, so `nix run` gives a
working TUI but every DB driver except SQLite (stdlib) is missing —
users can't connect to Postgres/MySQL/etc. On a Nix install there's
no pipx-style inject, so the driver has to come from the derivation.

Add a small `makeSqlit` helper with an `extras` list that mirrors the
names in pyproject.toml's `project.optional-dependencies`, limited to
drivers packaged in nixpkgs. The default `sqlit` is unchanged; a new
`sqlit-full` variant pulls in every extra we can satisfy from nixpkgs.
Custom builds go through `lib.makeSqlit { extras = [ ... ]; }`.

Addresses the goal of #126 without the 22-flag / 500-line expansion.
Main currently ships a flake with zero DB drivers — SQLite works via
stdlib but nothing else does, and Nix users can't add drivers
post-install. Drop the no-driver default; the out-of-box derivation
now pulls in every extra nixpkgs can satisfy (ssh, postgres,
cockroachdb, mysql, duckdb, bigquery, snowflake, d1). Custom builds
still go through lib.makeSqlit { extras = [ ... ]; }.

Closes the gap reported in #126 and #154.
@Maxteabag Maxteabag merged commit 726a7ab into main Apr 18, 2026
21 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.

1 participant