This commit is contained in:
Bit Borealis 2023-07-23 00:31:36 +00:00
commit e28e37c080
4 changed files with 72 additions and 0 deletions

32
default.nix Normal file
View file

@ -0,0 +1,32 @@
{ stdenv, bundlerEnv, ruby_2_7, callPackage
, pname ? "diaspora"
, version ? import ./version.nix
}:
stdenv.mkDerivation rec {
inherit pname version;
diasporaGems = bundlerEnv {
name = "${pname}-gems-${version}";
version = version;
ruby = ruby_2_7;
gemdir = callPackage ./source.nix {};
gemset = ./gemset.nix;
};
name = "diaspora";
src = ./.;
buildInputs = [diasporaGems ruby];
installPhase = ''
mkdir -p $out/{bin,share/diaspora}
cp -r * $out/share/diaspora
bin=$out/bin/diaspora
# we are using bundle exec to start in the bundled environment
cat > $bin <<EOF
#!/bin/sh -e
exec ${diasporaGems}/bin/bundle exec ${ruby}/bin/ruby $out/share/diaspora/diaspora "\$@"
EOF
chmod +x $bin
'';
}

27
shell.nix Normal file
View file

@ -0,0 +1,27 @@
with import <nixpkgs> {};
stdenv.mkDerivation {
name = "env";
buildInputs = [
ruby_2_7.devEnv
git
patch
imagemagick
bison
curl
postgresql
cmake
libtool
libxml2
libxslt
libffi
libyaml
libidn
pkg-config
openssl
nodejs
gdbm
bundix
gnumake
automake
];
}

12
source.nix Normal file
View file

@ -0,0 +1,12 @@
# This file was generated by pkgs.diaspora.updateScript.
{ fetchFromGitHub, applyPatches }: let
src = fetchFromGitHub {
owner = "diaspora";
repo = "diaspora";
rev = "v0.7.18.2";
sha256 = "1fla7wlwnsv5gqnjfiigxrjgkka6msjkk1pw493c4d5l3dqh5hkm";
};
in applyPatches {
inherit src;
patches = [];
}

1
version.nix Normal file
View file

@ -0,0 +1 @@
"v0.7.18.2"