2022-07-08 08:51:21 +00:00
|
|
|
{
|
2023-03-08 17:42:19 +00:00
|
|
|
description = "LNbits, free and open-source Lightning wallet and accounts system";
|
|
|
|
|
2022-07-08 08:51:21 +00:00
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
2023-03-08 17:42:19 +00:00
|
|
|
poetry2nix = {
|
|
|
|
url = "github:nix-community/poetry2nix";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2022-07-08 08:51:21 +00:00
|
|
|
};
|
|
|
|
outputs = { self, nixpkgs, poetry2nix }@inputs:
|
|
|
|
let
|
2022-12-28 14:09:30 +00:00
|
|
|
supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
|
2022-07-08 08:51:21 +00:00
|
|
|
forSystems = systems: f:
|
|
|
|
nixpkgs.lib.genAttrs systems
|
|
|
|
(system: f system (import nixpkgs { inherit system; overlays = [ poetry2nix.overlay self.overlays.default ]; }));
|
|
|
|
forAllSystems = forSystems supportedSystems;
|
|
|
|
projectName = "lnbits";
|
|
|
|
in
|
|
|
|
{
|
|
|
|
devShells = forAllSystems (system: pkgs: {
|
|
|
|
default = pkgs.mkShell {
|
|
|
|
buildInputs = with pkgs; [
|
|
|
|
nodePackages.prettier
|
2023-03-08 17:42:19 +00:00
|
|
|
poetry
|
2022-07-08 08:51:21 +00:00
|
|
|
];
|
|
|
|
};
|
|
|
|
});
|
|
|
|
overlays = {
|
|
|
|
default = final: prev: {
|
|
|
|
${projectName} = self.packages.${final.hostPlatform.system}.${projectName};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
packages = forAllSystems (system: pkgs: {
|
|
|
|
default = self.packages.${system}.${projectName};
|
|
|
|
${projectName} = pkgs.poetry2nix.mkPoetryApplication {
|
|
|
|
projectDir = ./.;
|
|
|
|
};
|
|
|
|
});
|
2022-07-14 04:27:38 +00:00
|
|
|
nixosModules = {
|
2022-07-08 08:51:21 +00:00
|
|
|
default = { pkgs, lib, config, ... }: {
|
|
|
|
imports = [ "${./nix/modules/${projectName}-service.nix}" ];
|
|
|
|
nixpkgs.overlays = [ self.overlays.default ];
|
|
|
|
};
|
2022-07-14 04:27:38 +00:00
|
|
|
};
|
2022-07-08 08:51:21 +00: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...
|
|
|
|
}
|
|
|
|
);
|
|
|
|
};
|
|
|
|
}
|