74 lines
1.9 KiB
Nix
74 lines
1.9 KiB
Nix
{
|
|
description = "auto-reverse — automated reverse engineering CLI";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
|
treefmt-nix = {
|
|
url = "github:numtide/treefmt-nix";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
};
|
|
|
|
outputs =
|
|
inputs@{ flake-parts, nixpkgs, ... }:
|
|
flake-parts.lib.mkFlake { inherit inputs; } {
|
|
systems = [
|
|
"x86_64-linux"
|
|
"aarch64-linux"
|
|
"x86_64-darwin"
|
|
"aarch64-darwin"
|
|
];
|
|
|
|
imports = [
|
|
inputs.treefmt-nix.flakeModule
|
|
];
|
|
|
|
perSystem =
|
|
{ system, pkgs, ... }:
|
|
{
|
|
_module.args = {
|
|
pkgs = import nixpkgs {
|
|
inherit system;
|
|
config.allowUnfree = true;
|
|
};
|
|
};
|
|
|
|
treefmt = {
|
|
projectRootFile = "flake.nix";
|
|
programs = {
|
|
nixfmt.enable = true;
|
|
ruff-check.enable = true;
|
|
ruff-format.enable = true;
|
|
};
|
|
};
|
|
|
|
devShells.default = pkgs.mkShell {
|
|
packages = with pkgs; [
|
|
uv
|
|
ruff
|
|
pyright
|
|
google-chrome
|
|
];
|
|
|
|
shellHook = ''
|
|
export UV_PYTHON_PREFERENCE=managed
|
|
|
|
# Load API keys from .env if present
|
|
if [ -f .env ]; then
|
|
set -a; source .env; set +a
|
|
fi
|
|
|
|
# Set Playwright browser path (prefer system Chrome, fallback to nixpkg)
|
|
if [ -f /run/current-system/sw/bin/google-chrome ]; then
|
|
export PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH=/run/current-system/sw/bin/google-chrome
|
|
else
|
|
export PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH=${pkgs.google-chrome}/bin/google-chrome
|
|
fi
|
|
export PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS=true
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
}
|