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,44 +33,29 @@
pname = "entrance-exam"; pname = "entrance-exam";
version = "0.1.0"; version = "0.1.0";
nativeBuildInputs = with pkgs; [
nodejs
yarnConfigHook
yarnBuildHook
];
yarnOfflineCache = pkgs.fetchYarnDeps {
yarnLock = src + "/yarn.lock";
hash = "sha256-jmVSCKHjDT1vmVRyXinKka7hK5hA37ZyE/pvRZ7z6T0=";
};
buildPhase = '' buildPhase = ''
# Compile bootsnap cache # Compile bootsnap cache
${gems}/bin/bundle exec bootsnap precompile --gemfile app/ lib/ ${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
''; '';
installPhase = '' installPhase = ''
mkdir $out mkdir $out
cp -r * $out cp -r * $out
rm -r $out/public
''; '';
passthru = { passthru.env = gems;
assets = pkgs.stdenv.mkDerivation {
inherit src version;
pname = "entrance-exam-assets";
nativeBuildInputs = with pkgs; [
nodejs
yarnConfigHook
yarnBuildHook
];
yarnOfflineCache = pkgs.fetchYarnDeps {
yarnLock = src + "/yarn.lock";
hash = "sha256-jmVSCKHjDT1vmVRyXinKka7hK5hA37ZyE/pvRZ7z6T0=";
};
buildPhase = ''
SECRET_KEY_BASE=000000 RAILS_ENV=production SKIP_YARN_INSTALL=1 ${gems}/bin/bundle exec rails assets:precompile
'';
installPhase = ''
cp -r public $out
'';
};
env = gems;
};
}; };
}; };