From e28e37c08088bbfe8458691225bb3428caef14ed Mon Sep 17 00:00:00 2001 From: The Hive Date: Sun, 23 Jul 2023 00:31:36 +0000 Subject: [PATCH] init --- default.nix | 32 ++++++++++++++++++++++++++++++++ shell.nix | 27 +++++++++++++++++++++++++++ source.nix | 12 ++++++++++++ version.nix | 1 + 4 files changed, 72 insertions(+) create mode 100644 default.nix create mode 100644 shell.nix create mode 100644 source.nix create mode 100644 version.nix diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..e440c4c --- /dev/null +++ b/default.nix @@ -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 < {}; +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 + ]; +} diff --git a/source.nix b/source.nix new file mode 100644 index 0000000..0f7c902 --- /dev/null +++ b/source.nix @@ -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 = []; +} diff --git a/version.nix b/version.nix new file mode 100644 index 0000000..aee84f6 --- /dev/null +++ b/version.nix @@ -0,0 +1 @@ +"v0.7.18.2"