Skip to content

Add Nix flake - #87

Open
opdavies wants to merge 2 commits into
splitsh:masterfrom
opdavies:add-nix-flake
Open

Add Nix flake#87
opdavies wants to merge 2 commits into
splitsh:masterfrom
opdavies:add-nix-flake

Conversation

@opdavies

@opdavies opdavies commented May 6, 2026

Copy link
Copy Markdown

Add a Nix flake that creates a package using libgit2 and pkg-config.

Pinning nixpkgs to 22.11 ensures the correct version of libgit2 is used as per the README with no changed needed to the source code.

With this in place, the package can be build using nix build which creates an executable at result/bin/lite.

A dev shell can also be started with nix develop based on the package inputs.

@opdavies
opdavies force-pushed the add-nix-flake branch 2 times, most recently from 528cee8 to 9e26dcb Compare May 6, 2026 19:18
Add a Nix flake that creates a package using `libgit2` and `pkg-config`.

Pinning nixpkgs to 22.11 ensures the correct version of `libgit2` is
used as per the README with no changed needed to the source code.

With this in place, the package can be build using `nix build` which
creates an executable at `result/bin/splitsh-lite`.

A dev shell can also be started with `nix develop` based on the package
inputs.
@opdavies

opdavies commented May 6, 2026

Copy link
Copy Markdown
Author

Tested with nix run github:opdavies/splitsh-lite/add-nix-flake and nix shell github:opdavies/splitsh-lite/add-nix-flake.

Expose the splitsh-lite package as `default.nix` so the repository can
be consumed with `flake = false`. This keeps `flake.nix` as a
development-only interface and avoids pulling development dependencies
into consuming repositories.

Update `flake.nix` to build the package with `pkgs.callPackage ./. { }`.
@opdavies

opdavies commented Aug 13, 2026

Copy link
Copy Markdown
Author

Update: expose the package via default.nix for flake = false consumption

What changed

  • Extracted the splitsh-lite package definition from flake.nix into a new
    default.nix at the repository root.
  • Updated flake.nix to build the package with pkgs.callPackage ./. { }.

Why this is better

flake.nix is now a development-only interface: it still provides the dev
shell, the build, and the formatter, but it is no longer the mechanism by
which other repositories consume splitsh-lite.

Instead, the package is exposed as a plain default.nix. This follows the
flake = false convention used by projects such as mightyiam/files: the
repository can be added as a non-flake input, so consumers do not inherit its
development dependencies or its flake outputs.

Consumers can now use the tool directly with standard Nix:

inputs.splitsh-lite = {
  url = "github:splitsh/lite";
  flake = false;
};

environment.systemPackages = [
  (pkgs.callPackage inputs.splitsh-lite {})
];

This keeps the interface minimal. The consumer decides where the package
belongs, whether that is environment.systemPackages, home.packages,
a dev shell, or somewhere else. No NixOS module, Home Manager module, or
enable option is required.

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