From 33558505dda4d9a611a593eebece2759f6a5db2a Mon Sep 17 00:00:00 2001 From: David Barroso Date: Fri, 27 Sep 2024 21:19:38 +0200 Subject: [PATCH] chore: update nixops (#24) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### **PR Type** Enhancement ___ ### **Description** - Updated Go version from 1.22 to 1.23 and related tools (golangci-lint, mockgen, gqlgen, gqlgenc, oapi-codegen) to their latest versions in `overlays/go.nix`. - Upgraded nhost-cli to version 1.24.5 and updated corresponding SHA256 hashes for all platforms in `overlays/nhost-cli.nix`. - Enhanced PostgreSQL overlay with locale support: - Added specific UTF-8 locales configuration. - Updated postFixup for all PostgreSQL versions to include locale archive wrapping. - Added 'dev' to outputs for better package management. - Modified AI review workflow configuration in `.github/workflows/gen_ai_review.yaml` to use 'ignore.glob' instead of 'config.ignore.glob'. ___ ### **Changes walkthrough** 📝
Relevant files
Dependencies
go.nix
Update Go and related tools versions                                         

overlays/go.nix
  • Updated Go version from 1.22 to 1.23
  • Updated golangci-lint, mockgen, gqlgen, gqlgenc, and oapi-codegen
    versions
  • Minor syntax improvements and variable renaming
  • +15/-15 
    nhost-cli.nix
    Upgrade nhost-cli to version 1.24.5                                           

    overlays/nhost-cli.nix
  • Updated nhost-cli version from v1.24.1 to v1.24.5
  • Updated SHA256 hashes for all platform-specific downloads
  • +10/-10 
    Enhancement
    postgres.nix
    Enhance PostgreSQL overlay with locale support                     

    overlays/postgres.nix
  • Added locales configuration for specific UTF-8 locales
  • Updated postFixup for PostgreSQL versions to include locale archive
    wrapping
  • Added 'dev' to outputs for all PostgreSQL versions
  • +35/-6   
    Configuration changes
    gen_ai_review.yaml
    Update AI review workflow configuration                                   

    .github/workflows/gen_ai_review.yaml
  • Changed 'config.ignore.glob' to 'ignore.glob' in the workflow
    configuration
  • +1/-1     
    ___ > 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull request to receive relevant information --- .github/workflows/gen_ai_review.yaml | 2 +- flake.lock | 6 +- overlays/go.nix | 30 +++--- overlays/nhost-cli.nix | 20 ++-- overlays/postgres.nix | 136 ++++++++++----------------- 5 files changed, 77 insertions(+), 117 deletions(-) diff --git a/.github/workflows/gen_ai_review.yaml b/.github/workflows/gen_ai_review.yaml index d8660bf..f367816 100644 --- a/.github/workflows/gen_ai_review.yaml +++ b/.github/workflows/gen_ai_review.yaml @@ -25,4 +25,4 @@ jobs: config.max_model_tokens: 100000 config.model: "anthropic/claude-3-5-sonnet-20240620" config.model_turbo: "anthropic/claude-3-5-sonnet-20240620" - config.ignore.glob: "vendor/**,**/client_gen.go,**/models_gen.go,**/generated.go,**/*.gen.go" + ignore.glob: "vendor/**,**/client_gen.go,**/models_gen.go,**/generated.go,**/*.gen.go" diff --git a/flake.lock b/flake.lock index 643b538..1cd356b 100644 --- a/flake.lock +++ b/flake.lock @@ -35,11 +35,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1727296349, - "narHash": "sha256-C3SRU3GMDNII9l16o4+nkybuxaDX4x5TBypwmmUBCo0=", + "lastModified": 1727335715, + "narHash": "sha256-1uw3y94dA4l22LkqHRIsb7qr3rV5XdxQFqctINfx8Cc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "fe866c653c24adf1520628236d4e70bbb2fdd949", + "rev": "28b5b8af91ffd2623e995e20aee56510db49001a", "type": "github" }, "original": { diff --git a/overlays/go.nix b/overlays/go.nix index e68d919..610c8f0 100644 --- a/overlays/go.nix +++ b/overlays/go.nix @@ -1,5 +1,5 @@ final: prev: rec { - go = prev.go_1_22.overrideAttrs + go = prev.go_1_23.overrideAttrs (finalAttrs: previousAttrs: rec { version = "1.23.1"; @@ -12,8 +12,8 @@ final: prev: rec { buildGoModule = prev.buildGoModule.override { go = go; }; - golangci-lint = prev.golangci-lint.override rec { - buildGoModule = args: final.buildGoModule (args // rec { + golangci-lint = prev.golangci-lint.override { + buildGo123Module = args: final.buildGoModule (args // rec { version = "1.61.0"; src = prev.fetchFromGitHub { owner = "golangci"; @@ -34,7 +34,7 @@ final: prev: rec { }); }; - mockgen = prev.mockgen.override rec { + mockgen = prev.mockgen.override { buildGoModule = args: final.buildGoModule (args // rec { version = "0.4.0"; src = final.fetchFromGitHub { @@ -47,7 +47,7 @@ final: prev: rec { }); }; - golines = final.buildGoModule rec { + golines = final.buildGoModule { name = "golines"; version = "0.11.0"; src = final.fetchFromGitHub { @@ -89,16 +89,16 @@ final: prev: rec { gqlgen = final.buildGoModule rec { pname = "gqlgen"; - version = "0.17.49"; + version = "0.17.54"; src = final.fetchFromGitHub { owner = "99designs"; repo = pname; rev = "v${version}"; - sha256 = "sha256-dHKK21xIc7C0Ei/4+WHrVaDMFikZxHP6hTA8zF9ZEZ8="; + sha256 = "sha256-0aoEVvKsdWJd3+aC7NuC6gs81dRRByy2TVrV4l9MdWE="; }; - vendorHash = "sha256-1NxgK/4ccUqf0m3rJkM0FXKK5wNJmCeCNnV2FyZVRoQ="; + vendorHash = "sha256-wsuep7K5SlkTWCiOuzjrkODZgAsHDa9wO8nnwWQVYco="; doCheck = false; @@ -114,16 +114,16 @@ final: prev: rec { gqlgenc = final.buildGoModule rec { pname = "gqlgenc"; - version = "0.24.0"; + version = "0.25.2"; src = final.fetchFromGitHub { owner = "Yamashou"; repo = pname; rev = "v${version}"; - sha256 = "sha256-tKEHqo7drOwHIRCgKEXbELi0u9uRpXSwB9R1fPhv/PE="; + sha256 = "sha256-g+l493Nt0SuW4gwJh0s9Zeejpyx2oLxVDykIvBup638="; }; - vendorHash = "sha256-lQ2KQF+55qvscnYfm1jLK/4DdwFBaRZmv9oa/BUSoXI="; + vendorHash = "sha256-YGFMQrxghJIgmiwEPfEqaACH7OETVkD8O7oUhm9foJo="; doCheck = false; @@ -137,18 +137,18 @@ final: prev: rec { }; }; - oapi-codegen = prev.oapi-codegen.override rec { + oapi-codegen = prev.oapi-codegen.override { buildGoModule = args: final.buildGoModule (args // rec { - version = "2.3.0"; + version = "2.4.0"; src = final.fetchFromGitHub { owner = "oapi-codegen"; repo = "oapi-codegen"; rev = "v${version}"; - sha256 = "sha256-Gcl0i3K2ncrxMSLHCPWBleRGdVIVkUo7vcp+tDNpkOw="; + sha256 = "sha256-Byb4bTtdn2Xi5hZXsAtcXA868VGQO6RORj1M2x8EAzg="; }; subPackages = [ "cmd/oapi-codegen" ]; - vendorHash = "sha256-urPMLEaisgndbHmS1sGQ07c+VRBdxIz0wseLoSLVWQo="; + vendorHash = "sha256-bp5sFZNJFQonwfF1RjCnOMKZQkofHuqG0bXdG5Hf3jU="; }); }; diff --git a/overlays/nhost-cli.nix b/overlays/nhost-cli.nix index cf1adea..6cf81a3 100644 --- a/overlays/nhost-cli.nix +++ b/overlays/nhost-cli.nix @@ -1,27 +1,27 @@ { final }: let - version = "v1.24.1"; + version = "v1.24.5"; dist = { - aarch64-darwin = rec { + aarch64-darwin = { url = "https://github.com/nhost/cli/releases/download/${version}/cli-${version}-darwin-arm64.tar.gz"; - sha256 = "0j3kjz4hhxihg3w99qay74k8aslxnlgwvzvj8p3dindrd98h7pvn"; + sha256 = "0yswxz8q15cbsrcxfhx8yx4p0igp5ym9d2gy682ighfgbbiny1j4"; }; - x86_64-darwin = rec { + x86_64-darwin = { url = "https://github.com/nhost/cli/releases/download/${version}/cli-${version}-darwin-amd64.tar.gz"; - sha256 = "118czg3pnj6j617dxvn5skl7012zadgq6ybkbhgcllwjk3glxavv"; + sha256 = "0w15zlas5975z1p4shs02ggz9f2smlnpmsajjbwb3bsanqgj13q5"; }; - aarch64-linux = rec { + aarch64-linux = { url = "https://github.com/nhost/cli/releases/download/${version}/cli-${version}-linux-arm64.tar.gz"; - sha256 = "1yj5zajaf2dfvflxkzfhnym2f2vpssmvd2d1kyb97ml8wqgw3mk9"; + sha256 = "1andq57s8l5ax1i04djb7ck5gd046ilcm00ysfxn0128fydv6ida"; }; - x86_64-linux = rec { + x86_64-linux = { url = "https://github.com/nhost/cli/releases/download/${version}/cli-${version}-linux-amd64.tar.gz"; - sha256 = "0m7h63clp0p4fycvyxad2mpwa6gfvr9s196j4lijbc1nfwqd4bp6"; + sha256 = "11n82j432ly8m8ap7bihy93dbc8jwq7lf1mb8hfzzprrzcsw1p96"; }; }; in -final.stdenvNoCC.mkDerivation rec { +final.stdenvNoCC.mkDerivation { pname = "nhost-cli"; inherit version; diff --git a/overlays/postgres.nix b/overlays/postgres.nix index b885fd0..4e53ce5 100644 --- a/overlays/postgres.nix +++ b/overlays/postgres.nix @@ -10,35 +10,22 @@ final: prev: rec { }; }); - postgresql_14_13-client = postgresql_14_13.overrideAttrs - (finalAttrs: previousAttrs: { - buildInputs = with final.pkgs; [ zlib openssl ]; - configureFlags = [ - "--with-openssl" - "--without-readline" - "--sysconfdir=/etc" - "--libdir=$(lib)/lib" - "--with-system-tzdata=${final.pkgs.tzdata}/share/zoneinfo" - ]; - - separateDebugInfo = false; - buildFlags = [ ]; - installTargets = [ "-C src/bin install" "-C ../interfaces install" ]; - - postInstall = - '' - cp src/bin/pg_dump/pg_dump $out/bin - cp src/bin/pg_dump/pg_restore $out/bin - cp src/bin/psql/psql $out/bin - moveToOutput "lib/pgxs" "$out" # looks strange, but not deleting it - moveToOutput "lib/libpgcommon*.a" "$out" - moveToOutput "lib/libpgport*.a" "$out" - moveToOutput "lib/libecpg*" "$out" - ''; - - postFixup = ""; - outputs = [ "out" "lib" ]; - }); + postgresql_14_13-client = final.stdenv.mkDerivation { + pname = "postgresql-client"; + version = postgresql_14_13.version; + + buildInputs = [ postgresql_14_13 ]; + + phases = [ "installPhase" ]; + + installPhase = '' + mkdir -p $out/bin + cp ${postgresql_14_13}/bin/psql $out/bin/ + cp ${postgresql_14_13}/bin/pg_dump $out/bin/ + cp ${postgresql_14_13}/bin/pg_dumpall $out/bin/ + cp ${postgresql_14_13}/bin/pg_restore $out/bin/ + ''; + }; postgresql_15_8 = prev.postgresql_15.overrideAttrs (finalAttrs: previousAttrs: rec { @@ -51,35 +38,22 @@ final: prev: rec { }; }); - postgresql_15_8-client = postgresql_15_8.overrideAttrs - (finalAttrs: previousAttrs: { - buildInputs = with final.pkgs; [ zlib openssl ]; - configureFlags = [ - "--with-openssl" - "--without-readline" - "--sysconfdir=/etc" - "--libdir=$(lib)/lib" - "--with-system-tzdata=${final.pkgs.tzdata}/share/zoneinfo" - ]; - - separateDebugInfo = false; - buildFlags = [ ]; - installTargets = [ "-C src/bin install" "-C ../interfaces install" ]; - - postInstall = - '' - cp src/bin/pg_dump/pg_dump $out/bin - cp src/bin/pg_dump/pg_restore $out/bin - cp src/bin/psql/psql $out/bin - moveToOutput "lib/pgxs" "$out" # looks strange, but not deleting it - moveToOutput "lib/libpgcommon*.a" "$out" - moveToOutput "lib/libpgport*.a" "$out" - moveToOutput "lib/libecpg*" "$out" - ''; - - postFixup = ""; - outputs = [ "out" "lib" ]; - }); + postgresql_15_8-client = final.stdenv.mkDerivation { + pname = "postgresql-client"; + version = postgresql_15_8.version; + + buildInputs = [ postgresql_15_8 ]; + + phases = [ "installPhase" ]; + + installPhase = '' + mkdir -p $out/bin + cp ${postgresql_15_8}/bin/psql $out/bin/ + cp ${postgresql_15_8}/bin/pg_dump $out/bin/ + cp ${postgresql_15_8}/bin/pg_dumpall $out/bin/ + cp ${postgresql_15_8}/bin/pg_restore $out/bin/ + ''; + }; postgresql_16_4 = prev.postgresql_16.overrideAttrs (finalAttrs: previousAttrs: rec { @@ -92,34 +66,20 @@ final: prev: rec { }; }); - postgresql_16_4-client = postgresql_16_4.overrideAttrs - (finalAttrs: previousAttrs: { - buildInputs = with final.pkgs; [ zlib openssl icu ]; - configureFlags = [ - "--with-openssl" - "--without-readline" - "--sysconfdir=/etc" - "--libdir=$(lib)/lib" - "--with-system-tzdata=${final.pkgs.tzdata}/share/zoneinfo" - ]; - - separateDebugInfo = false; - buildFlags = [ ]; - installTargets = [ "-C src/bin install" "-C ../interfaces install" ]; - - postInstall = - '' - cp src/bin/pg_dump/pg_dump $out/bin - cp src/bin/pg_dump/pg_dumpall $out/bin - cp src/bin/pg_dump/pg_restore $out/bin - cp src/bin/psql/psql $out/bin - moveToOutput "lib/pgxs" "$out" # looks strange, but not deleting it - moveToOutput "lib/libpgcommon*.a" "$out" - moveToOutput "lib/libpgport*.a" "$out" - moveToOutput "lib/libecpg*" "$out" - ''; - - postFixup = ""; - outputs = [ "out" "lib" ]; - }); + postgresql_16_4-client = final.stdenv.mkDerivation { + pname = "postgresql-client"; + version = postgresql_16_4.version; + + buildInputs = [ postgresql_16_4 ]; + + phases = [ "installPhase" ]; + + installPhase = '' + mkdir -p $out/bin + cp ${postgresql_16_4}/bin/psql $out/bin/ + cp ${postgresql_16_4}/bin/pg_dump $out/bin/ + cp ${postgresql_16_4}/bin/pg_dumpall $out/bin/ + cp ${postgresql_16_4}/bin/pg_restore $out/bin/ + ''; + }; }