Skip to content

Commit

Permalink
flake: Remove formatter excludes, as there are no more autogenerated …
Browse files Browse the repository at this point in the history
  • Loading branch information
traxys authored Aug 28, 2023
1 parent 5f9a56f commit b393989
Showing 1 changed file with 1 addition and 28 deletions.
29 changes: 1 addition & 28 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -112,34 +112,7 @@
};
};
};
formatter = let
# We need to exclude the plugins/_sources/* files as they are autogenerated
# nix formatter only takes a derivation so we need to make a proxy that passes
# the correct flags
excludeWrapper = {
stdenv,
alejandra,
writeShellScript,
...
}:
stdenv.mkDerivation {
pname = "alejandra-excludes";
inherit (alejandra) version;

dontUnpack = true;
dontBuild = true;
installPhase = let
script = writeShellScript "alejandra-excludes.sh" ''
${alejandra}/bin/alejandra --exclude ./plugins/_sources "$@"
'';
in ''
mkdir -p $out/bin
cp ${script} $out/bin/alejandra-excludes
'';
};
in
pkgs.callPackage excludeWrapper {};

formatter = pkgs.alejandra;
lib = import ./lib {
inherit pkgs;
inherit (pkgs) lib;
Expand Down

0 comments on commit b393989

Please sign in to comment.