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 , cmake
, nixosTests , nixosTests
, src , src
, mobilizon-js
}: }:
let let
@ -23,7 +24,7 @@ let
in in
mixRelease rec { mixRelease rec {
pname = "mobilizon"; pname = "mobilizon";
version = "3.1.0"; version = "3.1.3";
inherit src; inherit src;
@ -143,11 +144,8 @@ mixRelease rec {
# Install the compiled js part # Install the compiled js part
preBuild = 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 chmod 770 -R ./priv
''; '';

View file

@ -7,7 +7,13 @@
pkgs = import nixpkgs { system = "x86_64-linux"; }; pkgs = import nixpkgs { system = "x86_64-linux"; };
in { 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; 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 { mkYarnPackage rec {
src = applyPatches { src = ./.;
name = "mobilizon-js-src";
src = "${mobilizon-src}/js";
};
packageJSON = ./package.json; packageJSON = ./package.json;
yarnLock = ./yarn.lock; yarnLock = ./yarn.lock;