From 284d8881f93be4d29bdb2aa5afa94fd6e8a59a8a Mon Sep 17 00:00:00 2001 From: Charlotte Van Petegem Date: Wed, 21 May 2025 15:16:22 +0200 Subject: [PATCH] Don't create separate assets package --- flake.nix | 41 +++++++++++++---------------------------- 1 file changed, 13 insertions(+), 28 deletions(-) diff --git a/flake.nix b/flake.nix index 4039c1b..5b135de 100644 --- a/flake.nix +++ b/flake.nix @@ -33,44 +33,29 @@ pname = "entrance-exam"; version = "0.1.0"; + nativeBuildInputs = with pkgs; [ + nodejs + yarnConfigHook + yarnBuildHook + ]; + + yarnOfflineCache = pkgs.fetchYarnDeps { + yarnLock = src + "/yarn.lock"; + hash = "sha256-jmVSCKHjDT1vmVRyXinKka7hK5hA37ZyE/pvRZ7z6T0="; + }; + 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 ''; 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; [ - 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; - }; + passthru.env = gems; }; };