Make systems overridable

This commit is contained in:
Martin Puppe 2024-06-10 21:58:06 +02:00
parent 4fac16904d
commit c6f236f787
2 changed files with 43 additions and 25 deletions

View file

@ -1,4 +1,5 @@
{
inputs.systems.url = "github:nix-systems/default";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.financier = {
url = "github:puppe/financier/fix-yarn2nix";
@ -6,33 +7,34 @@
};
outputs = inputs@{ self, nixpkgs, ... }:
inputs.flake-utils.lib.eachDefaultSystem (system:
let pkgs = import nixpkgs { inherit system; };
in {
inputs.flake-utils.lib.eachSystem (import inputs.systems)
(system:
let pkgs = import nixpkgs { inherit system; };
in {
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";
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";
};
};
};
defaultPackage = self.packages.${system}.financier-dist;
}) // {
nixosModule = { pkgs, lib, ... }: {
imports = [ ./module.nix ];
services.financier.package =
lib.mkDefault self.packages.${pkgs.system}.financier-dist;
};
defaultPackage = self.packages.${system}.financier-dist;
}) // {
nixosModule = { pkgs, lib, ... }: {
imports = [ ./module.nix ];
services.financier.package =
lib.mkDefault self.packages.${pkgs.system}.financier-dist;
};
};
}