From 16845cae3c5f9d5e81752e2095cb62830be54f0c Mon Sep 17 00:00:00 2001 From: DavHau Date: Fri, 6 Sep 2024 15:44:29 +0200 Subject: [PATCH] tea-create-pr: get rid of runtime nix eval ...instead use our treefmt wrapper derivation which is exactly the same but doesn't require an eval at runtime --- pkgs/flake-module.nix | 2 +- pkgs/tea-create-pr/default.nix | 5 +++++ pkgs/tea-create-pr/script.sh | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pkgs/flake-module.nix b/pkgs/flake-module.nix index 841f4a179..713062ae3 100644 --- a/pkgs/flake-module.nix +++ b/pkgs/flake-module.nix @@ -24,7 +24,7 @@ { packages = { - tea-create-pr = pkgs.callPackage ./tea-create-pr { }; + tea-create-pr = pkgs.callPackage ./tea-create-pr { formatter = config.treefmt.build.wrapper; }; zerotier-members = pkgs.callPackage ./zerotier-members { }; zt-tcp-relay = pkgs.callPackage ./zt-tcp-relay { }; moonlight-sunshine-accept = pkgs.callPackage ./moonlight-sunshine-accept { }; diff --git a/pkgs/tea-create-pr/default.nix b/pkgs/tea-create-pr/default.nix index a22b9a282..20047430a 100644 --- a/pkgs/tea-create-pr/default.nix +++ b/pkgs/tea-create-pr/default.nix @@ -5,6 +5,8 @@ git, tea, openssh, + # our formatter + formatter, }: writeShellApplication { name = "tea-create-pr"; @@ -14,6 +16,9 @@ writeShellApplication { git tea openssh + + # our treefmt formatter wrapped with correct config + formatter ]; text = builtins.readFile ./script.sh; } diff --git a/pkgs/tea-create-pr/script.sh b/pkgs/tea-create-pr/script.sh index 87c7c219a..5399977a6 100755 --- a/pkgs/tea-create-pr/script.sh +++ b/pkgs/tea-create-pr/script.sh @@ -29,7 +29,7 @@ if ! check_remote "$remoteUpstream"; then exit 1 fi -nix fmt -- --fail-on-change --no-cache +treefmt --fail-on-change --no-cache upstream_url=$(git remote get-url "$remoteUpstream") set -x