2021-11-24 13:28:46 +00:00
|
|
|
{
|
|
|
|
description = "Lsyncd (Live Syncing Daemon)";
|
|
|
|
|
2022-01-12 19:46:14 +00:00
|
|
|
inputs.nixpkgs.url = "github:nixos/nixpkgs/release-21.11";
|
2021-11-24 13:28:46 +00:00
|
|
|
inputs.flake-utils.url = "github:numtide/flake-utils";
|
|
|
|
|
|
|
|
outputs = { self, nixpkgs, flake-utils }:
|
|
|
|
flake-utils.lib.eachDefaultSystem
|
|
|
|
(system:
|
|
|
|
let
|
2022-01-12 19:46:14 +00:00
|
|
|
pkgs = (import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
# Makes the config pure as well. See <nixpkgs>/top-level/impure.nix:
|
|
|
|
config = {
|
|
|
|
allowBroken = true;
|
|
|
|
};}); #.legacyPackages.${system};
|
2021-11-24 13:28:46 +00:00
|
|
|
defaultDeps = with pkgs; [
|
|
|
|
gcc
|
|
|
|
cmake
|
2022-01-12 19:46:14 +00:00
|
|
|
gnumake
|
2021-11-24 13:28:46 +00:00
|
|
|
glib
|
2021-12-02 16:01:37 +00:00
|
|
|
rsync
|
|
|
|
openssh
|
2022-01-12 19:46:14 +00:00
|
|
|
curl
|
2021-11-24 13:28:46 +00:00
|
|
|
];
|
|
|
|
version = builtins.elemAt
|
|
|
|
(builtins.match ''.*set\(.LSYNCD_VERSION ([0-9\.]*).*''
|
|
|
|
(builtins.substring 0 500
|
|
|
|
(builtins.readFile ./CMakeLists.txt))) 0;
|
2022-01-12 19:46:14 +00:00
|
|
|
mylua5_4 = pkgs.lua5_4.override({
|
|
|
|
packageOverrides = luaself: luaprev: {
|
|
|
|
luarocks = luaprev.luarocks-3_7;
|
|
|
|
};
|
|
|
|
});
|
2022-03-24 10:20:23 +00:00
|
|
|
|
|
|
|
buildExtensions = luapkgs: (
|
|
|
|
let
|
|
|
|
nucleo = luapkgs.buildLuarocksPackage {
|
|
|
|
pname = "lua-nucleo";
|
|
|
|
version = "1.1.0-1";
|
|
|
|
knownRockspec = (pkgs.fetchurl {
|
|
|
|
url = "https://luarocks.org/lua-nucleo-1.1.0-1.rockspec";
|
|
|
|
sha256 = "02ly51wav1pxiahf6lflr4vks550bisdq4ir9cy1lxn9v2zmcbim";
|
|
|
|
}).outPath;
|
|
|
|
src = pkgs.fetchgit ( removeAttrs (builtins.fromJSON ''{
|
|
|
|
"url": "https://github.com/lua-nucleo/lua-nucleo.git",
|
|
|
|
"rev": "76835968ff30f182367abd58637560402990e0b1",
|
|
|
|
"date": "2021-04-26T11:51:34+03:00",
|
|
|
|
"path": "/nix/store/3ycmrh0j64qxm4f04yxmn3y42imc8bv5-lua-nucleo",
|
|
|
|
"sha256": "15kydmj64jhxv5ksayfgkwzmgzd7raj7xp636x8a7c3ybiirs90n",
|
|
|
|
"fetchSubmodules": true,
|
|
|
|
"deepClone": false,
|
|
|
|
"leaveDotGit": false
|
|
|
|
}
|
|
|
|
'') ["date" "path"]) ;
|
|
|
|
|
|
|
|
disabled = with luapkgs; (luaOlder "5.1");
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "http://github.com/lua-nucleo/lua-nucleo";
|
|
|
|
description = "A random collection of core and utility level Lua libraries";
|
|
|
|
license.fullName = "MIT/X11";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
|
|
|
luapkgs.buildLuarocksPackage {
|
|
|
|
pname = "lua-crontab";
|
|
|
|
version = "1.0.0-1";
|
|
|
|
knownRockspec = (pkgs.fetchurl {
|
|
|
|
url = "https://luarocks.org/lua-crontab-1.0.0-1.rockspec";
|
|
|
|
sha256 = "1aynwxq488sxd2lyng4wnswfkqna5n07sfmdainlqlhcb6jan161";
|
|
|
|
}).outPath;
|
|
|
|
src = pkgs.fetchgit ( removeAttrs (builtins.fromJSON ''{
|
|
|
|
"url": "https://github.com/logiceditor-com/lua-crontab.git",
|
|
|
|
"rev": "e3929a572e8164f968da4dcbdf1c4464a2870699",
|
|
|
|
"date": "2021-07-29T14:12:08+03:00",
|
|
|
|
"path": "/nix/store/rsc49m4f1mjqbffaq7axcf31rgxxfjb3-lua-crontab",
|
|
|
|
"sha256": "0zkqslw3vg495k8g010cz931vlzfyynq4kcwi1jbbppia521z6rx",
|
|
|
|
"fetchSubmodules": true,
|
|
|
|
"deepClone": false,
|
|
|
|
"leaveDotGit": false
|
|
|
|
}
|
|
|
|
'') ["date" "path"]) ;
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ nucleo ];
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "http://github.com/logiceditor-com/lua-crontab";
|
|
|
|
description = "Stores crontab-like rules for events and calculates timestamps for their occurrences";
|
|
|
|
license.fullName = "MIT/X11";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
2022-01-12 19:46:14 +00:00
|
|
|
luaposix35 = mylua: mylua.pkgs.buildLuarocksPackage {
|
|
|
|
pname = "luaposix";
|
|
|
|
lua = mylua;
|
|
|
|
version = "35.1-1";
|
|
|
|
knownRockspec = (pkgs.fetchurl {
|
|
|
|
url = "https://luarocks.org/luaposix-35.1-1.rockspec";
|
|
|
|
sha256 = "1n6c7qyabj2y95jmbhf8fxbrp9i73kphmwalsam07f9w9h995xh1";
|
|
|
|
}).outPath;
|
|
|
|
src = pkgs.fetchurl {
|
|
|
|
url = "http://github.com/luaposix/luaposix/archive/v35.1.zip";
|
|
|
|
sha256 = "1c03chkzwr2p1wd0hs1bafl2890fqbrfc3qk0wxbd202gc6128zi";
|
|
|
|
};
|
|
|
|
|
|
|
|
#
|
|
|
|
propagatedBuildInputs = [ mylua ];
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "http://github.com/luaposix/luaposix/";
|
|
|
|
description = "Lua bindings for POSIX";
|
|
|
|
license.fullName = "MIT/X11";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-12-02 16:01:37 +00:00
|
|
|
buildTypes = {
|
2022-03-24 12:41:13 +00:00
|
|
|
lua5_1 = [pkgs.lua5_1 pkgs.lua51Packages.luaposix (buildExtensions pkgs.lua51Packages)];
|
2022-03-24 13:48:58 +00:00
|
|
|
lua5_2 = [pkgs.lua5_2 pkgs.lua52Packages.luaposix (buildExtensions pkgs.lua52Packages)];
|
|
|
|
lua5_3 = [pkgs.lua5_3 pkgs.lua53Packages.luaposix (buildExtensions pkgs.lua53Packages)];
|
|
|
|
lua5_4 = [pkgs.lua5_4 (luaposix35 mylua5_4) (buildExtensions mylua5_4.pkgs)];
|
2021-12-02 16:01:37 +00:00
|
|
|
};
|
2021-11-24 13:28:46 +00:00
|
|
|
in
|
|
|
|
let
|
2021-12-02 16:01:37 +00:00
|
|
|
mkLsync = luaPackages: pkgs.stdenv.mkDerivation ({
|
2021-11-24 13:28:46 +00:00
|
|
|
inherit version;
|
|
|
|
name = "lsyncd";
|
|
|
|
|
|
|
|
src = ./.;
|
2022-01-12 19:46:14 +00:00
|
|
|
|
2021-12-02 16:01:37 +00:00
|
|
|
buildInputs = defaultDeps ++ luaPackages;
|
2022-01-12 19:46:14 +00:00
|
|
|
});
|
|
|
|
mkDev = packages: pkgs.mkShell {
|
|
|
|
propagatedBuildInputs = defaultDeps ++ packages;
|
|
|
|
};
|
2021-11-24 13:28:46 +00:00
|
|
|
in
|
|
|
|
{
|
|
|
|
packages = {
|
2021-12-02 16:01:37 +00:00
|
|
|
lsyncd = mkLsync buildTypes.lua5_3;
|
|
|
|
lsyncd_lua5_1 = mkLsync buildTypes.lua5_1;
|
|
|
|
lsyncd_lua5_2 = mkLsync buildTypes.lua5_2;
|
|
|
|
lsyncd_lua5_3 = mkLsync buildTypes.lua5_3;
|
|
|
|
lsyncd_lua5_4 = mkLsync buildTypes.lua5_4;
|
2021-11-24 13:28:46 +00:00
|
|
|
};
|
|
|
|
|
2022-01-12 19:46:14 +00:00
|
|
|
devShells = {
|
|
|
|
lsyncd = mkDev buildTypes.lua5_3;
|
|
|
|
lsyncd_lua5_1 = mkDev buildTypes.lua5_1;
|
|
|
|
lsyncd_lua5_2 = mkDev buildTypes.lua5_2;
|
|
|
|
lsyncd_lua5_3 = mkDev buildTypes.lua5_3;
|
|
|
|
lsyncd_lua5_4 = mkDev buildTypes.lua5_4;
|
|
|
|
};
|
|
|
|
|
2021-11-24 13:28:46 +00:00
|
|
|
defaultPackage = self.packages.${system}.lsyncd;
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|