ip-checker/flake.nix

57 lines
1.5 KiB
Nix
Raw Normal View History

2024-08-26 22:01:24 +00:00
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils = {
url = "github:numtide/flake-utils";
inputs.systems.follows = "systems";
};
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
### De-dupe flake dependencies
systems.url = "github:nix-systems/default";
};
outputs =
inputs:
inputs.flake-utils.lib.eachDefaultSystem (
system:
let
2024-10-26 07:27:02 +00:00
inherit (pkgs) lib;
2024-08-26 22:01:24 +00:00
pkgs = inputs.nixpkgs.legacyPackages.${system};
treefmtEval = inputs.treefmt-nix.lib.evalModule pkgs ./treefmt.nix;
in
{
### nix {run,shell,build}
2024-10-26 07:27:02 +00:00
packages = rec {
default = lib.warn "the 'default' package is now deprecated, please use the 'api' package instead." api;
inherit ((pkgs.callPackage ./package.nix { })) api ui;
};
2024-08-26 22:01:24 +00:00
### nix fmt
formatter = treefmtEval.config.build.wrapper;
### nix flake check
checks.formatting = treefmtEval.config.build.check inputs.self;
### nix develop
2024-11-02 08:16:18 +00:00
devShells.default = pkgs.mkShellNoCC {
2024-08-26 22:01:24 +00:00
nativeBuildInputs = with pkgs; [
go
nodePackages.prettier
2024-10-26 07:27:02 +00:00
nodejs
pnpm
2024-08-26 22:01:24 +00:00
];
2024-11-02 08:16:18 +00:00
shellHook = ''
export IP_CHECKER_CITY_DB=${pkgs.dbip-city-lite.mmdb}
export IP_CHECKER_ASN_DB=${pkgs.dbip-asn-lite.mmdb}
export IP_CHECKER_MODE=dev
'';
2024-08-26 22:01:24 +00:00
};
}
);
}