Package Details: nixfmt 1.2.0-1

Git Clone URL: https://aur.archlinux.org/nixfmt.git (read-only, click to copy)
Package Base: nixfmt
Description: Official formatter for Nix code
Upstream URL: https://github.com/NixOS/nixfmt
Keywords: nix nixos
Licenses: MPL-2.0
Submitter: JamieMagee
Maintainer: JamieMagee
Last Packager: JamieMagee
Votes: 5
Popularity: 0.016123
First Submitted: 2020-06-21 15:13 (UTC)
Last Updated: 2026-01-13 03:36 (UTC)

Latest Comments

1 2 Next › Last »

JamieMagee commented on 2026-04-22 21:06 (UTC)

@hendrikcech this looks like a Haskell ABI mismatch on your system rather than a bug in the PKGBUILD. haskell-scientific and several other Haskell libraries were rebuilt on April 21 as part of a rebuild cycle, and if your system picked up some of those rebuilds but not others, ghc-pkg will silently mark scientific as broken because the ABI hashes don't line up.

Try running sudo pacman -Syu to make sure everything is in sync, and ghc-pkg check to verify no packages are broken.

I've seen this come up before during Haskell rebuild waves. It's a timing thing, not a packaging issue.

hendrikcech commented on 2026-04-22 12:17 (UTC) (edited on 2026-04-22 12:18 (UTC) by hendrikcech)

The build is broken for me:

==> Starting build()...
Write file: /var/tmp/pamac-build-cech/nixfmt/src/nixfmt-1.2.0/Setup.hs
Configuring nixfmt-1.2.0...
Error: Setup: Encountered missing or private dependencies:
scientific

afk commented on 2026-01-19 18:45 (UTC)

@JamieMagee Thanks! that fixed it.

JamieMagee commented on 2026-01-13 03:33 (UTC)

@afk This is a known issue with Haskell packages on Arch Linux1. The error occurs because nixfmt was compiled against a specific version of haskell-safe-exceptions, but your system now has a newer version with a different ABI hash. To fix it, rebuild the package.

afk commented on 2026-01-10 19:42 (UTC)

I get the error

nixfmt: error while loading shared libraries: libHSsafe-exceptions-0.1.7.4-E4MvEVy68oyKYPYoT6wh1Q-ghc9.4.8.so: cannot open shared object file: No such file or directory

Even when haskell-safe-exceptions is manually installed.

JamieMagee commented on 2025-04-08 04:35 (UTC)

Thank you! I applied your patch and pushed an update.

BBArik commented on 2025-04-07 15:46 (UTC)

Nixfmt does not provide a Setup.hs but it can be added with uusi's gen-setup. See https://github.com/berberman/arch-hs/issues/84

diff --git a/PKGBUILD b/PKGBUILD
index f18fcb8..c87c086 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -19,6 +19,7 @@ prepare() {
 build() {
   cd $pkgname-$pkgver

+  gen-setup
   runhaskell Setup configure -O --enable-shared --enable-executable-dynamic --disable-library-vanilla \
     --prefix=/usr --docdir=/usr/share/doc/$pkgname --datasubdir=$pkgname --enable-tests \
     --dynlibdir=/usr/lib --libsubdir=\$compiler/site-local/\$pkgid \

BBArik commented on 2025-04-05 23:15 (UTC)

I think you meant runhaskell Setup.hs instead of runhaskell Setup (see here)? I never did haskell but the last update cannot build because it cannot find Setup.

<no location info>: error: module ‘Setup’ cannot be found locally
==> ERROR: A failure occurred in build().
    Aborting...
 -> error making: nixfmt-exit status 4

JamieMagee commented on 2025-04-03 16:19 (UTC)

Regenerated using arch-hs, and pointed the source from https://github.com/serokell/nixfmt to https://github.com/NixOS/nixfmt

PeterWang-dev commented on 2025-01-23 16:21 (UTC)

Just adding 'haskell-safe-exceptions' to dependencies seems to get nixfmt work out of box.