From 66bc6c90428dbaca1ac2af331bf4c0f08bd292ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 10 Oct 2024 15:55:53 +0200 Subject: [PATCH] more reliable check if formatters are available Co-authored-by: Sandro --- default.nix | 2 +- treefmt.nix | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/default.nix b/default.nix index 761a47a..6b2642e 100644 --- a/default.nix +++ b/default.nix @@ -6,7 +6,7 @@ pkgs.python3.pkgs.buildPythonApplication { pname = "nix-update"; version = "1.5.2"; src = ./.; - format = "pyproject"; + pyproject = true; buildInputs = [ pkgs.makeWrapper ]; nativeBuildInputs = [ pkgs.python3.pkgs.setuptools ]; nativeCheckInputs = [ diff --git a/treefmt.nix b/treefmt.nix index a6f5ab9..cbc0445 100644 --- a/treefmt.nix +++ b/treefmt.nix @@ -9,18 +9,17 @@ # Used to find the project root projectRootFile = "flake.lock"; - programs.deno.enable = - pkgs.lib.meta.availableOn pkgs.stdenv.hostPlatform pkgs.deno && !pkgs.deno.meta.broken; + programs.deno.enable = (builtins.tryEval pkgs.deno).success; programs.mypy.enable = true; programs.yamlfmt.enable = true; - programs.nixfmt.enable = pkgs.lib.meta.availableOn pkgs.stdenv.buildPlatform pkgs.nixfmt-rfc-style.compiler; + programs.nixfmt.enable = (builtins.tryEval pkgs.nixfmt-rfc-style).success; programs.deadnix.enable = true; programs.ruff.format = true; programs.ruff.check = true; - programs.shellcheck.enable = pkgs.lib.meta.availableOn pkgs.stdenv.buildPlatform pkgs.shellcheck.compiler; + programs.shellcheck.enable = (builtins.tryEval pkgs.shellcheck).success; programs.shfmt.enable = true; settings.formatter.shfmt.includes = [ "*.envrc" ]; };