Skip to content

feat: add Nix flake for reproducible builds#8

Open
TheCodedKid wants to merge 1 commit into
barisgit:mainfrom
TheCodedKid:feat/nix-flake
Open

feat: add Nix flake for reproducible builds#8
TheCodedKid wants to merge 1 commit into
barisgit:mainfrom
TheCodedKid:feat/nix-flake

Conversation

@TheCodedKid

@TheCodedKid TheCodedKid commented Jun 24, 2026

Copy link
Copy Markdown

What Changed

Packages KiLM as a Nix flake so it can be built, run, and installed reproducibly via Nix.

Outputs

Output Command
packages.default / .kilm nix build github:barisgit/KiLM
apps.default / .kilm nix run github:barisgit/KiLM
devShells.default nix develop (pytest + ruff)
overlays.default pkgs.kilm in a NixOS / home-manager config

Structure

Follows the two-file split (build logic kept out of the flake):

  • flake.nix — pins nixpkgs, wires the overlay, exposes outputs. No build logic.
  • pkgs/kilm.nixbuildPythonPackage (hatchling), deps, tests, via callPackage.

Notes

  • pythonRemoveDeps = ["pathlib"] — pyproject declares the dead PyPI pathlib backport; it's stdlib on py3 and absent from nixpkgs.
  • Tests need git and a writable $HOME, both wired in nativeCheckInputs / preCheck.
  • Multi-platform via flake-utils.lib.eachDefaultSystem.

Verification

  nix flake check       # all checks pass
  nix build .#kilm      # 112 tests pass
  nix run .#kilm -- --version

Changes

  • flake.nix, flake.lock, pkgs/kilm.nix — the flake
  • README.md — Nix usage section
  • .gitignore — ignore result symlinks

Summary by CodeRabbit

  • New Features

    • Added Nix support for running, building, and developing the project with nix run, nix build, and nix develop.
    • Added a Nix flake so the app can be used as a package, runnable app, or dev shell.
    • Documented how to integrate the project into NixOS and home-manager setups.
  • Chores

    • Updated ignore rules for generated Nix build outputs and templates.

Package KiLM as a Nix flake following the two-file split
(flake.nix for pinning/wiring, pkgs/kilm.nix for build logic via callPackage).

Outputs: packages.{kilm,default}, apps.{kilm,default}, devShells.default,
overlays.default. README gains a Nix usage section.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 24, 2026

Copy link
Copy Markdown

@TheCodedKid is attempting to deploy a commit to the Paxia LLC Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4380c310-0931-4f5c-8766-b967eb10d585

📥 Commits

Reviewing files that changed from the base of the PR and between 59c6077 and 5ed8f45.

⛔ Files ignored due to path filters (1)
  • flake.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • .gitignore
  • README.md
  • flake.nix
  • pkgs/kilm.nix

📝 Walkthrough

Walkthrough

Added Nix flake outputs and a KiLM package expression, documented Nix run/build/dev-shell and NixOS/home-manager usage, and updated .gitignore for templates and Nix build outputs.

Changes

Nix packaging and usage

Layer / File(s) Summary
Package derivation
pkgs/kilm.nix
Defines the KiLM Python package build expression with hatchling, runtime dependencies, test setup, and package metadata.
Flake outputs
flake.nix
Adds flake inputs, overlay wiring, package and app outputs, and the default development shell.
Docs and ignore rules
README.md, .gitignore
Adds the README Nix section and updates ignore rules for templates/, result, and result-*.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I found a flake among the clover,
and hopped on through to build it over.
Nix run, dev shell, too—hooray!
My carrots compile in a tidy way.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding a Nix flake for reproducible builds.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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