nix: Add deadnix to postgrest-lint and remove dead nix code
This commit is contained in:
+2
-2
@@ -77,7 +77,7 @@ let
|
|||||||
"-f dev --test-show-detail=direct";
|
"-f dev --test-show-detail=direct";
|
||||||
|
|
||||||
profiledHaskellPackages =
|
profiledHaskellPackages =
|
||||||
pkgs.haskell.packages."${compiler}".extend (self: super:
|
pkgs.haskell.packages."${compiler}".extend (_: super:
|
||||||
{
|
{
|
||||||
mkDerivation =
|
mkDerivation =
|
||||||
args:
|
args:
|
||||||
@@ -118,7 +118,7 @@ rec {
|
|||||||
pkgs.callPackage nix/tools/cabalTools.nix { inherit devCabalOptions postgrest; };
|
pkgs.callPackage nix/tools/cabalTools.nix { inherit devCabalOptions postgrest; };
|
||||||
|
|
||||||
withTools =
|
withTools =
|
||||||
pkgs.callPackage nix/tools/withTools.nix { inherit cabalTools devCabalOptions postgresqlVersions postgrest; };
|
pkgs.callPackage nix/tools/withTools.nix { inherit postgresqlVersions postgrest; };
|
||||||
|
|
||||||
# Development tools.
|
# Development tools.
|
||||||
devTools =
|
devTools =
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
, openssl
|
, openssl
|
||||||
, zlib
|
, zlib
|
||||||
, libkrb5
|
, libkrb5
|
||||||
, icu
|
|
||||||
, postgresql
|
, postgresql
|
||||||
, pkg-config
|
, pkg-config
|
||||||
, tzdata
|
, tzdata
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
self: super:
|
_: super:
|
||||||
# Overlay that adds `buildToolbox`, an enhanced version of `buildEnv`
|
# Overlay that adds `buildToolbox`, an enhanced version of `buildEnv`
|
||||||
{
|
{
|
||||||
buildToolbox = super.callPackage ./build-toolbox.nix { };
|
buildToolbox = super.callPackage ./build-toolbox.nix { };
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
self: super:
|
_: super:
|
||||||
# Overlay that adds `checkedShellScript`, an enhanced version of
|
# Overlay that adds `checkedShellScript`, an enhanced version of
|
||||||
# writeShellScript and writeShellScriptBin
|
# writeShellScript and writeShellScriptBin
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
self: super:
|
_: super:
|
||||||
# Overlay that adds the `gitignoreSource` function from Hercules-CI.
|
# Overlay that adds the `gitignoreSource` function from Hercules-CI.
|
||||||
# This function is useful for filtering which files are added to the Nix store.
|
# This function is useful for filtering which files are added to the Nix store.
|
||||||
# See: https://github.com/hercules-ci/gitignore.nix
|
# See: https://github.com/hercules-ci/gitignore.nix
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ let
|
|||||||
inherit (self.haskell) lib;
|
inherit (self.haskell) lib;
|
||||||
|
|
||||||
overrides =
|
overrides =
|
||||||
final: prev:
|
_: prev:
|
||||||
rec {
|
rec {
|
||||||
# To pin custom versions of Haskell packages:
|
# To pin custom versions of Haskell packages:
|
||||||
# protolude =
|
# protolude =
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
self: super:
|
_: _:
|
||||||
# Overlay that adds future versions of PostgreSQL that are supported by
|
# Overlay that adds future versions of PostgreSQL that are supported by
|
||||||
# PostgREST.
|
# PostgREST.
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
self: super:
|
_: _:
|
||||||
# Overlay that adds legacy versions of PostgreSQL that are supported by
|
# Overlay that adds legacy versions of PostgreSQL that are supported by
|
||||||
# PostgREST.
|
# PostgREST.
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
self: super:
|
_: super:
|
||||||
{
|
{
|
||||||
libpq = super.callPackage ../libpq.nix {
|
libpq = super.callPackage ../libpq.nix {
|
||||||
postgresql = super.postgresql_16;
|
postgresql = super.postgresql_16;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
final: prev:
|
_: prev:
|
||||||
{
|
{
|
||||||
slocat = prev.buildGoModule {
|
slocat = prev.buildGoModule {
|
||||||
name = "slocat";
|
name = "slocat";
|
||||||
|
|||||||
+3
-3
@@ -23,12 +23,12 @@ let
|
|||||||
enableNativeBignum = true;
|
enableNativeBignum = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
overrides = pkgs.lib.composeExtensions old.overrides (final: prev: {
|
overrides = pkgs.lib.composeExtensions old.overrides (_: prev: {
|
||||||
postgresql-libpq = (prev.postgresql-libpq.override {
|
postgresql-libpq = (prev.postgresql-libpq.override {
|
||||||
# postgresql doesn't build in the fully static overlay - but the default
|
# postgresql doesn't build in the fully static overlay - but the default
|
||||||
# derivation is built with static libraries anyway.
|
# derivation is built with static libraries anyway.
|
||||||
postgresql = pkgsCross.libpq;
|
postgresql = pkgsCross.libpq;
|
||||||
}).overrideAttrs (finalAttrs: prevAttrs: {
|
}).overrideAttrs (_: prevAttrs: {
|
||||||
# Using use-pkg-config flag, because pg_config won't work when cross-compiling
|
# Using use-pkg-config flag, because pg_config won't work when cross-compiling
|
||||||
configureFlags = prevAttrs.configureFlags ++ [
|
configureFlags = prevAttrs.configureFlags ++ [
|
||||||
"-fuse-pkg-config"
|
"-fuse-pkg-config"
|
||||||
@@ -38,7 +38,7 @@ let
|
|||||||
nativeBuildInputs = prevAttrs.nativeBuildInputs ++ [ pkgsCross.pkgsBuildHost.pkg-config ];
|
nativeBuildInputs = prevAttrs.nativeBuildInputs ++ [ pkgsCross.pkgsBuildHost.pkg-config ];
|
||||||
|
|
||||||
buildInputs = prevAttrs.buildInputs ++ [
|
buildInputs = prevAttrs.buildInputs ++ [
|
||||||
(pkgsStatic.libkrb5.overrideAttrs (finalAttrs: prevAttrs: {
|
(pkgsStatic.libkrb5.overrideAttrs (_: prevAttrs: {
|
||||||
configureFlags = prevAttrs.configureFlags ++ [
|
configureFlags = prevAttrs.configureFlags ++ [
|
||||||
"--sysconfdir=/etc"
|
"--sysconfdir=/etc"
|
||||||
# disable keyutils dependency, to avoid linking errors
|
# disable keyutils dependency, to avoid linking errors
|
||||||
|
|||||||
@@ -5,9 +5,7 @@
|
|||||||
, devCabalOptions
|
, devCabalOptions
|
||||||
, entr
|
, entr
|
||||||
, git
|
, git
|
||||||
, gnugrep
|
|
||||||
, graphviz
|
, graphviz
|
||||||
, haskellPackages
|
|
||||||
, hsie
|
, hsie
|
||||||
, nix
|
, nix
|
||||||
, silver-searcher
|
, silver-searcher
|
||||||
|
|||||||
+4
-1
@@ -2,6 +2,7 @@
|
|||||||
, black
|
, black
|
||||||
, buildToolbox
|
, buildToolbox
|
||||||
, checkedShellScript
|
, checkedShellScript
|
||||||
|
, deadnix
|
||||||
, git
|
, git
|
||||||
, hlint
|
, hlint
|
||||||
, hsie
|
, hsie
|
||||||
@@ -65,10 +66,12 @@ let
|
|||||||
echo "Linting workflows..."
|
echo "Linting workflows..."
|
||||||
${actionlint}/bin/actionlint
|
${actionlint}/bin/actionlint
|
||||||
|
|
||||||
|
echo "Scanning nix files for unused code..."
|
||||||
|
${deadnix}/bin/deadnix
|
||||||
|
|
||||||
echo "Checking consistency of import aliases in Haskell code..."
|
echo "Checking consistency of import aliases in Haskell code..."
|
||||||
${hsie} check-aliases main src
|
${hsie} check-aliases main src
|
||||||
|
|
||||||
|
|
||||||
echo "Linting Haskell files..."
|
echo "Linting Haskell files..."
|
||||||
# --vimgrep fixes a bug in ag: https://github.com/ggreer/the_silver_searcher/issues/753
|
# --vimgrep fixes a bug in ag: https://github.com/ggreer/the_silver_searcher/issues/753
|
||||||
${silver-searcher}/bin/ag -l --vimgrep -g '\.l?hs$' . \
|
${silver-searcher}/bin/ag -l --vimgrep -g '\.l?hs$' . \
|
||||||
|
|||||||
+1
-29
@@ -1,10 +1,6 @@
|
|||||||
{ bash-completion
|
{ buildToolbox
|
||||||
, buildToolbox
|
|
||||||
, cabal-install
|
|
||||||
, cabalTools
|
|
||||||
, checkedShellScript
|
, checkedShellScript
|
||||||
, curl
|
, curl
|
||||||
, devCabalOptions
|
|
||||||
, git
|
, git
|
||||||
, lib
|
, lib
|
||||||
, postgresqlVersions
|
, postgresqlVersions
|
||||||
@@ -276,30 +272,6 @@ let
|
|||||||
log-level="$(PGRST_LOG_LEVEL)"
|
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 =
|
waitForPgrstReady =
|
||||||
checkedShellScript
|
checkedShellScript
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user