From 88ea86a97091d2131171d077977f3699a05ff1fc Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Wed, 19 Aug 2026 22:54:29 +0100 Subject: [PATCH] maintainers/haskell: format with treefmt config --- maintainers/scripts/haskell/regenerate-hackage-packages.sh | 4 ++-- maintainers/scripts/haskell/update-cabal2nix-unstable.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/maintainers/scripts/haskell/regenerate-hackage-packages.sh b/maintainers/scripts/haskell/regenerate-hackage-packages.sh index d2c5c25c65f8..5033072b385d 100755 --- a/maintainers/scripts/haskell/regenerate-hackage-packages.sh +++ b/maintainers/scripts/haskell/regenerate-hackage-packages.sh @@ -1,5 +1,5 @@ #! /usr/bin/env nix-shell -#! nix-shell -i bash -p coreutils haskellPackages.cabal2nix-unstable.bin git -I nixpkgs=. +#! nix-shell -i bash -E 'with import ../../.. {}; mkShell { packages = [ bash coreutils haskellPackages.cabal2nix-unstable.bin git (import ../../../ci {}).fmt.pkg ]; }' set -euo pipefail @@ -102,7 +102,7 @@ run_hackage2nix fi -nixfmt pkgs/development/haskell-modules/hackage-packages.nix +treefmt --no-cache pkgs/development/haskell-modules/hackage-packages.nix if [[ "$DO_COMMIT" -eq 1 ]]; then git add pkgs/development/haskell-modules/configuration-hackage2nix/transitive-broken.yaml diff --git a/maintainers/scripts/haskell/update-cabal2nix-unstable.sh b/maintainers/scripts/haskell/update-cabal2nix-unstable.sh index a9f3dc588383..e3c498e98738 100755 --- a/maintainers/scripts/haskell/update-cabal2nix-unstable.sh +++ b/maintainers/scripts/haskell/update-cabal2nix-unstable.sh @@ -1,5 +1,5 @@ #! /usr/bin/env nix-shell -#! nix-shell -i bash -p coreutils curl jq gnused haskellPackages.cabal2nix-unstable.bin nix-prefetch-scripts -I nixpkgs=. +#! nix-shell -i bash -E 'with import ../../.. {}; mkShell { packages = [ bash coreutils curl jq gnused haskellPackages.cabal2nix-unstable.bin nix-prefetch-scripts (import ../../../ci {}).fmt.pkg ]; }' # Updates cabal2nix-unstable to the latest master of the nixos/cabal2nix repository. # See regenerate-hackage-packages.sh for details on the purpose of this script. @@ -18,7 +18,7 @@ function mkPackage() { output=pkgs/development/haskell-modules/cabal2nix-unstable/$1.nix echo "# This file defines $1-unstable, used by maintainers/scripts/haskell/regenerate-hackage-packages.sh." > "$output" cabal2nix --subpath "$1" "https://github.com/NixOS/cabal2nix/archive/$commit.tar.gz" | sed -Ee 's/version = "(.*)"/version = "\1-unstable-'"$date"'"/' >> "$output" - nixfmt "$output" + treefmt --no-cache "$output" } mkPackage "cabal2nix"