Skip to content

Instantly share code, notes, and snippets.

@toyboot4e
Created July 12, 2025 08:21
Show Gist options
  • Select an option

  • Save toyboot4e/354a2b60f8145956ffe808bdc9cedbe0 to your computer and use it in GitHub Desktop.

Select an option

Save toyboot4e/354a2b60f8145956ffe808bdc9cedbe0 to your computer and use it in GitHub Desktop.
LunarML setup with flake.nix
{
description = "A basic flake with a shell";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{
nixpkgs,
flake-utils,
...
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs {
inherit system;
};
lunarmlBin = pkgs.writeShellScriptBin "lunarml" ''
exec "${pkgs.lunarml}/bin/lunarml" -B "${pkgs.lunarml}/lib/lunarml" "$@"
'';
in
{
devShells.default =
pkgs.mkShell {
packages = [
lunarmlBin
];
env = {
SML_LIB = "${pkgs.lunarml}/lib/lunarml/ml";
};
};
}
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment