diff --git a/flake.lock b/flake.lock index e82100a5..14657c9d 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", "owner": "edolstra", "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", "type": "github" }, "original": { @@ -21,11 +21,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1685518550, - "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", "owner": "numtide", "repo": "flake-utils", - "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", "type": "github" }, "original": { @@ -41,11 +41,11 @@ ] }, "locked": { - "lastModified": 1660459072, - "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", + "lastModified": 1703887061, + "narHash": "sha256-gGPa9qWNc6eCXT/+Z5/zMkyYOuRZqeFZBDbopNZQkuY=", "owner": "hercules-ci", "repo": "gitignore.nix", - "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", + "rev": "43e1aa1308018f37118e34d3a9cb4f5e75dc11d5", "type": "github" }, "original": { @@ -56,11 +56,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1689261696, - "narHash": "sha256-LzfUtFs9MQRvIoQ3MfgSuipBVMXslMPH/vZ+nM40LkA=", + "lastModified": 1704842529, + "narHash": "sha256-OTeQA+F8d/Evad33JMfuXC89VMetQbsU4qcaePchGr4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "df1eee2aa65052a18121ed4971081576b25d6b5c", + "rev": "eabe8d3eface69f5bb16c18f8662a702f50c20d5", "type": "github" }, "original": { @@ -72,16 +72,16 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1685801374, - "narHash": "sha256-otaSUoFEMM+LjBI1XL/xGB5ao6IwnZOXc47qhIgJe8U=", + "lastModified": 1704874635, + "narHash": "sha256-YWuCrtsty5vVZvu+7BchAxmcYzTMfolSPP5io8+WYCg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c37ca420157f4abc31e26f436c1145f8951ff373", + "rev": "3dc440faeee9e889fe2d1b4d25ad0f430d449356", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-23.05", + "ref": "nixos-23.11", "repo": "nixpkgs", "type": "github" } diff --git a/flake.nix b/flake.nix index a8d73522..3ca4cc32 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "Seamless integration of https://pre-commit.com git hooks with Nix."; inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; - inputs.nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-23.05"; + inputs.nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-23.11"; inputs.flake-utils.url = "github:numtide/flake-utils"; inputs.flake-compat = { url = "github:edolstra/flake-compat"; diff --git a/modules/hooks.nix b/modules/hooks.nix index 3127941d..f162b44c 100644 --- a/modules/hooks.nix +++ b/modules/hooks.nix @@ -298,9 +298,9 @@ in mkOption { type = types.str; description = lib.mdDoc "flake8 binary path. Should be used to specify flake8 binary from your Nix-managed Python environment."; - default = "${tools.python39Packages.flake8}/bin/flake8"; + default = "${tools.flake8}/bin/flake8"; defaultText = lib.literalExpression '' - "''${tools.python39Packages.flake8}/bin/flake8" + "''${tools.flake8}/bin/flake8" ''; }; extendIgnore = @@ -366,8 +366,8 @@ in mkOption { type = types.package; description = lib.mdDoc "The `flynt` package to use."; - default = "${tools.python311Packages.flynt}"; - defaultText = "\${pkgs.python311Packages.flynt}"; + default = "${tools.flynt}"; + defaultText = "\${tools.flynt}"; example = "\${pkgs.python310Packages.flynt}"; }; quiet = @@ -571,9 +571,9 @@ in mkOption { type = types.path; description = lib.mdDoc "mkdocs-linkcheck binary path. Should be used to specify the mkdocs-linkcheck binary from your Nix-managed Python environment."; - default = "${tools.python311Packages.mkdocs-linkcheck}/bin/mkdocs-linkcheck"; + default = "${tools.mkdocs-linkcheck}/bin/mkdocs-linkcheck"; defaultText = lib.literalExpression '' - "''${tools.python311Packages.mkdocs-linkcheck}/bin/mkdocs-linkcheck" + "''${tools.mkdocs-linkcheck}/bin/mkdocs-linkcheck" ''; }; @@ -654,9 +654,9 @@ in mkOption { type = types.str; description = lib.mdDoc "PHP-CS-Fixer binary path."; - default = "${tools.php82Packages.php-cs-fixer}/bin/php-cs-fixer"; + default = "${tools.php-cs-fixer}/bin/php-cs-fixer"; defaultText = lib.literalExpression '' - "''${tools.php81Packages.php-cs-fixer}/bin/php-cs-fixer" + "''${tools.php-cs-fixer}/bin/php-cs-fixer" ''; }; }; @@ -666,9 +666,9 @@ in mkOption { type = types.str; description = lib.mdDoc "PHP_CodeSniffer binary path."; - default = "${tools.php82Packages.phpcbf}/bin/phpcbf"; + default = "${tools.phpcbf}/bin/phpcbf"; defaultText = lib.literalExpression '' - "''${tools.php80Packages.phpcbf}/bin/phpcbf" + "''${tools.phpcbf}/bin/phpcbf" ''; }; }; @@ -678,9 +678,9 @@ in mkOption { type = types.str; description = lib.mdDoc "PHP_CodeSniffer binary path."; - default = "${tools.php82Packages.phpcs}/bin/phpcs"; + default = "${tools.phpcs}/bin/phpcs"; defaultText = lib.literalExpression '' - "''${tools.php80Packages.phpcs}/bin/phpcs" + "''${tools.phpcs}/bin/phpcs" ''; }; }; @@ -690,9 +690,9 @@ in mkOption { type = types.str; description = lib.mdDoc "PHPStan binary path."; - default = "${tools.php82Packages.phpstan}/bin/phpstan"; + default = "${tools.phpstan}/bin/phpstan"; defaultText = lib.literalExpression '' - "''${tools.php81Packages.phpstan}/bin/phpstan" + "''${tools.phpstan}/bin/phpstan" ''; }; }; @@ -942,9 +942,9 @@ in mkOption { type = types.str; description = lib.mdDoc "Psalm binary path."; - default = "${tools.php82Packages.psalm}/bin/psalm"; + default = "${tools.psalm}/bin/psalm"; defaultText = lib.literalExpression '' - "''${tools.php81Packages.phpstan}/bin/psalm" + "''${tools.psalm}/bin/psalm" ''; }; }; @@ -954,9 +954,9 @@ in mkOption { type = types.str; description = lib.mdDoc "Pylint binary path. Should be used to specify Pylint binary from your Nix-managed Python environment."; - default = "${tools.python39Packages.pylint}/bin/pylint"; + default = "${tools.pylint}/bin/pylint"; defaultText = lib.literalExpression '' - "''${tools.python39Packages.pylint}/bin/pylint" + "''${tools.pylint}/bin/pylint" ''; }; reports = @@ -1013,8 +1013,8 @@ in mkOption { type = types.path; description = lib.mdDoc "`rome` binary path. E.g. if you want to use the `rome` in `node_modules`, use `./node_modules/.bin/rome`."; - default = "${tools.rome}/bin/rome"; - defaultText = "\${tools.rome}/bin/rome"; + default = "${tools.biome}/bin/biome"; + defaultText = "\${tools.biome}/bin/biome"; }; write = @@ -1281,7 +1281,7 @@ in { name = "black"; description = "The uncompromising Python code formatter."; - entry = "${tools.python3Packages.black}/bin/black"; + entry = "${tools.black}/bin/black"; types = [ "file" "python" ]; }; cabal-fmt = @@ -1836,7 +1836,7 @@ in [ (profile != "") " --profile ${profile}" ] ]); in - "${pkgs.python3Packages.isort}/bin/isort${cmdArgs} ${settings.isort.flags}"; + "${tools.isort}/bin/isort${cmdArgs} ${settings.isort.flags}"; }; juliaformatter = { diff --git a/nix/default.nix b/nix/default.nix index c5416fa3..a50950dd 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -25,6 +25,27 @@ let nixpkgs-fmt.enable = true; }; }; + all-tools-eval = + let + config = pkgs.lib.evalModules { + modules = [ + ../modules/all-modules.nix + { + inherit tools; + settings.treefmt.package = pkgs.treefmt; + } + ]; + specialArgs = { inherit pkgs; }; + }; + allHooks = config.config.hooks; + allEntryPoints = pkgs.lib.mapAttrsToList (_: v: v.entry) allHooks; + in + pkgs.runCommand "all-tools-eval" + { + inherit allEntryPoints; + } '' + touch $out + ''; doc-check = let inherit (pkgs) lib; diff --git a/nix/headache/default.nix b/nix/headache/default.nix index 967f7a9e..014832da 100644 --- a/nix/headache/default.nix +++ b/nix/headache/default.nix @@ -11,5 +11,5 @@ stdenv.mkDerivation { name = "headache-stripped"; src = the-headache.src; phases = [ "installPhase" ]; - installPhase = "install -Dm 555 -t $out/bin ${lib.getExe the-headache}"; + installPhase = "install -Dm 555 -t $out/bin ${the-headache}/bin/headache"; } diff --git a/nix/terraform-fmt/default.nix b/nix/terraform-fmt/default.nix index 62bae817..2e18714a 100644 --- a/nix/terraform-fmt/default.nix +++ b/nix/terraform-fmt/default.nix @@ -1,4 +1,4 @@ -{ writeScriptBin, terraform }: +{ writeScriptBin, opentofu }: writeScriptBin "terraform-fmt" ''#!/usr/bin/env bash for arg in "$@"; do @@ -7,6 +7,6 @@ writeScriptBin "terraform-fmt" ''#!/usr/bin/env bash | sort \ | uniq \ | while read dir; do - ${terraform}/bin/terraform fmt "$dir" + ${opentofu}/bin/tofu fmt "$dir" done '' diff --git a/nix/tools.nix b/nix/tools.nix index 6bae4fc0..358b6715 100644 --- a/nix/tools.nix +++ b/nix/tools.nix @@ -3,6 +3,7 @@ , actionlint , alejandra , ansible-lint +, biome , cabal-fmt , cabal2nix , callPackage @@ -10,6 +11,8 @@ , checkmake , clang-tools , clippy +, cljfmt +, cmake-format , commitizen , conform , convco @@ -20,6 +23,7 @@ , dune_3 , eclint , editorconfig-checker +, elixir , elmPackages , fprettify , git @@ -48,7 +52,8 @@ , ormolu , pkgsBuildBuild , pre-commit-hook-ensure-sops ? null -, python39Packages +, python3Packages +, php82Packages , ruff ? null , runCommand , rustfmt @@ -60,11 +65,13 @@ , stylish-haskell , stylua , tagref +, taplo , texlive , tflint , topiary ? null ## Added in nixpkgs on Dec 2, 2022 , typos , typst-fmt +, zprint , yamllint , writeScript , writeText @@ -86,11 +93,14 @@ in alejandra ansible-lint beautysh + biome cabal2nix cabal-fmt cargo clang-tools clippy + cljfmt + cmake-format conform convco crystal @@ -99,6 +109,7 @@ in dhall eclint editorconfig-checker + elixir fprettify git-annex go @@ -128,17 +139,25 @@ in stylish-haskell stylua tagref + taplo topiary typos typst-fmt yamllint + zprint ; inherit (elmPackages) elm-format elm-review elm-test; # TODO: these two should be statically compiled inherit (haskellPackages) fourmolu; inherit (luaPackages) luacheck; - inherit (nodePackages) eslint markdownlint-cli prettier cspell; + inherit (nodePackages) eslint markdownlint-cli prettier pyright cspell; inherit (ocamlPackages) ocp-indent; + inherit (python3Packages) autoflake black flake8 flynt isort mkdocs-linkcheck mypy pylint pyupgrade; + inherit (php82Packages) php-cs-fixer phpcbf phpcs psalm; + # FIXME: workaround build failure + phpstan = php82Packages.phpstan.overrideAttrs (old: { + composerStrictValidation = false; + }); lua-language-server = lua-language-server; purs-tidy = nodePackages.purs-tidy or null; cabal2nix-dir = callPackage ./cabal2nix-dir { };