57 lines
1.2 KiB
Nix
57 lines
1.2 KiB
Nix
{
|
|
stdenv,
|
|
lib,
|
|
fetchFromGitHub,
|
|
makeWrapper,
|
|
rsync,
|
|
gawk,
|
|
pv,
|
|
gnutar,
|
|
zstd,
|
|
util-linux,
|
|
coreutils,
|
|
gnugrep,
|
|
findutils,
|
|
}:
|
|
stdenv.mkDerivation rec {
|
|
pname = "anything-sync-daemon";
|
|
version = "6.0.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "graysky2";
|
|
repo = pname;
|
|
rev = "v${version}";
|
|
hash = "sha256-6nfaAMH5YgK6gimuZ8j1zWLTDOi11KIwW7Bf0Iwh7+I=";
|
|
};
|
|
|
|
patches = [./disableDaemonStopTargets.patch];
|
|
|
|
nativeBuildInputs = [makeWrapper];
|
|
|
|
postPatch = ''
|
|
substituteInPlace init/asd* \
|
|
--replace /usr/bin/anything-sync-daemon $out/bin/anything-sync-daemon
|
|
'';
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
makeFlags = [
|
|
"DESTDIR=${placeholder "out"}"
|
|
"PREFIX="
|
|
"INITDIR_SYSTEMD=/lib/systemd/system"
|
|
];
|
|
|
|
installTargets = ["install-systemd-all"];
|
|
|
|
postInstall = ''
|
|
wrapProgram $out/bin/anything-sync-daemon \
|
|
--suffix PATH : ${lib.makeBinPath [rsync gawk pv gnutar zstd util-linux coreutils gnugrep findutils]}
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Symlinks and syncs user specified dirs to RAM";
|
|
homepage = "https://github.com/graysky2/anything-sync-daemon/";
|
|
license = lib.licenses.mit;
|
|
platforms = platforms.linux;
|
|
};
|
|
}
|