nixpkgs/pkgs/by-name/ni/nixfmt-rfc-style/package.nix
Janne Heß 4b30e1a0d9
nixfmt-rfc-style: 2024-07-12 -> 2024-08-08
- nixfmt --version shows the actual version, closes https://github.com/NixOS/nixfmt/issues/229
- Support for pipe operators
- Fix for an infinite recursion
2024-08-08 11:12:51 +02:00

36 lines
814 B
Nix

{
haskell,
haskellPackages,
lib,
runCommand,
nixfmt-rfc-style,
}:
let
inherit (haskell.lib.compose) overrideCabal justStaticExecutables;
overrides = rec {
version = "unstable-${lib.fileContents ./date.txt}";
passthru.updateScript = ./update.sh;
maintainers = lib.teams.formatter.members;
preBuild = ''
echo -n 'nixpkgs-${version}' > .version
'';
# These tests can be run with the following command.
#
# $ nix-build -A nixfmt-rfc-style.tests
passthru.tests =
runCommand "nixfmt-rfc-style-tests" { nativeBuildInputs = [ nixfmt-rfc-style ]; }
''
nixfmt --version > $out
'';
};
raw-pkg = haskellPackages.callPackage ./generated-package.nix { };
in
lib.pipe raw-pkg [
(overrideCabal overrides)
justStaticExecutables
]