Skip to content

feat: add Nix flake for package distribution - #28

Merged
theDakshJaitly merged 4 commits into
mex-memory:mainfrom
PJalv:main
Apr 13, 2026
Merged

feat: add Nix flake for package distribution#28
theDakshJaitly merged 4 commits into
mex-memory:mainfrom
PJalv:main

Conversation

@PJalv

@PJalv PJalv commented Apr 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds Nix flake for installing mex without requiring npx
  • Enables direct integration into NixOS configurations

Features

  • buildNpmPackage derivation for the CLI
  • NixOS module for easy system integration (programs.mex.enable = true)
  • Dev shell with Node.js 22
  • Overlay for use in other flakes

Usage

NixOS Configuration

{
  inputs.mex.url = "github:PJalv/mex";
  
  outputs = { nixpkgs, mex, ... }: {
    nixosConfigurations.your-system = nixpkgs.lib.nixosSystem {
      modules = [
        mex.nixosModules.default
        { programs.mex.enable = true; }
      ];
    };
  };
}

Ad-hoc Usage

nix run github:PJalv/mex

Dev Shell

nix develop github:PJalv/mex

PJalv added 3 commits April 12, 2026 15:36
Enables installation via NixOS configuration without requiring npx.
Includes:
- buildNpmPackage derivation for the CLI
- NixOS module for easy system integration
- Dev shell with Node.js 22
- Overlay for use in other flakes

@theDakshJaitly theDakshJaitly left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hey @PJalv, thanks for this — nice contribution for Nix users! A few things to address before merging:

Version mismatch

flake.nix:22 hardcodes version = "0.4.0" but package.json is currently at 0.3.2. This should match. Ideally it would be derived from package.json so it doesn't drift on every release, but at minimum it needs to be 0.3.2 right now.

npmDepsHash maintenance

flake.nix:25 — this hash will break any time package-lock.json changes. Could you add a comment above it noting that? Something like:

# Update this hash when package-lock.json changes:
# nix build 2>&1 | grep 'got:' | awk '{print $2}'
npmDepsHash = "sha256-...";

Just so future contributors know what to do when the build fails.

Add result to .gitignore

nix build creates a result symlink in the project root. Should add that to .gitignore so it doesn't get accidentally committed.

Minor note

The postInstall path ($out/lib/node_modules/promexeus/templates/) uses the npm package name promexeus — that's correct today, just flagging it as something that would need updating if the package name ever changes.


Everything else looks solid — platform coverage, the NixOS module, overlay, and dev shell all follow standard patterns. Nice work.

- Use version 0.3.2 to match package.json
- Add comment explaining how to update npmDepsHash
- Add 'result' symlink to .gitignore
@PJalv

PJalv commented Apr 13, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for checking it out!
I will definitely be making sure the flake correctly reflects the current state of the package;
Already trying it out with my current AI workflow!

@theDakshJaitly theDakshJaitly left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

All review feedback addressed — version aligned to 0.3.2, npmDepsHash comment added, result in .gitignore. Looks good, thanks @PJalv!

@theDakshJaitly
theDakshJaitly merged commit 8cc0a26 into mex-memory:main Apr 13, 2026
3 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.

2 participants