Skip to content

Commit

Permalink
chore: add nixpkgs style builder
Browse files Browse the repository at this point in the history
  • Loading branch information
frectonz committed Aug 28, 2024
1 parent 3365574 commit 7082a06
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{ lib
, fetchFromGitHub
, rustPlatform
, buildNpmPackage
}:
let
pname = "sql-studio";
version = "0.1.27";

src = fetchFromGitHub {
owner = "frectonz";
repo = pname;
rev = version;
hash = "sha256-iSvxdqarHX0AvkMSzL2JFOm32OyMwVKt+Gn7odgwalU=";
};

ui = buildNpmPackage {
inherit version src;
pname = "${pname}-ui";
npmDepsHash = "sha256-kGukH0PKF7MtIO5UH+55fddj6Tv2dNLmOC6oytEhP3c=";
sourceRoot = "${src.name}/ui";
installPhase = ''
cp -pr --reflink=auto -- dist "$out/"
'';
};
in
rustPlatform.buildRustPackage {
inherit pname version src;

cargoHash = "sha256-BlYFbJEDap/k3oi9tFl4JpTyYh8ce7F3NIlOtOid59s=";

preBuild = ''
cp -pr --reflink=auto -- ${ui} ui/dist
'';

meta = {
description = "SQL Database Explorer [SQLite, libSQL, PostgreSQL, MySQL/MariaDB, DuckDB, ClickHouse]";
homepage = "https://github.com/frectonz/sql-studio";
mainProgram = "sql-studio";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.frectonz ];
platforms = lib.platforms.all;
};
}

0 comments on commit 7082a06

Please sign in to comment.