From 45a75fc3dccea2c52db27a5fedeb2bf10372c60e Mon Sep 17 00:00:00 2001 From: Winter Date: Wed, 24 Jul 2024 22:37:17 -0700 Subject: [PATCH] added nix flake --- cmark.nix | 22 ++++++++++++++++++++++ flake.lock | 27 +++++++++++++++++++++++++++ flake.nix | 30 ++++++++++++++++++++++++++++++ 3 files changed, 79 insertions(+) create mode 100644 cmark.nix create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/cmark.nix b/cmark.nix new file mode 100644 index 0000000..daeeb04 --- /dev/null +++ b/cmark.nix @@ -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"; + }; +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..599eb6f --- /dev/null +++ b/flake.lock @@ -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 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..1a4aba6 --- /dev/null +++ b/flake.nix @@ -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 + ])) + ]; + }; + }; +}