about summary refs log tree commit diff
path: root/packages/emacsql-sqlite.nix
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--packages/emacsql-sqlite.nix35
1 files changed, 35 insertions, 0 deletions
diff --git a/packages/emacsql-sqlite.nix b/packages/emacsql-sqlite.nix
new file mode 100644
index 0000000..3329e08
--- /dev/null
+++ b/packages/emacsql-sqlite.nix
@@ -0,0 +1,35 @@
+{
+  fetchFromGitHub,
+  lib,
+  stdenv,
+}:
+stdenv.mkDerivation (finalAttrs: {
+  pname = "emacsql-sqlite";
+  version = "3.1.1";
+
+  src = fetchFromGitHub {
+    owner = "magit";
+    repo = "emacsql";
+    rev = finalAttrs.version;
+    hash = "sha256-b/QEpWMTyVOdkOEhPNJ0x8ukUy9Gc9gYGjnlh0WU9fY=";
+  };
+
+  sourceRoot = "source/sqlite";
+
+  installPhase = ''
+    runHook preInstall
+
+    install -Dm755 -t $out/bin ${finalAttrs.meta.mainProgram}
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "SQLite interop binary for emacsql-sqlite";
+    inherit (finalAttrs.src.meta) homepage;
+    license = licenses.unlicense;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [azahi];
+    mainProgram = "emacsql-sqlite";
+  };
+})

Consider giving Nix/NixOS a try! <3