From 255df8841580bf1da81716192316130fa98dfe73 Mon Sep 17 00:00:00 2001 From: Paul Cioanca Date: Sun, 11 Aug 2024 14:09:44 +0300 Subject: [PATCH 1/2] fix: remove darwin support for nix --- common-nix.vars.pkr.hcl | 2 +- flake.nix | 1 - nix/ext/plv8.nix | 12 +----------- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/common-nix.vars.pkr.hcl b/common-nix.vars.pkr.hcl index 9b378b4b7..d3ede70c5 100644 --- a/common-nix.vars.pkr.hcl +++ b/common-nix.vars.pkr.hcl @@ -1 +1 @@ -postgres-version = "15.6.1.108" +postgres-version = "15.6.1.109-rc1" diff --git a/flake.nix b/flake.nix index 4cd1992f2..fcab1b9d6 100644 --- a/flake.nix +++ b/flake.nix @@ -15,7 +15,6 @@ ourSystems = with flake-utils.lib; [ system.x86_64-linux system.aarch64-linux - system.aarch64-darwin ]; in flake-utils.lib.eachSystem ourSystems (system: diff --git a/nix/ext/plv8.nix b/nix/ext/plv8.nix index 29b611b08..112d587e7 100644 --- a/nix/ext/plv8.nix +++ b/nix/ext/plv8.nix @@ -8,7 +8,6 @@ , runCommand , coreutils , gnugrep -, gcc }: stdenv.mkDerivation (finalAttrs: { @@ -33,8 +32,6 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ perl - ] ++ lib.optionals stdenv.isDarwin [ - gcc ]; buildInputs = [ @@ -50,13 +47,6 @@ stdenv.mkDerivation (finalAttrs: { "SHLIB_LINK=-lv8" "V8_OUTDIR=${v8}/lib" ]; - NIX_LDFLAGS = lib.optionalString (stdenv.isDarwin && stdenv.isAarch64) - "-undefined dynamic_lookup"; - - NIX_CFLAGS_COMPILE = lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [ - "-I${v8}/include" - "-I${postgresql}/include" - ]; installFlags = [ # PGXS only supports installing to postgresql prefix so we need to redirect this "DESTDIR=${placeholder "out"}" @@ -149,7 +139,7 @@ stdenv.mkDerivation (finalAttrs: { description = "V8 Engine Javascript Procedural Language add-on for PostgreSQL"; homepage = "https://plv8.github.io/"; maintainers = with maintainers; [ samrose ]; - platforms = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" ]; + platforms = [ "x86_64-linux" "aarch64-linux" ]; license = licenses.postgresql; #broken = postgresql.jitSupport; }; From 02e4ff420753deeda55354ad9c38e897ac8e4bc1 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Sun, 11 Aug 2024 13:33:16 +0000 Subject: [PATCH 2/2] fix: cut down the size of nix store prior to release of AMI by running nix-collect-garbage -d which should remove items not in use by installed packages --- ansible/playbook.yml | 6 ++++++ common-nix.vars.pkr.hcl | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ansible/playbook.yml b/ansible/playbook.yml index 7938aa7b4..af2471257 100644 --- a/ansible/playbook.yml +++ b/ansible/playbook.yml @@ -206,3 +206,9 @@ shell: | sudo -u ubuntu bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix profile remove osquery" when: stage2_nix + + - name: nix collect garbage + become: yes + shell: | + sudo -u ubuntu bash -c ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix-collect-garbage -d" + when: stage2_nix \ No newline at end of file diff --git a/common-nix.vars.pkr.hcl b/common-nix.vars.pkr.hcl index d3ede70c5..7b7c1cf6f 100644 --- a/common-nix.vars.pkr.hcl +++ b/common-nix.vars.pkr.hcl @@ -1 +1 @@ -postgres-version = "15.6.1.109-rc1" +postgres-version = "15.6.1.109-rc2"