financier-nix/flake.nix

41 lines
1.1 KiB
Nix
Raw Normal View History

{
2024-06-10 21:58:06 +02:00
inputs.systems.url = "github:nix-systems/default";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.financier = {
2024-06-10 22:19:29 +02:00
url = "github:financier-io/financier/19001ceba1404b790d25ed10838728c5c392ef85";
flake = false;
};
outputs = inputs@{ self, nixpkgs, ... }:
2024-06-10 21:58:06 +02:00
inputs.flake-utils.lib.eachSystem (import inputs.systems)
(system:
let pkgs = import nixpkgs { inherit system; };
in {
2024-06-10 21:58:06 +02:00
packages = {
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";
};
};
2024-06-10 21:58:06 +02:00
defaultPackage = self.packages.${system}.financier-dist;
}) // {
2024-06-10 21:58:06 +02:00
nixosModule = { pkgs, lib, ... }: {
imports = [ ./module.nix ];
services.financier.package =
lib.mkDefault self.packages.${pkgs.system}.financier-dist;
};
2024-06-10 21:58:06 +02:00
};
}