Don't create separate assets package
This commit is contained in:
parent
21007e8168
commit
284d8881f9
1 changed files with 13 additions and 28 deletions
41
flake.nix
41
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;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue