Use the upstream version of financier

The upstream version has been updated, and it has been switched to Yarn.
This makes it simple to build it without the need of our own fork.

We need a small fix for yarn2nix for the time being though. See
<https://github.com/financier-io/financier/pull/5> for details.
This commit is contained in:
Martin Puppe 2022-06-10 12:27:18 +02:00
parent 4d8e080600
commit 6bc8e28f0f
12 changed files with 28 additions and 17654 deletions

View file

@ -1,35 +1,38 @@
{
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.financier = {
url = "git+https://codeberg.org/puppe/financier.git?ref=mpuppe";
url = "github:puppe/financier/fix-yarn2nix";
flake = false;
};
outputs = inputs@{ self, nixpkgs, ... }:
let
financierVersion = (builtins.fromJSON
(builtins.readFile "${inputs.financier}/package.json")).version;
nodeVersion = "12";
in inputs.flake-utils.lib.eachDefaultSystem (system:
inputs.flake-utils.lib.eachDefaultSystem (system:
let pkgs = import nixpkgs { inherit system; };
in {
packages = {
financier-dist =
pkgs.callPackage ./dist.nix { inherit financierVersion; };
financier-dist = pkgs.mkYarnPackage {
name = "financier-dist";
src = "${inputs.financier}";
buildPhase = ''
yarn --offline build
'';
distPhase = "true";
installPhase = ''
cp -r dist "$out/"
'';
configurePhase = "ln -s $node_modules node_modules";
};
};
defaultPackage = self.packages.${system}.financier-dist;
devShell = pkgs.mkShell {
packages = with pkgs; [ nodePackages.node2nix ];
shellHook = ''
export FINANCIER_SRC="${inputs.financier}"
export FINANCIER_NODE_VERSION="${nodeVersion}"
'';
};
}) // {
nixosModule = { pkgs, lib, ... }: {
imports = [ ./module.nix ];
services.financier.package =
lib.mkDefault self.packages.${pkgs.system}.financier-dist;
};
};
}