nix: Add deadnix to postgrest-lint and remove dead nix code

This commit is contained in:
Wolfgang Walther
2024-02-24 13:08:04 +01:00
parent caf0a70171
commit ccc386cf38
14 changed files with 18 additions and 46 deletions
+2 -2
View File
@@ -77,7 +77,7 @@ let
"-f dev --test-show-detail=direct";
profiledHaskellPackages =
pkgs.haskell.packages."${compiler}".extend (self: super:
pkgs.haskell.packages."${compiler}".extend (_: super:
{
mkDerivation =
args:
@@ -118,7 +118,7 @@ rec {
pkgs.callPackage nix/tools/cabalTools.nix { inherit devCabalOptions postgrest; };
withTools =
pkgs.callPackage nix/tools/withTools.nix { inherit cabalTools devCabalOptions postgresqlVersions postgrest; };
pkgs.callPackage nix/tools/withTools.nix { inherit postgresqlVersions postgrest; };
# Development tools.
devTools =
-1
View File
@@ -11,7 +11,6 @@
, openssl
, zlib
, libkrb5
, icu
, postgresql
, pkg-config
, tzdata
+1 -1
View File
@@ -1,4 +1,4 @@
self: super:
_: super:
# Overlay that adds `buildToolbox`, an enhanced version of `buildEnv`
{
buildToolbox = super.callPackage ./build-toolbox.nix { };
@@ -1,4 +1,4 @@
self: super:
_: super:
# Overlay that adds `checkedShellScript`, an enhanced version of
# writeShellScript and writeShellScriptBin
{
+1 -1
View File
@@ -1,4 +1,4 @@
self: super:
_: super:
# Overlay that adds the `gitignoreSource` function from Hercules-CI.
# This function is useful for filtering which files are added to the Nix store.
# See: https://github.com/hercules-ci/gitignore.nix
+1 -1
View File
@@ -5,7 +5,7 @@ let
inherit (self.haskell) lib;
overrides =
final: prev:
_: prev:
rec {
# To pin custom versions of Haskell packages:
# protolude =
+1 -1
View File
@@ -1,4 +1,4 @@
self: super:
_: _:
# Overlay that adds future versions of PostgreSQL that are supported by
# PostgREST.
{
+1 -1
View File
@@ -1,4 +1,4 @@
self: super:
_: _:
# Overlay that adds legacy versions of PostgreSQL that are supported by
# PostgREST.
{
+1 -1
View File
@@ -1,4 +1,4 @@
self: super:
_: super:
{
libpq = super.callPackage ../libpq.nix {
postgresql = super.postgresql_16;
+1 -1
View File
@@ -1,4 +1,4 @@
final: prev:
_: prev:
{
slocat = prev.buildGoModule {
name = "slocat";
+3 -3
View File
@@ -23,12 +23,12 @@ let
enableNativeBignum = true;
};
overrides = pkgs.lib.composeExtensions old.overrides (final: prev: {
overrides = pkgs.lib.composeExtensions old.overrides (_: prev: {
postgresql-libpq = (prev.postgresql-libpq.override {
# postgresql doesn't build in the fully static overlay - but the default
# derivation is built with static libraries anyway.
postgresql = pkgsCross.libpq;
}).overrideAttrs (finalAttrs: prevAttrs: {
}).overrideAttrs (_: prevAttrs: {
# Using use-pkg-config flag, because pg_config won't work when cross-compiling
configureFlags = prevAttrs.configureFlags ++ [
"-fuse-pkg-config"
@@ -38,7 +38,7 @@ let
nativeBuildInputs = prevAttrs.nativeBuildInputs ++ [ pkgsCross.pkgsBuildHost.pkg-config ];
buildInputs = prevAttrs.buildInputs ++ [
(pkgsStatic.libkrb5.overrideAttrs (finalAttrs: prevAttrs: {
(pkgsStatic.libkrb5.overrideAttrs (_: prevAttrs: {
configureFlags = prevAttrs.configureFlags ++ [
"--sysconfdir=/etc"
# disable keyutils dependency, to avoid linking errors
-2
View File
@@ -5,9 +5,7 @@
, devCabalOptions
, entr
, git
, gnugrep
, graphviz
, haskellPackages
, hsie
, nix
, silver-searcher
+4 -1
View File
@@ -2,6 +2,7 @@
, black
, buildToolbox
, checkedShellScript
, deadnix
, git
, hlint
, hsie
@@ -65,10 +66,12 @@ let
echo "Linting workflows..."
${actionlint}/bin/actionlint
echo "Scanning nix files for unused code..."
${deadnix}/bin/deadnix
echo "Checking consistency of import aliases in Haskell code..."
${hsie} check-aliases main src
echo "Linting Haskell files..."
# --vimgrep fixes a bug in ag: https://github.com/ggreer/the_silver_searcher/issues/753
${silver-searcher}/bin/ag -l --vimgrep -g '\.l?hs$' . \
+1 -29
View File
@@ -1,10 +1,6 @@
{ bash-completion
, buildToolbox
, cabal-install
, cabalTools
{ buildToolbox
, checkedShellScript
, curl
, devCabalOptions
, git
, lib
, postgresqlVersions
@@ -276,30 +272,6 @@ let
log-level="$(PGRST_LOG_LEVEL)"
'';
waitForPgrstPid =
checkedShellScript
{
name = "postgrest-wait-for-pgrst-pid";
docs = "Wait for PostgREST to be running. Needs to be a separate command for timeout to work below.";
args = [
"ARG_USE_ENV([PGRST_SERVER_UNIX_SOCKET], [], [Unix socket to check for running PostgREST instance])"
];
}
''
# ARG_USE_ENV only adds defaults or docs for environment variables
# We manually implement a required check here
# See also: https://github.com/matejak/argbash/issues/80
: "''${PGRST_SERVER_UNIX_SOCKET:?PGRST_SERVER_UNIX_SOCKET is required}"
until [ -S "$PGRST_SERVER_UNIX_SOCKET" ]
do
sleep 0.1
done
# return pid of postgrest process
lsof -t -c '/^postgrest$/' "$PGRST_SERVER_UNIX_SOCKET"
'';
waitForPgrstReady =
checkedShellScript
{