mirror of
https://github.com/mx42/nix_spacetimedb.git
synced 2026-01-13 21:29:52 +01:00
chore: try to reorganize a bit - doesn't work imported in local flake
This commit is contained in:
62
flake.nix
62
flake.nix
@@ -18,45 +18,43 @@
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
};
|
||||
spacetime = pkgs.stdenv.mkDerivation {
|
||||
pname = "spacetimedb";
|
||||
version = "1.0.1";
|
||||
src = pkgs.fetchurl {
|
||||
url = "https://github.com/clockworklabs/SpacetimeDB/releases/download/v1.1.0/spacetime-x86_64-unknown-linux-gnu.tar.gz";
|
||||
hash = "sha256-t7V4TkPWQfzH8PUkRLq1OMaKhZ4in4EZCLKinc2oSik=";
|
||||
};
|
||||
nativeBuildInputs = with pkgs; [
|
||||
autoPatchelfHook
|
||||
];
|
||||
|
||||
stdenv = pkgs.stdenv;
|
||||
lib = pkgs.lib;
|
||||
fetchurl = pkgs.fetchurl;
|
||||
autoPatchelfHook = pkgs.autoPatchelfHook;
|
||||
libgcc = pkgs.libgcc;
|
||||
buildInputs = with pkgs; [
|
||||
libgcc
|
||||
stdenv.cc.cc.lib
|
||||
];
|
||||
|
||||
unpackPhase = ''
|
||||
runHook preUnpack
|
||||
mkdir -p $out/bin
|
||||
tar -xvf $src -C $out/bin
|
||||
runHook postUnpack
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
runHook postInstall
|
||||
'';
|
||||
};
|
||||
in
|
||||
{
|
||||
packages = {
|
||||
default = stdenv.mkDerivation {
|
||||
pname = "spacetimedb";
|
||||
version = "1.0.1";
|
||||
src = fetchurl {
|
||||
url = "https://github.com/clockworklabs/SpacetimeDB/releases/download/v1.1.0/spacetime-x86_64-unknown-linux-gnu.tar.gz";
|
||||
hash = "sha256-t7V4TkPWQfzH8PUkRLq1OMaKhZ4in4EZCLKinc2oSik=";
|
||||
};
|
||||
nativeBuildInputs = [ autoPatchelfHook ];
|
||||
|
||||
buildInputs = [
|
||||
libgcc
|
||||
stdenv.cc.cc.lib
|
||||
];
|
||||
|
||||
unpackPhase = ''
|
||||
runHook preUnpack
|
||||
mkdir -p $out/bin
|
||||
tar -xvf $src -C $out/bin
|
||||
runHook postUnpack
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
runHook postInstall
|
||||
'';
|
||||
};
|
||||
spacetimedb = spacetime;
|
||||
default = spacetime;
|
||||
};
|
||||
devShells = {
|
||||
default = pkgs.mkShell {
|
||||
buildInputs = [ self.${system}.packages.default ];
|
||||
buildInputs = [ spacetime ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user