From 3de96017640b6dc25f1544a1bafd4b370bb1cea0 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Sun, 17 Sep 2023 19:27:52 +0200 Subject: feat(users/Profpatsch/whatcd-resolver): add executable Change-Id: I28f5c26443b9a878f8f374af2c7935831d17ab12 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9355 Tested-by: BuildkiteCI Autosubmit: Profpatsch Reviewed-by: Profpatsch --- users/Profpatsch/whatcd-resolver/Main.hs | 6 ++++++ users/Profpatsch/whatcd-resolver/default.nix | 24 +++++++++++++++++++++- .../whatcd-resolver/whatcd-resolver.cabal | 8 ++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 users/Profpatsch/whatcd-resolver/Main.hs (limited to 'users') diff --git a/users/Profpatsch/whatcd-resolver/Main.hs b/users/Profpatsch/whatcd-resolver/Main.hs new file mode 100644 index 0000000000..21cd80cbf0 --- /dev/null +++ b/users/Profpatsch/whatcd-resolver/Main.hs @@ -0,0 +1,6 @@ +module Main where + +import WhatcdResolver qualified + +main :: IO () +main = WhatcdResolver.main diff --git a/users/Profpatsch/whatcd-resolver/default.nix b/users/Profpatsch/whatcd-resolver/default.nix index 17200ffe93..d5de63c497 100644 --- a/users/Profpatsch/whatcd-resolver/default.nix +++ b/users/Profpatsch/whatcd-resolver/default.nix @@ -9,6 +9,7 @@ let src = depot.users.Profpatsch.exactSource ./. [ ./whatcd-resolver.cabal + ./Main.hs ./src/WhatcdResolver.hs ]; @@ -43,5 +44,26 @@ let license = lib.licenses.mit; }; + bins = depot.nix.getBins whatcd-resolver [ "whatcd-resolver" ]; + in -whatcd-resolver + +depot.nix.writeExecline "whatcd-resolver-wrapped" { } [ + "importas" + "-i" + "PATH" + "PATH" + "export" + "PATH" + "${pkgs.postgresql}/bin:$${PATH}" + "export" + "WHATCD_RESOLVER_TOOLS" + (pkgs.linkFarm "whatcd-resolver-tools" [ + { + name = "pg_format"; + path = "${pkgs.pgformatter}/bin/pg_format"; + } + ]) + bins.whatcd-resolver +] + diff --git a/users/Profpatsch/whatcd-resolver/whatcd-resolver.cabal b/users/Profpatsch/whatcd-resolver/whatcd-resolver.cabal index d05182deb3..c605cd4f02 100644 --- a/users/Profpatsch/whatcd-resolver/whatcd-resolver.cabal +++ b/users/Profpatsch/whatcd-resolver/whatcd-resolver.cabal @@ -94,3 +94,11 @@ library wai, warp, +executable whatcd-resolver + import: common-options + + main-is: Main.hs + + build-depends: + base >=4.15 && <5, + whatcd-resolver -- cgit 1.4.1