2022-07-08 10:51:21 +02:00
|
|
|
{
|
2023-03-08 18:42:19 +01:00
|
|
|
description = "LNbits, free and open-source Lightning wallet and accounts system";
|
|
|
|
|
2022-07-08 10:51:21 +02:00
|
|
|
inputs = {
|
2023-12-06 10:36:10 +01:00
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
|
2023-03-08 18:42:19 +01:00
|
|
|
poetry2nix = {
|
|
|
|
url = "github:nix-community/poetry2nix";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2022-07-08 10:51:21 +02:00
|
|
|
};
|
|
|
|
outputs = { self, nixpkgs, poetry2nix }@inputs:
|
|
|
|
let
|
2022-12-28 15:09:30 +01:00
|
|
|
supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
|
2022-07-08 10:51:21 +02:00
|
|
|
forSystems = systems: f:
|
|
|
|
nixpkgs.lib.genAttrs systems
|
2023-12-06 10:36:10 +01:00
|
|
|
(system: f system (import nixpkgs { inherit system; overlays = [ poetry2nix.overlays.default self.overlays.default ]; }));
|
2022-07-08 10:51:21 +02:00
|
|
|
forAllSystems = forSystems supportedSystems;
|
|
|
|
projectName = "lnbits";
|
|
|
|
in
|
|
|
|
{
|
|
|
|
devShells = forAllSystems (system: pkgs: {
|
|
|
|
default = pkgs.mkShell {
|
|
|
|
buildInputs = with pkgs; [
|
|
|
|
nodePackages.prettier
|
2023-12-06 10:36:10 +01:00
|
|
|
poetry-core
|
2022-07-08 10:51:21 +02:00
|
|
|
];
|
|
|
|
};
|
|
|
|
});
|
|
|
|
overlays = {
|
|
|
|
default = final: prev: {
|
2023-10-03 10:50:35 +02:00
|
|
|
${projectName} = self.packages.${prev.stdenv.hostPlatform.system}.${projectName};
|
2022-07-08 10:51:21 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
packages = forAllSystems (system: pkgs: {
|
|
|
|
default = self.packages.${system}.${projectName};
|
|
|
|
${projectName} = pkgs.poetry2nix.mkPoetryApplication {
|
|
|
|
projectDir = ./.;
|
2023-10-03 10:50:35 +02:00
|
|
|
meta.rev = self.dirtyRev or self.rev;
|
|
|
|
overrides = pkgs.poetry2nix.overrides.withDefaults (final: prev: {
|
2023-12-06 10:36:10 +01:00
|
|
|
protobuf = prev.protobuf.override { preferWheel = true; };
|
2023-10-03 10:50:35 +02:00
|
|
|
ruff = prev.ruff.override { preferWheel = true; };
|
2023-11-27 10:45:16 +01:00
|
|
|
wallycore = prev.wallycore.override { preferWheel = true; };
|
2023-10-03 10:50:35 +02:00
|
|
|
});
|
2022-07-08 10:51:21 +02:00
|
|
|
};
|
|
|
|
});
|
2022-07-14 06:27:38 +02:00
|
|
|
nixosModules = {
|
2022-07-08 10:51:21 +02:00
|
|
|
default = { pkgs, lib, config, ... }: {
|
|
|
|
imports = [ "${./nix/modules/${projectName}-service.nix}" ];
|
|
|
|
nixpkgs.overlays = [ self.overlays.default ];
|
|
|
|
};
|
2022-07-14 06:27:38 +02:00
|
|
|
};
|
2022-07-08 10:51:21 +02:00
|
|
|
checks = forAllSystems (system: pkgs:
|
|
|
|
let
|
|
|
|
vmTests = import ./nix/tests {
|
|
|
|
makeTest = (import (nixpkgs + "/nixos/lib/testing-python.nix") { inherit system; }).makeTest;
|
|
|
|
inherit inputs pkgs;
|
|
|
|
};
|
|
|
|
in
|
|
|
|
pkgs.lib.optionalAttrs pkgs.stdenv.isLinux vmTests # vmTests can only be ran on Linux, so append them only if on Linux.
|
|
|
|
//
|
|
|
|
{
|
|
|
|
# Other checks here...
|
|
|
|
}
|
|
|
|
);
|
|
|
|
};
|
|
|
|
}
|