Skip to content

fix(nix): link the system sqlite - #50

Merged
kleinbem merged 1 commit into
mainfrom
system-sqlite
Nov 11, 2026
Merged

kleinbem merged 1 commit into
mainfrom
system-sqlite

Conversation

@kleinbem

@kleinbem kleinbem commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

nixpkgs' cargo setup hook now sets LIBSQLITE3_SYS_USE_PKG_CONFIG=1 (NixOS/nixpkgs#570938), so libsqlite3-sys (through sqlx) links the system sqlite. revue has no sqlite build input, so the link fails with cannot find -lsqlite3, which stops kleinbem/nix-config's nixos-nvme build.

Adds pkgs.sqlite to buildInputs. It's the only crate in Cargo.lock that the hook switches to a system library.

Tested: nix build .#default against nixpkgs f4a03c0 (what kleinbem/nix-config locks) builds; it failed at the link before.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated the build configuration for the Rust package. This supports builds that require SQLite and does not change the app’s user-facing features.

nixpkgs' cargo setup hook now sets LIBSQLITE3_SYS_USE_PKG_CONFIG=1, so
libsqlite3-sys (via sqlx) needs sqlite as a build input; without it the
link fails with 'cannot find -lsqlite3' and takes nixos-nvme's build down.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kleinbem
kleinbem enabled auto-merge (squash) November 11, 2026 13:11
@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Rust package derivation in flake.nix adds pkgs.sqlite to its build inputs. The existing pkg-config native build input remains unchanged.

Changes: Nix build dependency

Layer / File(s) Summary
SQLite build input
flake.nix
The Rust package derivation adds pkgs.sqlite to buildInputs. The existing pkg-config native build input remains unchanged.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Bug fix

Possibly related PRs

  • kleinbem-dev/revue#20: This PR adds the SQLite build dependency used by the SQLx-backed SQLite implementation.
Merge Risk: Minimal · up to 1ccf1

This change supplies SQLite to the Nix build so the Rust package links successfully. It does not change runtime behavior, and no merge-blocking risk was identified.

Architecture risk: Low · up to 1ccf1

The change affects 1 system.

Changed systems: flake.nix

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — flake.nix (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in flake.nix: The Rust package derivation adds pkgs.sqlite to buildInputs; the existing pkg-config native build input remains unchanged.
Pre-merge checks: Passed 5

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly identifies the main change: adding the system SQLite dependency for Nix builds.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Central YAML; Path: .coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 58e0b547-1dfa-4bd3-8e2a-aec50a3befe2
Commits

Reviewing files that changed from the base of the PR and between 712e5b8 and 1ccf116.

Files selected for processing: 1

  • flake.nix

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.

@kleinbem
kleinbem merged commit e23f2a0 into main Nov 11, 2026
6 checks passed
@kleinbem
kleinbem deleted the system-sqlite branch November 11, 2026 13:17
kleinbem added a commit that referenced this pull request Nov 11, 2026
Since #25, `services.revue.user = "martin"` makes the module add
`environment.persistence."/nix/persist".users.martin.directories = [
".local/share/revue" ]`. On kleinbem/nix-config's nixos-nvme, `/home` is
a real filesystem, so impermanence fails the evaluation:

```
- environment.persistence:
    All filesystems used for ephemeral storage must
    have the option "neededForBoot" set to true.
    Please fix the following filesystems:
      /home
```

So nix-config can't move its revue input past #24 at all, and the sqlite
fix in #50 can't reach nixos-nvme.

A user's state lives in their home, and persisting that is the host's
job. The module now only persists `/var/lib/private/revue` (the
DynamicUser case).

Tested: kleinbem/nix-config's nixos-nvme, container-factory and
container-factory-aarch64 evaluate with this branch; nixos-nvme failed
with main. `nix flake check --no-build` passes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Bug Fixes**
* Application state persistence now reflects the configured user: setups
without a configured user retain private application state, while
configured-user setups rely on the home directory for user state. This
avoids declaring separate persistence for user state that the host
manages through its home-directory configuration.
* **Documentation**
* Clarified where Revue stores state in each configuration and added an
example of persisting user state with impermanence.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
kleinbem added a commit to kleinbem/nix-detour-fleet that referenced this pull request Nov 11, 2026
…m libraries (#21)

nixpkgs' cargo setup hook now makes `*-sys` crates link system libraries
(`AWS_LC_SYS_USE_SYSTEM`, `LIBSQLITE3_SYS_USE_PKG_CONFIG`,
`ZSTD_SYS_USE_PKG_CONFIG`, …; tracking: NixOS/nixpkgs#570938). Five
packages in nixos-nvme's closure lack those build inputs and fail, so
`just dev::apply` can't build the system.

| Package | Fixed where | Override |
|---|---|---|
| goose-cli | nixpkgs master NixOS/nixpkgs@2f16d1a4f7 |
`overrides/goose-cli.nix`: aws-lc, oniguruma, sqlite, zstd (the upstream
fix) |
| newsflash | nixpkgs master NixOS/nixpkgs@a8a0d9e4d2 |
`overrides/rust-system-libs.nix` |
| berd, mesh-llm, buzz-app | heads of NixOS/nixpkgs#580616, #571722,
#577918 (nix-packages pins older commits) |
`overrides/rust-system-libs.nix` |

nixos-unstable has been stuck at 2026-11-07, so the master fixes aren't
in it; the release workflow drops these once it builds them.
`rust-system-libs.nix` adds aws-lc, openssl, sqlite and zstd plus
pkg-config (the libraries these crates use; extra ones are harmless).

Tested:
- nixos-nvme built with these holds, `--keep-going`, on x86_64:
goose-cli, newsflash, berd and revue (with kleinbem-dev/revue#50) built;
mesh-llm and buzz-app are past the failing build scripts and still
linking at the time of writing.
- nix-detour's reach check (kleinbem-dev/nix-detour#66): every hold
reaches nixos-nvme, no unheld copies left.
- `checks.held-packages` passes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Chores**
* Added version holds for `berd`, `buzz-app`, `buzz-cli`, `goose-cli`,
`mesh-llm` and `newsflash`.
* Updated build requirements for `goose-cli` and other Rust-based
packages to include system libraries and package-configuration tooling.
* Reordered the existing `buzz-cli` hold in the package holds list; its
details remain unchanged. These updates affect package maintenance and
build configuration, with no changes to user-facing features or
behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
kleinbem added a commit to kleinbem/nix-config that referenced this pull request Nov 11, 2026
#753)

Bumps `revue` from kleinbem-dev/revue@3c2c36d to @be5c0ab.

- kleinbem-dev/revue#50: revue links the system sqlite. nixpkgs' cargo
hook now sets `LIBSQLITE3_SYS_USE_PKG_CONFIG=1`, and without sqlite the
build fails with `cannot find -lsqlite3`, which stops nixos-nvme's `just
dev::apply`.
- kleinbem-dev/revue#51: the module no longer persists
`/home/<user>/.local/share/revue` through impermanence. With any revue
after #24, nixos-nvme failed the `neededForBoot` assertion for `/home`,
so this input couldn't move at all.

Its other changes since 3c2c36d are revue's own (reviewer, web, CI).

Tested: nixos-nvme, container-factory and container-factory-aarch64
evaluate with this lock, and revue (with #50) builds on nixpkgs f4a03c0.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <[email protected]>
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