mirror of
https://github.com/nix-community/flakelight.git
synced 2025-06-21 01:57:57 +02:00
Fix usage of devShell packages in formatters
Formatters should have the packages from devShell.packages, though a regression caused PATH to not be set in the formatter. This fixes that issue.
This commit is contained in:
parent
db9da2b1f7
commit
981e22f851
@ -28,8 +28,13 @@ in
|
|||||||
(mkIf (config.formatters != null) {
|
(mkIf (config.formatters != null) {
|
||||||
outputs.formatter = mkDefault (genSystems
|
outputs.formatter = mkDefault (genSystems
|
||||||
({ pkgs, lib, fd, coreutils, ... }:
|
({ pkgs, lib, fd, coreutils, ... }:
|
||||||
|
let
|
||||||
|
packages =
|
||||||
|
if config.devShell == null then [ ]
|
||||||
|
else (config.devShell pkgs).packages pkgs;
|
||||||
|
in
|
||||||
pkgs.writeShellScriptBin "formatter" ''
|
pkgs.writeShellScriptBin "formatter" ''
|
||||||
PATH=${lib.makeBinPath (config.devShell.packages or (_: [ ]) pkgs)}
|
PATH=${lib.makeBinPath packages}
|
||||||
for f in "$@"; do
|
for f in "$@"; do
|
||||||
if [ -d "$f" ]; then
|
if [ -d "$f" ]; then
|
||||||
${fd}/bin/fd "$f" -Htf -x "$0" &
|
${fd}/bin/fd "$f" -Htf -x "$0" &
|
||||||
|
Loading…
x
Reference in New Issue
Block a user