nur-packages

My NUR packages
git clone git://git.sikmir.ru/nur-packages
Log | Files | Refs | README | LICENSE

default.nix (1163B)


      1 {
      2   lib,
      3   stdenv,
      4   fetchFromGitHub,
      5   pkg-config,
      6   makeWrapper,
      7   lua5_3,
      8   memstreamHook,
      9   zlib,
     10 }:
     11 
     12 stdenv.mkDerivation {
     13   pname = "tom";
     14   version = "2021-10-21";
     15 
     16   src = fetchFromGitHub {
     17     owner = "omar-polo";
     18     repo = "tom";
     19     rev = "5d89c1bb50200f79fac9eee5f88ed4e43ccd32a8";
     20     hash = "sha256-dpDNZYkOzcugtPi3ZeB9xHlYas2tdsTqfnhp7KqBMYg=";
     21   };
     22 
     23   postPatch = ''
     24     substituteInPlace runcgi.sh \
     25       --replace-fail "lua53" "${lua5_3}/bin/lua" \
     26       --replace-fail "tom.lua" "$out/share/lua/tom.lua"
     27   '';
     28 
     29   nativeBuildInputs = [
     30     pkg-config
     31     makeWrapper
     32   ];
     33 
     34   buildInputs = [
     35     lua5_3
     36     zlib
     37   ] ++ lib.optional stdenv.isDarwin memstreamHook;
     38 
     39   installPhase = ''
     40     install -Dm644 *.so *.lua -t $out/share/lua
     41     install -Dm755 *.sh -t $out/bin
     42 
     43     wrapProgram $out/bin/runcgi.sh \
     44       --set LUA_PATH "$out/share/lua/?.lua" \
     45       --set LUA_CPATH "$out/share/lua/?.so"
     46   '';
     47 
     48   meta = {
     49     description = "Gemini frontend for git repositories";
     50     homepage = "https://github.com/omar-polo/tom";
     51     license = lib.licenses.isc;
     52     maintainers = [ lib.maintainers.sikmir ];
     53     platforms = lib.platforms.unix;
     54   };
     55 }