added nix flake

This commit is contained in:
Winter 2024-07-24 22:37:17 -07:00
parent 48aab27d60
commit 45a75fc3dc
3 changed files with 79 additions and 0 deletions

22
cmark.nix Normal file
View File

@ -0,0 +1,22 @@
{ buildLuarocksPackage, fetchFromGitHub, fetchurl }:
buildLuarocksPackage {
pname = "cmark";
version = "0.30.2-1";
knownRockspec = (fetchurl {
url = "mirror://luarocks/cmark-0.30.2-1.rockspec";
sha256 = "077kvl9xa9yj0fxyyxxw43k9v9dgd5f11ax8hhxj3nx8vfs5rps8";
}).outPath;
src = fetchFromGitHub {
owner = "jgm";
repo = "cmark-lua";
rev = "0.30.2";
hash = "sha256-6Bzq0FdyqXXiL6pLDRFbULFJpowF0P6CvAw8iqFXkkQ=";
};
meta = {
homepage = "https://github.com/jgm/cmark-lua";
description = "Lua wrapper for libcmark, CommonMark Markdown parsing\
and rendering library";
license.fullName = "BSD2";
};
}

27
flake.lock Normal file
View File

@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1721562059,
"narHash": "sha256-Tybxt65eyOARf285hMHIJ2uul8SULjFZbT9ZaEeUnP8=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "68c9ed8bbed9dfce253cc91560bf9043297ef2fe",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

30
flake.nix Normal file
View File

@ -0,0 +1,30 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs, ... } @ inputs:
let
pkgs = nixpkgs.legacyPackages.x86_64-linux;
in
{
devShells.x86_64-linux.default = pkgs.mkShell {
buildInputs = [
(pkgs.lua5_1.withPackages (ps: with ps; [
(
let
buildLuarocksPackage = ps.buildLuarocksPackage;
in
pkgs.callPackage ./cmark.nix {
inherit buildLuarocksPackage;
}
)
luafilesystem
luasocket
luasec
fennel
]))
];
};
};
}