Get vue things to work

This commit is contained in:
Akshay Mankar 2024-08-25 12:26:00 +02:00
parent 8d707f9a53
commit 68e6c1afc2
Signed by: axeman
GPG key ID: CA08F3AB62369B89
2 changed files with 1116 additions and 3 deletions

View file

@ -1,18 +1,26 @@
{stdenv,
{
pkgs,
lib,
buildPackages,
buildNpmPackage,
fetchFromGitHub,
stdenv,
writeShellScriptBin,
writeText,
symlinkJoin,
callPackage,
bundlerEnv,
ruby_3_2,
postgresql
esbuild,
}:
let
gemfile-patch = callPackage ./gemfile-patch.nix {};
src = callPackage ./source.nix {
patches = [
gemfile-patch
./creds.patch
./esbuild-linux-64.patch
];
};
gems = bundlerEnv {
@ -22,6 +30,37 @@ let
gemdir = src;
};
vue = buildNpmPackage {
name = "loomio-vue";
src = "${src}";
npmRoot = "vue";
npmDepsHash = "sha256-DtzB1XIbdhJkLV88h1caKQeWfErwWBBf4OiQuKM/oQc=";
buildPhase = ''
runHook preBuild
if [ -n "''${npmRoot-}" ]; then
pushd "$npmRoot"
fi
npm run build
if [ -n "''${npmRoot-}" ]; then
popd
fi
runHook postBuild
'';
dontNpmInstall = true;
installPhase = ''
mkdir $out
cp -r * $out
'';
};
databaseConfig = writeText "database.yml" ''
production:
adapter: postgresql
@ -31,7 +70,7 @@ let
in stdenv.mkDerivation {
name = "loomio";
inherit src;
src = vue;
nativeBuildInputs = [ gems gems.wrappedRuby ];
buildInputs = [gems ruby_3_2];
buildPhase = ''
@ -39,6 +78,8 @@ in stdenv.mkDerivation {
cp ${databaseConfig} config/database.yml
cp ${./puma.rb} config/puma.rb
# ln -s ''${vueNodeModules} vue/node_modules
# ln -s ''${vue} vue-built
export BUNDLE_FORCE_RUBY_PLATFORM=true
${gems}/bin/bundle exec bootsnap precompile --gemfile app/ lib/

File diff suppressed because it is too large Load diff