diff --git a/flake.nix b/flake.nix index 29cb4f1..4530228 100644 --- a/flake.nix +++ b/flake.nix @@ -11,7 +11,7 @@ }; outputs = - inputs@{ flake-parts, ... }: + inputs@{ flake-parts, nixpkgs, ... }: flake-parts.lib.mkFlake { inherit inputs; } { systems = [ "x86_64-linux" @@ -25,8 +25,15 @@ ]; perSystem = - { pkgs, ... }: + { system, pkgs, ... }: { + _module.args = { + pkgs = import nixpkgs { + inherit system; + config.allowUnfree = true; + }; + }; + treefmt = { projectRootFile = "flake.nix"; programs = { @@ -41,10 +48,19 @@ uv ruff pyright + google-chrome ]; shellHook = '' - export UV_PYTHON_PREFERENCE=only-system + export UV_PYTHON_PREFERENCE=managed + + # 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 ''; }; };