Skip to content

chore(nix): add flake for developing and building lpm#69

Open
Silzinc wants to merge 12 commits intocodebycruz:masterfrom
Silzinc:nix-flake
Open

chore(nix): add flake for developing and building lpm#69
Silzinc wants to merge 12 commits intocodebycruz:masterfrom
Silzinc:nix-flake

Conversation

@Silzinc
Copy link
Contributor

@Silzinc Silzinc commented Mar 21, 2026

I managed to build lpm with this. Now, there are a few clear issues:

  • The resulting lpm binary is injected into the devshell (I had the impression that it was necessary to dev lpm, am I correct?). If this commit is merged, I will be able to grab the flake from this github repo and have a lpm build at a fixed revision.
  • I have to go through the endeavour of fetching tarballs from lj-dist on the nix side and point luajit towards its location, because the access to internet is restricted by default in the build phase on the bash/lua side and I do not assume access to /tmp on a nix system. I will probably have to make a derivation for lj-dist and build libluajit directly instead of fetching it, though it will probably require a few changes on the Lua side.

Copy link
Owner

@codebycruz codebycruz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming this pull request isn't a WIP anymore despite the name. In the future I'll probably mark these as draft to use GitHub's functionality which might be more clear.

Just some nitpicks pretty much, I think the flake can be simplified to be smaller but it is fine as is and I don't want to redo your gen-release script, although it would be nice to simplify that since this PR will take the repo to <99% Lua usage :(

end

---@return "musl" | "gnu" | nil
local function getPlatformLibc()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the changes in this file be undone now?

flake.nix Outdated
{ self, nixpkgs, ... }:
let
platform_attrs = {
"aarch64-darwin" = {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can probably hoist the v0.7.1 into a separate variable to deduplicate code and make it easier to update

@codebycruz codebycruz changed the title feat(wip): add nix flake for developing and building lpm chore(nix): add flake for developing and building lpm Mar 24, 2026
flake.nix Outdated
with pkgs;
[
luajit
stylua
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the moment stylua isn't necessary as LuaLS' formatter is being used. Additionally, luajit is not necessary unless you're using BOOTSTRAP=1 which is no longer used in the flake

@Silzinc
Copy link
Contributor Author

Silzinc commented Mar 24, 2026

It'll certainly be back above 99% soon enough :)

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.

2 participants