Don't create separate assets package

This commit is contained in:
Charlotte Van Petegem 2025-05-21 15:16:22 +02:00
parent 21007e8168
commit 284d8881f9
Signed by: chvp
SSH key fingerprint: SHA256:s9rb8jBVfdahqWHuBAcHCBP1wmj4eYQXZfqgz4H3E9E

View file

@ -33,23 +33,6 @@
pname = "entrance-exam"; pname = "entrance-exam";
version = "0.1.0"; version = "0.1.0";
buildPhase = ''
# Compile bootsnap cache
${gems}/bin/bundle exec bootsnap precompile --gemfile app/ lib/
'';
installPhase = ''
mkdir $out
cp -r * $out
rm -r $out/public
'';
passthru = {
assets = pkgs.stdenv.mkDerivation {
inherit src version;
pname = "entrance-exam-assets";
nativeBuildInputs = with pkgs; [ nativeBuildInputs = with pkgs; [
nodejs nodejs
yarnConfigHook yarnConfigHook
@ -62,15 +45,17 @@
}; };
buildPhase = '' buildPhase = ''
# Compile bootsnap cache
${gems}/bin/bundle exec bootsnap precompile --gemfile app/ lib/
SECRET_KEY_BASE=000000 RAILS_ENV=production SKIP_YARN_INSTALL=1 ${gems}/bin/bundle exec rails assets:precompile SECRET_KEY_BASE=000000 RAILS_ENV=production SKIP_YARN_INSTALL=1 ${gems}/bin/bundle exec rails assets:precompile
''; '';
installPhase = '' installPhase = ''
cp -r public $out mkdir $out
cp -r * $out
''; '';
};
env = gems; passthru.env = gems;
};
}; };
}; };