From 733ce794b6e7b68773b654d6d9b00c237accb824 Mon Sep 17 00:00:00 2001 From: Mostly Void <7rat13@gmail.com> Date: Thu, 22 Sep 2022 14:14:23 +0530 Subject: [PATCH] litefs: init at 0.2.0 --- .../tools/database/litefs/default.nix | 43 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 45 insertions(+) create mode 100644 pkgs/development/tools/database/litefs/default.nix diff --git a/pkgs/development/tools/database/litefs/default.nix b/pkgs/development/tools/database/litefs/default.nix new file mode 100644 index 000000000000..4589ab21ef80 --- /dev/null +++ b/pkgs/development/tools/database/litefs/default.nix @@ -0,0 +1,43 @@ +{ lib +, buildGoModule +, fetchFromGitHub +}: + +buildGoModule rec { + pname = "litefs"; + version = "0.2.0"; + + src = fetchFromGitHub { + owner = "superfly"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-Gh1GcIsRNfAwQ2HJq82IlyUHPyaDpA3CpBe4glBbU/I="; + }; + + vendorSha256 = "sha256-dXCyBY4k9Gxsy/7UwkWFTxihZnFkZGrZKgw9pHD8jco="; + + subPackages = [ "cmd/litefs" ]; + + # following https://github.com/superfly/litefs/blob/main/Dockerfile + ldflags = [ + "-s" + "-w" + "-X main.Version=${version}" + "-extldflags=-static" + ]; + + tags = [ + "osusergo" + "netgo" + "sqlite_omit_load_extension" + ]; + + doCheck = false; # fails + + meta = with lib; { + description = "FUSE-based file system for replicating SQLite databases across a cluster of machines"; + homepage = "https://github.com/superfly/litefs"; + license = licenses.asl20; + maintainers = with maintainers; [ dit7ya ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 915e23056427..186bae28e66f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16647,6 +16647,8 @@ with pkgs; litecli = callPackage ../development/tools/database/litecli {}; + litefs = callPackage ../development/tools/database/litefs {}; + litestream = callPackage ../development/tools/database/litestream {}; lsof = callPackage ../development/tools/misc/lsof { };