mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
[Backport release-26.05] nixfmt: 1.2.0 → 1.3.1 (#526674)
This commit is contained in:
commit
3283f34ea6
2 changed files with 20 additions and 15 deletions
|
|
@ -24,10 +24,10 @@
|
|||
}:
|
||||
mkDerivation {
|
||||
pname = "nixfmt";
|
||||
version = "1.2.0";
|
||||
version = "1.3.1";
|
||||
src = fetchzip {
|
||||
url = "https://github.com/nixos/nixfmt/archive/v1.2.0.tar.gz";
|
||||
sha256 = "1qvj1sddh7bgggqnj7cnhvfh4iz1pwzc9a9awc1g7y349yvpwad3";
|
||||
url = "https://github.com/nixos/nixfmt/archive/v1.3.1.tar.gz";
|
||||
sha256 = "1c0iz6hrzafld8vkldcmall7fvby6xgzzqgap8c3bxwhaxhq86hm";
|
||||
};
|
||||
isLibrary = true;
|
||||
isExecutable = true;
|
||||
|
|
@ -58,6 +58,6 @@ mkDerivation {
|
|||
jailbreak = true;
|
||||
homepage = "https://github.com/NixOS/nixfmt";
|
||||
description = "Official formatter for Nix code";
|
||||
license = lib.licenses.mpl20;
|
||||
license = lib.meta.getLicenseFromSpdxId "MPL-2.0";
|
||||
mainProgram = "nixfmt";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,27 +2,32 @@
|
|||
haskell,
|
||||
haskellPackages,
|
||||
lib,
|
||||
runCommand,
|
||||
nixfmt,
|
||||
stdenv,
|
||||
versionCheckHook,
|
||||
}:
|
||||
let
|
||||
inherit (haskell.lib.compose) overrideCabal justStaticExecutables;
|
||||
|
||||
overrides = {
|
||||
cabalOverrides = drv: {
|
||||
passthru.updateScript = ./update.sh;
|
||||
|
||||
teams = [ lib.teams.formatter ];
|
||||
|
||||
# These tests can be run with the following command.
|
||||
#
|
||||
# $ nix-build -A nixfmt.tests
|
||||
passthru.tests = runCommand "nixfmt-tests" { nativeBuildInputs = [ nixfmt ]; } ''
|
||||
nixfmt --version > $out
|
||||
'';
|
||||
changelog = "https://github.com/NixOS/nixfmt/releases/tag/v${drv.version}";
|
||||
};
|
||||
|
||||
# haskellPackages.mkDerivation and haskell.lib.compose.overrideCabal
|
||||
# do not allow access to `doInstallCheck` or `nativeInstallCheckInputs`,
|
||||
# so we override directly with `.overrideAttrs`.
|
||||
lateOverrides = finalAttrs: prevAttrs: {
|
||||
doInstallCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
|
||||
nativeInstallCheckInputs = prevAttrs.nativeInstallCheckInputs or [ ] ++ [
|
||||
versionCheckHook
|
||||
];
|
||||
};
|
||||
|
||||
raw-pkg = haskellPackages.callPackage ./generated-package.nix { };
|
||||
in
|
||||
lib.pipe raw-pkg [
|
||||
(overrideCabal overrides)
|
||||
(overrideCabal cabalOverrides)
|
||||
justStaticExecutables
|
||||
(drv: drv.overrideAttrs lateOverrides)
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue