From d27bd79178612d609512a64c8db6119d68dbad70 Mon Sep 17 00:00:00 2001 From: 778a69cd <778a69cd@potsda.mn> Date: Thu, 3 Aug 2023 17:26:07 +0200 Subject: [PATCH] build js as own flake output --- default.nix | 8 +++----- flake.nix | 8 +++++++- js/{js.nix => default.nix} | 7 ++----- 3 files changed, 12 insertions(+), 11 deletions(-) rename js/{js.nix => default.nix} (78%) diff --git a/default.nix b/default.nix index e0669812d..33437c056 100644 --- a/default.nix +++ b/default.nix @@ -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 ''; diff --git a/flake.nix b/flake.nix index 3bf2ab8f4..06c11259e 100644 --- a/flake.nix +++ b/flake.nix @@ -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; diff --git a/js/js.nix b/js/default.nix similarity index 78% rename from js/js.nix rename to js/default.nix index 5e3f4ebdd..f57d0aa8a 100644 --- a/js/js.nix +++ b/js/default.nix @@ -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;