build js as own flake output

This commit is contained in:
778a69cd 2023-08-03 17:26:07 +02:00
parent e046a6ef16
commit d27bd79178
3 changed files with 12 additions and 11 deletions

View file

@ -13,6 +13,7 @@
, cmake
, nixosTests
, src
, mobilizon-js
}:
let
@ -23,7 +24,7 @@ let
in
mixRelease rec {
pname = "mobilizon";
version = "3.1.0";
version = "3.1.3";
inherit src;
@ -143,11 +144,8 @@ mixRelease rec {
# Install the compiled js part
preBuild =
let
js = callPackage ./js/js.nix { mobilizon-src = src; };
in
''
cp -a "${js}/libexec/mobilizon/deps/priv/static" ./priv
cp -a "${mobilizon-js}/libexec/mobilizon/deps/priv/static" ./priv
chmod 770 -R ./priv
'';

View file

@ -7,7 +7,13 @@
pkgs = import nixpkgs { system = "x86_64-linux"; };
in {
packages.x86_64-linux.mobilizon = pkgs.callPackage ./. { };
packages.x86_64-linux.mobilizon = pkgs.callPackage ./. {
src = ./.;
mobilizon-js = self.packages.x86_64-linux.mobilizon-frontend;
};
packages.x86_64-linux.mobilizon-frontend = pkgs.callPackage ./js {
};
packages.x86_64-linux.default = self.packages.x86_64-linux.mobilizon;

View file

@ -1,10 +1,7 @@
{ lib, applyPatches, yarn, mkYarnPackage, imagemagick, mobilizon-src }:
{ lib, applyPatches, yarn, mkYarnPackage, imagemagick}:
mkYarnPackage rec {
src = applyPatches {
name = "mobilizon-js-src";
src = "${mobilizon-src}/js";
};
src = ./.;
packageJSON = ./package.json;
yarnLock = ./yarn.lock;