about summary refs log tree commit diff
path: root/pkgs/by-name/fl
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/by-name/fl')
-rw-r--r--pkgs/by-name/fl/flac123/package.nix2
-rw-r--r--pkgs/by-name/fl/flake-checker/package.nix6
-rw-r--r--pkgs/by-name/fl/flarectl/package.nix6
-rw-r--r--pkgs/by-name/fl/flashmq/package.nix4
-rw-r--r--pkgs/by-name/fl/flatito/package.nix2
-rw-r--r--pkgs/by-name/fl/flatpak/binary-path.patch29
-rw-r--r--pkgs/by-name/fl/flatpak/fix-fonts-icons.patch87
-rw-r--r--pkgs/by-name/fl/flatpak/fix-icon-validation.patch31
-rw-r--r--pkgs/by-name/fl/flatpak/fix-paths.patch22
-rw-r--r--pkgs/by-name/fl/flatpak/fix-test-paths.patch212
-rw-r--r--pkgs/by-name/fl/flatpak/package.nix235
-rw-r--r--pkgs/by-name/fl/flatpak/respect-xml-catalog-files-var.patch15
-rw-r--r--pkgs/by-name/fl/flatpak/unset-env-vars.patch12
-rw-r--r--pkgs/by-name/fl/flawz/package.nix6
-rw-r--r--pkgs/by-name/fl/fleng/package.nix2
-rw-r--r--pkgs/by-name/fl/flet-client-flutter/package.nix6
-rw-r--r--pkgs/by-name/fl/flip/package.nix2
-rw-r--r--pkgs/by-name/fl/flottbot/package.nix2
-rw-r--r--pkgs/by-name/fl/fluent-gtk-theme/package.nix114
-rw-r--r--pkgs/by-name/fl/fluxcd/package.nix88
-rwxr-xr-xpkgs/by-name/fl/fluxcd/update.sh50
21 files changed, 914 insertions, 19 deletions
diff --git a/pkgs/by-name/fl/flac123/package.nix b/pkgs/by-name/fl/flac123/package.nix
index 2a042366cc250..9837a48c426e0 100644
--- a/pkgs/by-name/fl/flac123/package.nix
+++ b/pkgs/by-name/fl/flac123/package.nix
@@ -30,7 +30,7 @@ stdenv.mkDerivation (finalAttrs: {
 
   meta = {
     homepage = "https://github.com/flac123/flac123";
-    description = "A command-line program for playing FLAC audio files";
+    description = "Command-line program for playing FLAC audio files";
     license = lib.licenses.gpl2Plus;
     maintainers = with lib.maintainers; [ kiike ];
     mainProgram = "flac123";
diff --git a/pkgs/by-name/fl/flake-checker/package.nix b/pkgs/by-name/fl/flake-checker/package.nix
index 368770d057998..09c3215527f86 100644
--- a/pkgs/by-name/fl/flake-checker/package.nix
+++ b/pkgs/by-name/fl/flake-checker/package.nix
@@ -7,16 +7,16 @@
 
 rustPlatform.buildRustPackage rec {
   pname = "flake-checker";
-  version = "0.1.18";
+  version = "0.1.19";
 
   src = fetchFromGitHub {
     owner = "DeterminateSystems";
     repo = "flake-checker";
     rev = "v${version}";
-    hash = "sha256-XoYpiqatCQCYuKpVGlWcteVp71LXh+leFEtbL5lb0rs=";
+    hash = "sha256-KJTObuHJQjIgg/5A25Ee+7s2SrmtyYFnvcnklYhSCNE=";
   };
 
-  cargoHash = "sha256-LM0tYSRhM4GGb/Pa5l2xMAJ26ZyAuSEKlZansE/VNNw=";
+  cargoHash = "sha256-ADqc7H2MClXyYEw/lc9F4HAfpHrDc/lqL/BIL/PTZro=";
 
   buildInputs = lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
     Security
diff --git a/pkgs/by-name/fl/flarectl/package.nix b/pkgs/by-name/fl/flarectl/package.nix
index fb5786857ef40..be3cc19a1fdfe 100644
--- a/pkgs/by-name/fl/flarectl/package.nix
+++ b/pkgs/by-name/fl/flarectl/package.nix
@@ -5,16 +5,16 @@
 
 buildGoModule rec {
   pname = "flarectl";
-  version = "0.96.0";
+  version = "0.98.0";
 
   src = fetchFromGitHub {
     owner = "cloudflare";
     repo = "cloudflare-go";
     rev = "v${version}";
-    hash = "sha256-iqR+9qgHYCk7DGX64f50ANUYxTn0h4+AoBHE6yGAvtU=";
+    hash = "sha256-h6NLX++cf9pn8plZUKyiE3qcsiXGYHngRio34Mp341g=";
   };
 
-  vendorHash = "sha256-SkJTLOJ6518MQ0pAPM3TR8T5dOSwEbyQNZHr1jq936A=";
+  vendorHash = "sha256-k1JZGkJy5oGI3pEcrStNrsQTh8diNoe4DARqRX4PGS8=";
 
   subPackages = [ "cmd/flarectl" ];
 
diff --git a/pkgs/by-name/fl/flashmq/package.nix b/pkgs/by-name/fl/flashmq/package.nix
index 95e9d93a36c3f..cb39bc06b9ce8 100644
--- a/pkgs/by-name/fl/flashmq/package.nix
+++ b/pkgs/by-name/fl/flashmq/package.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "flashmq";
-  version = "1.13.1";
+  version = "1.15.2";
 
   src = fetchFromGitHub {
     owner = "halfgaar";
     repo = "FlashMQ";
     rev = "v${version}";
-    hash = "sha256-ZKDoh2eZDs7iQpfsvfsG7ic+A8NG+UUGgq9l2tmfhVI=";
+    hash = "sha256-4ZK8aHDhI0yslx1VoO+cgqj4YQ6AgE0Jy5C4WJ4k4OQ=";
   };
 
   nativeBuildInputs = [ cmake installShellFiles ];
diff --git a/pkgs/by-name/fl/flatito/package.nix b/pkgs/by-name/fl/flatito/package.nix
index 50fab5bdadbee..5b41e53478c28 100644
--- a/pkgs/by-name/fl/flatito/package.nix
+++ b/pkgs/by-name/fl/flatito/package.nix
@@ -26,7 +26,7 @@ buildRubyGem rec {
   propagatedBuildInputs = [ deps ];
 
   meta = with lib; {
-    description = "It allows you to search for a key and get the value and the line number where it is located in YAML and JSON files.";
+    description = "It allows you to search for a key and get the value and the line number where it is located in YAML and JSON files";
     homepage = "https://github.com/ceritium/flatito";
     license = licenses.mit;
     maintainers = with maintainers; [ rucadi ];
diff --git a/pkgs/by-name/fl/flatpak/binary-path.patch b/pkgs/by-name/fl/flatpak/binary-path.patch
new file mode 100644
index 0000000000000..9da437df91b71
--- /dev/null
+++ b/pkgs/by-name/fl/flatpak/binary-path.patch
@@ -0,0 +1,29 @@
+diff --git a/common/flatpak-dir.c b/common/flatpak-dir.c
+index eba81fef..134024e2 100644
+--- a/common/flatpak-dir.c
++++ b/common/flatpak-dir.c
+@@ -7532,8 +7532,13 @@ export_desktop_file (const char         *app,
+       g_key_file_remove_key (keyfile, groups[i], "X-GNOME-Bugzilla-ExtraInfoScript", NULL);
+ 
+       new_exec = g_string_new ("");
+-      if ((flatpak = g_getenv ("FLATPAK_BINARY")) == NULL)
+-        flatpak = FLATPAK_BINDIR "/flatpak";
++      if (g_str_has_suffix (name, ".service"))
++      {
++        flatpak = "/run/current-system/sw/bin/flatpak";
++      } else {
++        if ((flatpak = g_getenv ("FLATPAK_BINARY")) == NULL)
++          flatpak = "flatpak";
++      }
+ 
+       g_string_append_printf (new_exec,
+                               "%s run --branch=%s --arch=%s",
+@@ -8867,7 +8872,7 @@ flatpak_dir_deploy (FlatpakDir          *self,
+                                        error))
+         return FALSE;
+       if ((flatpak = g_getenv ("FLATPAK_BINARY")) == NULL)
+-        flatpak = FLATPAK_BINDIR "/flatpak";
++        flatpak = "flatpak";
+ 
+       bin_data = g_strdup_printf ("#!/bin/sh\nexec %s run --branch=%s --arch=%s %s \"$@\"\n",
+                                   flatpak, escaped_branch, escaped_arch, escaped_app);
diff --git a/pkgs/by-name/fl/flatpak/fix-fonts-icons.patch b/pkgs/by-name/fl/flatpak/fix-fonts-icons.patch
new file mode 100644
index 0000000000000..31a96d88b7dd5
--- /dev/null
+++ b/pkgs/by-name/fl/flatpak/fix-fonts-icons.patch
@@ -0,0 +1,87 @@
+diff --git a/common/flatpak-run.c b/common/flatpak-run.c
+index 94ad013..5c9f55e 100644
+--- a/common/flatpak-run.c
++++ b/common/flatpak-run.c
+@@ -871,6 +871,49 @@ out:
+   return res;
+ }
+ 
++static void
++get_nix_closure (GHashTable *closure, const gchar *source_path)
++{
++  if (g_file_test (source_path, G_FILE_TEST_IS_SYMLINK))
++    {
++      g_autofree gchar *path = g_malloc(PATH_MAX);
++      realpath(source_path, path);
++      if (g_str_has_prefix(path, "/nix/store/"))
++        {
++          *strchr(path + strlen("/nix/store/"), '/') = 0;
++          g_hash_table_add(closure, g_steal_pointer (&path));
++        }
++    }
++  else if (g_file_test (source_path, G_FILE_TEST_IS_DIR))
++    {
++      g_autoptr(GDir) dir = g_dir_open(source_path, 0, NULL);
++      const gchar *file_name;
++      while ((file_name = g_dir_read_name(dir)))
++        {
++          g_autofree gchar *path = g_build_filename (source_path, file_name, NULL);
++          get_nix_closure (closure, path);
++        }
++    }
++}
++
++static void
++add_nix_store_symlink_targets (FlatpakBwrap *bwrap, const gchar *source_path)
++{
++  GHashTable *closure = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
++
++  get_nix_closure(closure, source_path);
++
++  GHashTableIter iter;
++  gpointer path;
++  g_hash_table_iter_init(&iter, closure);
++  while (g_hash_table_iter_next(&iter, &path, NULL))
++    {
++      flatpak_bwrap_add_args (bwrap, "--ro-bind", path, path, NULL);
++    }
++
++  g_hash_table_destroy(closure);
++}
++
+ static void
+ add_font_path_args (FlatpakBwrap *bwrap)
+ {
+@@ -898,6 +946,18 @@ add_font_path_args (FlatpakBwrap *bwrap)
+                               "\t<remap-dir as-path=\"%s\">/run/host/fonts</remap-dir>\n",
+                               SYSTEM_FONTS_DIR);
+     }
++  else if (g_file_test ("/run/current-system/sw/share/X11/fonts", G_FILE_TEST_EXISTS))
++    {
++      add_nix_store_symlink_targets (bwrap, "/run/current-system/sw/share/X11/fonts");
++      flatpak_bwrap_add_args (bwrap,
++                              "--ro-bind",
++                              "/run/current-system/sw/share/X11/fonts",
++                              "/run/host/fonts",
++                              NULL);
++      g_string_append_printf (xml_snippet,
++                              "\t<remap-dir as-path=\"%s\">/run/host/fonts</remap-dir>\n",
++                              "/run/current-system/sw/share/X11/fonts");
++    }
+ 
+   if (g_file_test ("/usr/local/share/fonts", G_FILE_TEST_EXISTS))
+     {
+@@ -998,6 +1058,13 @@ add_icon_path_args (FlatpakBwrap *bwrap)
+                               "--ro-bind", "/usr/share/icons", "/run/host/share/icons",
+                               NULL);
+     }
++  else if (g_file_test ("/run/current-system/sw/share/icons", G_FILE_TEST_IS_DIR))
++    {
++      add_nix_store_symlink_targets (bwrap, "/run/current-system/sw/share/icons");
++      flatpak_bwrap_add_args (bwrap,
++                              "--ro-bind", "/run/current-system/sw/share/icons", "/run/host/share/icons",
++                              NULL);
++    }
+ 
+   user_icons_path = g_build_filename (g_get_user_data_dir (), "icons", NULL);
+   user_icons = g_file_new_for_path (user_icons_path);
diff --git a/pkgs/by-name/fl/flatpak/fix-icon-validation.patch b/pkgs/by-name/fl/flatpak/fix-icon-validation.patch
new file mode 100644
index 0000000000000..0e4db2b162f19
--- /dev/null
+++ b/pkgs/by-name/fl/flatpak/fix-icon-validation.patch
@@ -0,0 +1,31 @@
+--- a/icon-validator/validate-icon.c
++++ b/icon-validator/validate-icon.c
+@@ -163,7 +163,7 @@ rerun_in_sandbox (const char *arg_width,
+                   const char *arg_height,
+                   const char *filename)
+ {
+-  const char * const usrmerged_dirs[] = { "bin", "lib32", "lib64", "lib", "sbin" };
++  const char * const usrmerged_dirs[] = { };
+   int i;
+   g_autoptr(GPtrArray) args = g_ptr_array_new_with_free_func (g_free);
+   char validate_icon[PATH_MAX + 1];
+@@ -183,8 +183,7 @@ rerun_in_sandbox (const char *arg_width,
+             "--unshare-ipc",
+             "--unshare-net",
+             "--unshare-pid",
+-            "--ro-bind", "/usr", "/usr",
+-            "--ro-bind-try", "/etc/ld.so.cache", "/etc/ld.so.cache",
++            "--ro-bind", "@storeDir@", "@storeDir@",
+             "--ro-bind", validate_icon, validate_icon,
+             NULL);
+ 
+@@ -227,6 +226,9 @@ rerun_in_sandbox (const char *arg_width,
+     add_args (args, "--setenv", "G_MESSAGES_DEBUG", g_getenv ("G_MESSAGES_DEBUG"), NULL);
+   if (g_getenv ("G_MESSAGES_PREFIXED"))
+     add_args (args, "--setenv", "G_MESSAGES_PREFIXED", g_getenv ("G_MESSAGES_PREFIXED"), NULL);
++  if (g_getenv ("GDK_PIXBUF_MODULE_FILE"))
++    add_args (args, "--setenv", "GDK_PIXBUF_MODULE_FILE", g_getenv ("GDK_PIXBUF_MODULE_FILE"), NULL);
++
+ 
+   add_args (args, validate_icon, arg_width, arg_height, filename, NULL);
+   g_ptr_array_add (args, NULL);
diff --git a/pkgs/by-name/fl/flatpak/fix-paths.patch b/pkgs/by-name/fl/flatpak/fix-paths.patch
new file mode 100644
index 0000000000000..67f0d4eba71f5
--- /dev/null
+++ b/pkgs/by-name/fl/flatpak/fix-paths.patch
@@ -0,0 +1,22 @@
+diff --git a/session-helper/flatpak-session-helper.c b/session-helper/flatpak-session-helper.c
+index 5dd7629e..ddc71a4c 100644
+--- a/session-helper/flatpak-session-helper.c
++++ b/session-helper/flatpak-session-helper.c
+@@ -693,7 +693,7 @@ start_p11_kit_server (const char *flatpak_dir)
+   g_auto(GStrv) stdout_lines = NULL;
+   int i;
+   char *p11_argv[] = {
+-    "p11-kit", "server",
++    "@p11kit@", "server",
+     /* We explicitly request --sh here, because we then fail on earlier versions that doesn't support
+      * this flag. This is good, because those earlier versions did not properly daemonize and caused
+      * the spawn_sync to hang forever, waiting for the pipe to close.
+@@ -836,7 +836,7 @@ main (int    argc,
+       exit (1);
+     }
+ 
+-  if (g_find_program_in_path ("p11-kit"))
++  if (TRUE)
+     start_p11_kit_server (flatpak_dir);
+   else
+     g_debug ("p11-kit not found");
diff --git a/pkgs/by-name/fl/flatpak/fix-test-paths.patch b/pkgs/by-name/fl/flatpak/fix-test-paths.patch
new file mode 100644
index 0000000000000..ebbcbde5e951f
--- /dev/null
+++ b/pkgs/by-name/fl/flatpak/fix-test-paths.patch
@@ -0,0 +1,212 @@
+diff --git a/app/flatpak-builtins-build-export.c b/app/flatpak-builtins-build-export.c
+index 3f5d8a1f..79493e61 100644
+--- a/app/flatpak-builtins-build-export.c
++++ b/app/flatpak-builtins-build-export.c
+@@ -464,7 +464,7 @@ validate_desktop_file (GFile      *desktop_file,
+   subprocess = g_subprocess_new (G_SUBPROCESS_FLAGS_STDOUT_PIPE |
+                                  G_SUBPROCESS_FLAGS_STDERR_PIPE |
+                                  G_SUBPROCESS_FLAGS_STDERR_MERGE,
+-                                 &local_error, "desktop-file-validate", path, NULL);
++                                 &local_error, "@dfu@/bin/desktop-file-validate", path, NULL);
+   if (!subprocess)
+     {
+       if (!g_error_matches (local_error, G_SPAWN_ERROR, G_SPAWN_ERROR_NOENT))
+diff --git a/tests/libtest.sh b/tests/libtest.sh
+index 36d39ac4..3ad2c7a6 100644
+--- a/tests/libtest.sh
++++ b/tests/libtest.sh
+@@ -511,7 +511,7 @@ if [ -z "${FLATPAK_BWRAP:-}" ]; then
+     # running installed-tests: assume we know what we're doing
+     _flatpak_bwrap_works=true
+ elif ! "$FLATPAK_BWRAP" --unshare-ipc --unshare-net --unshare-pid \
+-        --ro-bind / / /bin/true > bwrap-result 2>&1; then
++        --ro-bind / / @coreutils@/bin/true > bwrap-result 2>&1; then
+     _flatpak_bwrap_works=false
+ else
+     _flatpak_bwrap_works=true
+@@ -591,7 +591,7 @@ dbus-daemon --fork --config-file=session.conf --print-address=3 --print-pid=4 \
+ export DBUS_SESSION_BUS_ADDRESS="$(cat dbus-session-bus-address)"
+ DBUS_SESSION_BUS_PID="$(cat dbus-session-bus-pid)"
+ 
+-if ! /bin/kill -0 "$DBUS_SESSION_BUS_PID"; then
++if ! @coreutils@/bin/kill -0 "$DBUS_SESSION_BUS_PID"; then
+     assert_not_reached "Failed to start dbus-daemon"
+ fi
+ 
+@@ -606,7 +606,7 @@ commit_to_path () {
+ }
+ 
+ cleanup () {
+-    /bin/kill -9 $DBUS_SESSION_BUS_PID
++    @coreutils@/bin/kill -9 $DBUS_SESSION_BUS_PID
+     gpg-connect-agent --homedir "${FL_GPG_HOMEDIR}" killagent /bye >&2 || true
+     fusermount -u $XDG_RUNTIME_DIR/doc >&2 || :
+     kill $(jobs -p) &> /dev/null || true
+diff --git a/tests/make-test-app.sh b/tests/make-test-app.sh
+index afa11a6b..5b12055f 100755
+--- a/tests/make-test-app.sh
++++ b/tests/make-test-app.sh
+@@ -190,13 +190,13 @@ msgid "Hello world"
+ msgstr "Hallo Welt"
+ EOF
+ mkdir -p ${DIR}/files/de/share/de/LC_MESSAGES
+-msgfmt --output-file ${DIR}/files/de/share/de/LC_MESSAGES/helloworld.mo de.po
++@gettext@/bin/msgfmt --output-file ${DIR}/files/de/share/de/LC_MESSAGES/helloworld.mo de.po
+ cat > fr.po <<EOF
+ msgid "Hello world"
+ msgstr "Bonjour le monde"
+ EOF
+ mkdir -p ${DIR}/files/fr/share/fr/LC_MESSAGES
+-msgfmt --output-file ${DIR}/files/fr/share/fr/LC_MESSAGES/helloworld.mo fr.po
++@gettext@/bin/msgfmt --output-file ${DIR}/files/fr/share/fr/LC_MESSAGES/helloworld.mo fr.po
+ 
+ flatpak build-finish ${DIR} >&2
+ mkdir -p repos
+diff --git a/tests/make-test-runtime.sh b/tests/make-test-runtime.sh
+index 6345ff58..fd50fab3 100755
+--- a/tests/make-test-runtime.sh
++++ b/tests/make-test-runtime.sh
+@@ -28,9 +28,10 @@ EOF
+ 
+ # On Debian derivatives, /usr/sbin and /sbin aren't in ordinary users'
+ # PATHs, but ldconfig is kept in /sbin
+-PATH="$PATH:/usr/sbin:/sbin"
++PATH="$PATH:@socat@/bin:/usr/sbin:/sbin"
+ 
+ # Add bash and dependencies
++mkdir -p ${DIR}/nix/store
+ mkdir -p ${DIR}/usr/bin
+ mkdir -p ${DIR}/usr/lib
+ ln -s ../lib ${DIR}/usr/lib64
+@@ -40,46 +41,17 @@ if test -f /sbin/ldconfig.real; then
+ else
+     cp "$(type -P ldconfig)" "${DIR}/usr/bin"
+ fi
+-LIBS=`mktemp`
+-BINS=`mktemp`
+-
+-add_bin() {
+-    local f=$1
+-    shift
+-
+-    # Check if the program is installed
+-    if ! command -v "${f}" &> /dev/null; then
+-        echo "${f} not found"
+-        exit 1
+-    fi
+-
+-    if grep -qFe "${f}" $BINS; then
+-        # Already handled
+-        return 0
+-    fi
+-
+-    echo $f >> $BINS
+-
+-    # Add library dependencies
+-    (ldd "${f}" | sed "s/.* => //"  | awk '{ print $1}' | grep ^/ | sort -u -o $LIBS $LIBS -)  || true
+-
+-    local shebang=$(sed -n '1s/^#!\([^ ]*\).*/\1/p' "${f}")
+-    if [ x$shebang != x ]; then
+-        add_bin "$shebang"
+-    fi
+-}
+-
+ for i in $@ bash ls cat echo readlink socat; do
+-    I=$(type -P "$i")
+-    add_bin "$I"
+-done
+-for i in `cat $BINS`; do
+-    #echo Adding binary $i 1>&2
+-    cp "$i" ${DIR}/usr/bin/
+-done
+-for i in `cat $LIBS`; do
+-    #echo Adding library $i 1>&2
+-    cp "$i" ${DIR}/usr/lib/
++    I=$(readlink -f "$(type -P "$i")")
++    [ -e "${DIR}/usr/bin/$i" ] && continue
++    requisites=$(nix-store --query --requisites "$I")
++    for r in $requisites; do
++        # a single store item can be needed by multiple paths, no need to copy it again
++        if [ ! -e "${DIR}/$r" ]; then
++            cp -r "$r" "${DIR}/$r"
++        fi
++    done
++    ln -s "$I" "${DIR}/usr/bin/$i"
+ done
+ ln -s bash ${DIR}/usr/bin/sh
+ 
+@@ -90,11 +62,13 @@ echo "Hello world, from a runtime$EXTRA"
+ EOF
+ chmod a+x ${DIR}/usr/bin/runtime_hello.sh
+ 
+-# We copy the C.UTF8 locale and call it en_US. Its a bit of a lie, but
+-# the real en_US locale is often not available, because its in the
+-# local archive.
+-mkdir -p ${DIR}/usr/lib/locale/
+-cp -r /usr/lib/locale/C.* ${DIR}/usr/lib/locale/en_US
++# We do not copy C.UTF8 locale because it is in locale archive and
++# that is already copied with glibc.
++
++mv "${DIR}/nix/store" "${DIR}/usr/store" # files outside /usr are not permitted, we will have to replace /nix/store with /usr/store
++chmod -R u+w "${DIR}" # nix store has read-only directories which would cause problems during clean-up, files need to be writable for sed
++find "${DIR}" -type f -print0 | xargs -0 sed -i 's~/nix/store/~/usr/store/~g' # replace hardcoded paths
++find "${DIR}" -type l | xargs -I '{}' sh -c 'tg="$(readlink "$1")"; newtg="${tg#/nix/store/}"; if [ "$tg" != "$newtg" ]; then ln -fs "/usr/store/$newtg" "$1"; fi' -- '{}' # replace symlink targets
+ 
+ if [ x$COLLECTION_ID != x ]; then
+     collection_args=--collection-id=${COLLECTION_ID}
+diff --git a/tests/testlibrary.c b/tests/testlibrary.c
+index 831d85c1..ae4f03d0 100644
+--- a/tests/testlibrary.c
++++ b/tests/testlibrary.c
+@@ -1601,7 +1601,7 @@ check_bwrap_support (void)
+     {
+       gint exit_code = 0;
+       char *argv[] = { (char *) bwrap, "--unshare-ipc", "--unshare-net",
+-                       "--unshare-pid", "--ro-bind", "/", "/", "/bin/true", NULL };
++                       "--unshare-pid", "--ro-bind", "/", "/", "@coreutils@/bin/true", NULL };
+       g_autofree char *argv_str = g_strjoinv (" ", argv);
+       g_test_message ("Spawning %s", argv_str);
+       g_spawn_sync (NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL, &exit_code, &error);
+diff --git a/triggers/desktop-database.trigger b/triggers/desktop-database.trigger
+index 1037466d..c4c7ed6d 100755
+--- a/triggers/desktop-database.trigger
++++ b/triggers/desktop-database.trigger
+@@ -1,5 +1,5 @@
+ #!/bin/sh
+ 
+-if command -v update-desktop-database >/dev/null && test -d "$1/exports/share/applications"; then
+-    exec update-desktop-database -q "$1/exports/share/applications"
++if test -d "$1/exports/share/applications"; then
++    exec @dfu@/bin/update-desktop-database -q "$1/exports/share/applications"
+ fi
+diff --git a/triggers/gtk-icon-cache.trigger b/triggers/gtk-icon-cache.trigger
+index d9fc8251..d8ddb96e 100755
+--- a/triggers/gtk-icon-cache.trigger
++++ b/triggers/gtk-icon-cache.trigger
+@@ -1,10 +1,10 @@
+ #!/bin/sh
+ 
+-if command -v gtk-update-icon-cache >/dev/null && test -d "$1/exports/share/icons/hicolor"; then
+-    cp /usr/share/icons/hicolor/index.theme "$1/exports/share/icons/hicolor/"
++if test -d "$1/exports/share/icons/hicolor"; then
++    @coreutils@/bin/cp -f @hicolorIconTheme@/share/icons/hicolor/index.theme "$1/exports/share/icons/hicolor/"
+     for dir in "$1"/exports/share/icons/*; do
+         if test -f "$dir/index.theme"; then
+-            if ! gtk-update-icon-cache --quiet "$dir"; then
+-                echo "Failed to run gtk-update-icon-cache for $dir"
++            if ! @gtk3@/bin/gtk-update-icon-cache --quiet "$dir"; then
++                @coreutils@/bin/echo "Failed to run gtk-update-icon-cache for $dir"
+                 exit 1
+             fi
+diff --git a/triggers/mime-database.trigger b/triggers/mime-database.trigger
+index 10ddbbb3..c270998a 100755
+--- a/triggers/mime-database.trigger
++++ b/triggers/mime-database.trigger
+@@ -1,5 +1,5 @@
+ #!/bin/sh
+ 
+-if command -v update-mime-database >/dev/null && test -d "$1/exports/share/mime/packages"; then
+-    exec update-mime-database "$1/exports/share/mime"
++if test -d "$1/exports/share/mime/packages"; then
++    exec @smi@/bin/update-mime-database "$1/exports/share/mime"
+ fi
diff --git a/pkgs/by-name/fl/flatpak/package.nix b/pkgs/by-name/fl/flatpak/package.nix
new file mode 100644
index 0000000000000..fc109bf508345
--- /dev/null
+++ b/pkgs/by-name/fl/flatpak/package.nix
@@ -0,0 +1,235 @@
+{
+  lib,
+  stdenv,
+  fetchurl,
+  runCommand,
+  appstream,
+  autoreconfHook,
+  bison,
+  bubblewrap,
+  bzip2,
+  coreutils,
+  curl,
+  dbus,
+  dconf,
+  desktop-file-utils,
+  docbook_xml_dtd_45,
+  docbook-xsl-nons,
+  fuse3,
+  gettext,
+  glib,
+  glib-networking,
+  gobject-introspection,
+  gpgme,
+  gsettings-desktop-schemas,
+  gtk3,
+  gtk-doc,
+  hicolor-icon-theme,
+  intltool,
+  json-glib,
+  libarchive,
+  libcap,
+  librsvg,
+  libseccomp,
+  libxml2,
+  libxslt,
+  nix-update-script,
+  nixosTests,
+  nixos-icons,
+  ostree,
+  p11-kit,
+  pkg-config,
+  polkit,
+  python3,
+  shared-mime-info,
+  socat,
+  substituteAll,
+  systemd,
+  testers,
+  valgrind,
+  which,
+  wrapGAppsNoGuiHook,
+  xdg-dbus-proxy,
+  xmlto,
+  xorg,
+  xz,
+  zstd,
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "flatpak";
+  version = "1.14.6";
+
+  # TODO: split out lib once we figure out what to do with triggerdir
+  outputs = [
+    "out"
+    "dev"
+    "man"
+    "doc"
+    "devdoc"
+    "installedTests"
+  ];
+
+  src = fetchurl {
+    url = "https://github.com/flatpak/flatpak/releases/download/${finalAttrs.version}/flatpak-${finalAttrs.version}.tar.xz";
+    hash = "sha256-U482ssb4xw7v0S0TrVsa2DCCAQaovTqfa45NnegeSUY=";
+  };
+
+  patches = [
+    # Hardcode paths used by tests and change test runtime generation to use files from Nix store.
+    # https://github.com/flatpak/flatpak/issues/1460
+    (substituteAll {
+      src = ./fix-test-paths.patch;
+      inherit
+        coreutils
+        gettext
+        socat
+        gtk3
+        ;
+      smi = shared-mime-info;
+      dfu = desktop-file-utils;
+      hicolorIconTheme = hicolor-icon-theme;
+    })
+
+    # Hardcode paths used by Flatpak itself.
+    (substituteAll {
+      src = ./fix-paths.patch;
+      p11kit = "${p11-kit.bin}/bin/p11-kit";
+    })
+
+    # Allow gtk-doc to find schemas using XML_CATALOG_FILES environment variable.
+    # Patch taken from gtk-doc expression.
+    ./respect-xml-catalog-files-var.patch
+
+    # Nix environment hacks should not leak into the apps.
+    # https://github.com/NixOS/nixpkgs/issues/53441
+    ./unset-env-vars.patch
+
+    # Use flatpak from PATH to avoid references to `/nix/store` in `/desktop` files.
+    # Applications containing `DBusActivatable` entries should be able to find the flatpak binary.
+    # https://github.com/NixOS/nixpkgs/issues/138956
+    ./binary-path.patch
+
+    # The icon validator needs to access the gdk-pixbuf loaders in the Nix store
+    # and cannot bind FHS paths since those are not available on NixOS.
+    finalAttrs.passthru.icon-validator-patch
+
+    # Try mounting fonts and icons from NixOS locations if FHS locations don't exist.
+    # https://github.com/NixOS/nixpkgs/issues/119433
+    ./fix-fonts-icons.patch
+  ];
+
+  nativeBuildInputs = [
+    autoreconfHook
+    libxml2
+    docbook_xml_dtd_45
+    docbook-xsl-nons
+    which
+    gobject-introspection
+    gtk-doc
+    intltool
+    libxslt
+    pkg-config
+    xmlto
+    bison
+    wrapGAppsNoGuiHook
+  ];
+
+  buildInputs = [
+    appstream
+    bubblewrap
+    bzip2
+    curl
+    dbus
+    dconf
+    gpgme
+    json-glib
+    libarchive
+    libcap
+    libseccomp
+    xz
+    zstd
+    polkit
+    python3
+    systemd
+    xorg.libXau
+    fuse3
+    gsettings-desktop-schemas
+    glib-networking
+    librsvg # for flatpak-validate-icon
+  ];
+
+  # Required by flatpak.pc
+  propagatedBuildInputs = [
+    glib
+    ostree
+  ];
+
+  nativeCheckInputs = [ valgrind ];
+
+  # TODO: some issues with temporary files
+  doCheck = false;
+
+  NIX_LDFLAGS = "-lpthread";
+
+  enableParallelBuilding = true;
+
+  configureFlags = [
+    "--with-curl"
+    "--with-system-bubblewrap=${lib.getExe bubblewrap}"
+    "--with-system-dbus-proxy=${lib.getExe xdg-dbus-proxy}"
+    "--with-dbus-config-dir=${placeholder "out"}/share/dbus-1/system.d"
+    "--with-profile-dir=${placeholder "out"}/etc/profile.d"
+    "--localstatedir=/var"
+    "--sysconfdir=/etc"
+    "--enable-gtk-doc"
+    "--enable-installed-tests"
+  ];
+
+  makeFlags = [
+    "installed_testdir=${placeholder "installedTests"}/libexec/installed-tests/flatpak"
+    "installed_test_metadir=${placeholder "installedTests"}/share/installed-tests/flatpak"
+  ];
+
+  postPatch =
+    let
+      vsc-py = python3.withPackages (pp: [ pp.pyparsing ]);
+    in
+    ''
+      patchShebangs buildutil
+      patchShebangs tests
+      PATH=${lib.makeBinPath [ vsc-py ]}:$PATH patchShebangs --build subprojects/variant-schema-compiler/variant-schema-compiler
+    '';
+
+  passthru = {
+    icon-validator-patch = substituteAll {
+      src = ./fix-icon-validation.patch;
+      inherit (builtins) storeDir;
+    };
+
+    updateScript = nix-update-script { };
+
+    tests = {
+      installedTests = nixosTests.installed-tests.flatpak;
+
+      validate-icon = runCommand "test-icon-validation" { } ''
+        ${finalAttrs.finalPackage}/libexec/flatpak-validate-icon \
+          --sandbox 512 512 \
+          "${nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake-white.svg" > "$out"
+
+        grep format=svg "$out"
+      '';
+
+      version = testers.testVersion { package = finalAttrs.finalPackage; };
+    };
+  };
+
+  meta = {
+    description = "Linux application sandboxing and distribution framework";
+    homepage = "https://flatpak.org/";
+    changelog = "https://github.com/flatpak/flatpak/releases/tag/${finalAttrs.version}";
+    license = lib.licenses.lgpl21Plus;
+    maintainers = with lib.maintainers; [ getchoo ];
+    platforms = lib.platforms.linux;
+  };
+})
diff --git a/pkgs/by-name/fl/flatpak/respect-xml-catalog-files-var.patch b/pkgs/by-name/fl/flatpak/respect-xml-catalog-files-var.patch
new file mode 100644
index 0000000000000..4cee60be2d07d
--- /dev/null
+++ b/pkgs/by-name/fl/flatpak/respect-xml-catalog-files-var.patch
@@ -0,0 +1,15 @@
+diff --git a/acinclude.m4 b/acinclude.m4
+index 92ec3985..b3fccf1d 100644
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -40,8 +40,8 @@ AC_DEFUN([JH_CHECK_XML_CATALOG],
+ [
+   AC_REQUIRE([JH_PATH_XML_CATALOG],[JH_PATH_XML_CATALOG(,[:])])dnl
+   AC_MSG_CHECKING([for ifelse([$2],,[$1],[$2]) in XML catalog])
+-  if $jh_found_xmlcatalog && \
+-     AC_RUN_LOG([$XMLCATALOG --noout "$XML_CATALOG_FILE" "$1" >&2]); then
++  # empty argument forces libxml to use XML_CATALOG_FILES variable
++  if AC_RUN_LOG([$XMLCATALOG --noout "" "$1" >&2]); then
+     AC_MSG_RESULT([found])
+     ifelse([$3],,,[$3
+ ])dnl
diff --git a/pkgs/by-name/fl/flatpak/unset-env-vars.patch b/pkgs/by-name/fl/flatpak/unset-env-vars.patch
new file mode 100644
index 0000000000000..2a88d24f49166
--- /dev/null
+++ b/pkgs/by-name/fl/flatpak/unset-env-vars.patch
@@ -0,0 +1,12 @@
+diff --git a/common/flatpak-run.c b/common/flatpak-run.c
+index 6f54a9d0..102d9b90 100644
+--- a/common/flatpak-run.c
++++ b/common/flatpak-run.c
+@@ -1902,6 +1902,7 @@ static const ExportData default_exports[] = {
+   {"GDK_BACKEND", NULL},
+   {"VK_DRIVER_FILES", NULL},
+   {"VK_ICD_FILENAMES", NULL},
++  {"GDK_PIXBUF_MODULE_FILE", NULL},
+ };
+ 
+ static const ExportData no_ld_so_cache_exports[] = {
diff --git a/pkgs/by-name/fl/flawz/package.nix b/pkgs/by-name/fl/flawz/package.nix
index 504dd849b5d90..d149b41086241 100644
--- a/pkgs/by-name/fl/flawz/package.nix
+++ b/pkgs/by-name/fl/flawz/package.nix
@@ -10,16 +10,16 @@
 
 rustPlatform.buildRustPackage rec {
   pname = "flawz";
-  version = "0.2.0";
+  version = "0.2.2";
 
   src = fetchFromGitHub {
     owner = "orhun";
     repo = "flawz";
     rev = "v${version}";
-    hash = "sha256-eIZUKI/fdaSPHHEEaN/5s4I2LRX44FijUlKzzvuD42E=";
+    hash = "sha256-/gNHi7ZENy0cgnEgDBW82ACUUsuMLYD9eUrSxwO9k1U=";
   };
 
-  cargoHash = "sha256-UWjrVA5T78QLJtMug38y+egLnM+G7zmAIsNmqn2ZE5I=";
+  cargoHash = "sha256-kMiKlZj+G1vfjaEiB3rtPoJl0K3W9xRVwgVz8q2pn1s=";
 
   nativeBuildInputs = [ pkg-config installShellFiles ];
 
diff --git a/pkgs/by-name/fl/fleng/package.nix b/pkgs/by-name/fl/fleng/package.nix
index e7010f3882bdd..0c2c8359f65a5 100644
--- a/pkgs/by-name/fl/fleng/package.nix
+++ b/pkgs/by-name/fl/fleng/package.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation (finalAttrs: {
 
   meta = {
     homepage = "http://www.call-with-current-continuation.org/fleng/fleng.html";
-    description = "A low level concurrent logic programming language descended from Prolog";
+    description = "Low level concurrent logic programming language descended from Prolog";
     license = lib.licenses.publicDomain;
     maintainers = with lib.maintainers; [ AndersonTorres ];
     platforms = lib.platforms.unix;
diff --git a/pkgs/by-name/fl/flet-client-flutter/package.nix b/pkgs/by-name/fl/flet-client-flutter/package.nix
index 949e6f9295756..15b3c083fb334 100644
--- a/pkgs/by-name/fl/flet-client-flutter/package.nix
+++ b/pkgs/by-name/fl/flet-client-flutter/package.nix
@@ -1,7 +1,7 @@
 { lib
 , fetchFromGitHub
 , pkg-config
-, flutter
+, flutter319
 , gst_all_1
 , libunwind
 , makeWrapper
@@ -16,7 +16,7 @@
 , flet-client-flutter
 }:
 
-flutter.buildFlutterApplication rec {
+flutter319.buildFlutterApplication rec {
   pname = "flet-client-flutter";
   version = "0.22.1";
 
@@ -70,7 +70,7 @@ flutter.buildFlutterApplication rec {
   };
 
   meta = {
-    description = "A framework that enables you to easily build realtime web, mobile, and desktop apps in Python. The frontend part";
+    description = "Framework that enables you to easily build realtime web, mobile, and desktop apps in Python. The frontend part";
     homepage = "https://flet.dev/";
     changelog = "https://github.com/flet-dev/flet/releases/tag/v${version}";
     license = lib.licenses.asl20;
diff --git a/pkgs/by-name/fl/flip/package.nix b/pkgs/by-name/fl/flip/package.nix
index f7957c0990b00..23e352a090319 100644
--- a/pkgs/by-name/fl/flip/package.nix
+++ b/pkgs/by-name/fl/flip/package.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation {
   enableParallelBuilding = true;
 
   meta = with lib; {
-    description = "A tool for visualizing and communicating the errors in rendered images.";
+    description = "Tool for visualizing and communicating the errors in rendered images";
     license = licenses.bsd3;
     platforms = platforms.unix;
     maintainers = with maintainers; [ zmitchell ];
diff --git a/pkgs/by-name/fl/flottbot/package.nix b/pkgs/by-name/fl/flottbot/package.nix
index ba0321fbdd5b1..ab6273a155cdb 100644
--- a/pkgs/by-name/fl/flottbot/package.nix
+++ b/pkgs/by-name/fl/flottbot/package.nix
@@ -33,7 +33,7 @@ buildGoModule rec {
   };
 
   meta = with lib; {
-    description = "A chatbot framework written in Go";
+    description = "Chatbot framework written in Go";
     homepage = "https://github.com/target/flottbot";
     license = licenses.asl20;
     maintainers = with maintainers; [ bryanhonof ];
diff --git a/pkgs/by-name/fl/fluent-gtk-theme/package.nix b/pkgs/by-name/fl/fluent-gtk-theme/package.nix
new file mode 100644
index 0000000000000..137f8a92dd1bc
--- /dev/null
+++ b/pkgs/by-name/fl/fluent-gtk-theme/package.nix
@@ -0,0 +1,114 @@
+{
+  lib,
+  stdenvNoCC,
+  fetchFromGitHub,
+  gitUpdater,
+  gnome-themes-extra,
+  gtk-engine-murrine,
+  jdupes,
+  sassc,
+  themeVariants ? [ ], # default: blue
+  colorVariants ? [ ], # default: all
+  sizeVariants ? [ ], # default: standard
+  tweaks ? [ ],
+}:
+
+let
+  pname = "fluent-gtk-theme";
+in
+lib.checkListOfEnum "${pname}: theme variants"
+  [
+    "default"
+    "purple"
+    "pink"
+    "red"
+    "orange"
+    "yellow"
+    "green"
+    "teal"
+    "grey"
+    "all"
+  ]
+  themeVariants
+  lib.checkListOfEnum
+  "${pname}: color variants"
+  [
+    "standard"
+    "light"
+    "dark"
+  ]
+  colorVariants
+  lib.checkListOfEnum
+  "${pname}: size variants"
+  [
+    "standard"
+    "compact"
+  ]
+  sizeVariants
+  lib.checkListOfEnum
+  "${pname}: tweaks"
+  [
+    "solid"
+    "float"
+    "round"
+    "blur"
+    "noborder"
+    "square"
+  ]
+  tweaks
+
+  stdenvNoCC.mkDerivation
+  (finalAttrs: {
+    inherit pname;
+    version = "2024-06-12";
+
+    src = fetchFromGitHub {
+      owner = "vinceliuice";
+      repo = "fluent-gtk-theme";
+      rev = finalAttrs.version;
+      hash = "sha256-ONhW68UUrFiv5hxkR7XI8U/5+qM+tYLIS2OM05pqJi0=";
+    };
+
+    nativeBuildInputs = [
+      jdupes
+      sassc
+    ];
+
+    buildInputs = [ gnome-themes-extra ];
+
+    propagatedUserEnvPkgs = [ gtk-engine-murrine ];
+
+    postPatch = ''
+      patchShebangs install.sh
+    '';
+
+    installPhase = ''
+      runHook preInstall
+
+      name= HOME="$TMPDIR" ./install.sh \
+        ${lib.optionalString (themeVariants != [ ]) "--theme " + builtins.toString themeVariants} \
+        ${lib.optionalString (colorVariants != [ ]) "--color " + builtins.toString colorVariants} \
+        ${lib.optionalString (sizeVariants != [ ]) "--size " + builtins.toString sizeVariants} \
+        ${lib.optionalString (tweaks != [ ]) "--tweaks " + builtins.toString tweaks} \
+        --icon nixos \
+        --dest $out/share/themes
+
+      jdupes --quiet --link-soft --recurse $out/share
+
+      runHook postInstall
+    '';
+
+    passthru.updateScript = gitUpdater { };
+
+    meta = {
+      description = "Fluent design gtk theme";
+      changelog = "https://github.com/vinceliuice/Fluent-gtk-theme/releases/tag/${finalAttrs.version}";
+      homepage = "https://github.com/vinceliuice/Fluent-gtk-theme";
+      license = lib.licenses.gpl3Only;
+      platforms = lib.platforms.unix;
+      maintainers = with lib.maintainers; [
+        luftmensch-luftmensch
+        romildo
+      ];
+    };
+  })
diff --git a/pkgs/by-name/fl/fluxcd/package.nix b/pkgs/by-name/fl/fluxcd/package.nix
new file mode 100644
index 0000000000000..712f075459b60
--- /dev/null
+++ b/pkgs/by-name/fl/fluxcd/package.nix
@@ -0,0 +1,88 @@
+{
+  buildGoModule,
+  fetchFromGitHub,
+  fetchzip,
+  installShellFiles,
+  lib,
+  stdenv,
+}:
+
+let
+  version = "2.3.0";
+  sha256 = "sha256-ZQs1rWI31qDo/BgjrmiNnEdR2OL8bUHVz+j5VceEp2k=";
+  manifestsSha256 = "sha256-PdhR+UDquIJWtpSymtT6V7qO5fVJOkFz6RGzAx7xeb4=";
+
+  manifests = fetchzip {
+    url = "https://github.com/fluxcd/flux2/releases/download/v${version}/manifests.tar.gz";
+    hash = manifestsSha256;
+    stripRoot = false;
+  };
+in
+
+buildGoModule rec {
+  pname = "fluxcd";
+  inherit version;
+
+  src = fetchFromGitHub {
+    owner = "fluxcd";
+    repo = "flux2";
+    rev = "v${version}";
+    hash = sha256;
+  };
+
+  vendorHash = "sha256-0YH3pgFrsnh5jIsZpj/sIgfiOCTtIlPltMS5mdGz1eM=";
+
+  postUnpack = ''
+    cp -r ${manifests} source/cmd/flux/manifests
+
+    # disable tests that require network access
+    rm source/cmd/flux/create_secret_git_test.go
+  '';
+
+  ldflags = [
+    "-s"
+    "-w"
+    "-X main.VERSION=${version}"
+  ];
+
+  subPackages = [ "cmd/flux" ];
+
+  # Required to workaround test error:
+  #   panic: mkdir /homeless-shelter: permission denied
+  HOME = "$TMPDIR";
+
+  nativeBuildInputs = [ installShellFiles ];
+
+  doInstallCheck = true;
+  installCheckPhase = ''
+    $out/bin/flux --version | grep ${version} > /dev/null
+  '';
+
+  postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
+    for shell in bash fish zsh; do
+      $out/bin/flux completion $shell > flux.$shell
+      installShellCompletion flux.$shell
+    done
+  '';
+
+  passthru.updateScript = ./update.sh;
+
+  meta = {
+    changelog = "https://github.com/fluxcd/flux2/releases/tag/v${version}";
+    description = "Open and extensible continuous delivery solution for Kubernetes";
+    downloadPage = "https://github.com/fluxcd/flux2/";
+    longDescription = ''
+      Flux is a tool for keeping Kubernetes clusters in sync
+      with sources of configuration (like Git repositories), and automating
+      updates to configuration when there is new code to deploy.
+    '';
+    homepage = "https://fluxcd.io";
+    license = lib.licenses.asl20;
+    maintainers = with lib.maintainers; [
+      bryanasdev000
+      jlesquembre
+      superherointj
+    ];
+    mainProgram = "flux";
+  };
+}
diff --git a/pkgs/by-name/fl/fluxcd/update.sh b/pkgs/by-name/fl/fluxcd/update.sh
new file mode 100755
index 0000000000000..1763b37d33285
--- /dev/null
+++ b/pkgs/by-name/fl/fluxcd/update.sh
@@ -0,0 +1,50 @@
+#!/usr/bin/env nix-shell
+#!nix-shell -i bash -p curl gnugrep gnused jq
+
+set -x -eu -o pipefail
+
+NIXPKGS_PATH="$(git rev-parse --show-toplevel)"
+FLUXCD_PATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
+
+OLD_VERSION="$(nix-instantiate --eval -E "with import $NIXPKGS_PATH {}; fluxcd.version or (builtins.parseDrvName fluxcd.name).version" | tr -d '"')"
+LATEST_TAG=$(curl ${GITHUB_TOKEN:+" -u \":$GITHUB_TOKEN\""} --silent https://api.github.com/repos/fluxcd/flux2/releases/latest | jq -r '.tag_name')
+LATEST_VERSION=$(echo ${LATEST_TAG} | sed 's/^v//')
+
+if [ ! "$OLD_VERSION" = "$LATEST_VERSION" ]; then
+    SHA256=$(nix-prefetch-url --quiet --unpack https://github.com/fluxcd/flux2/archive/refs/tags/${LATEST_TAG}.tar.gz)
+    SHA256=$(nix hash to-sri --type sha256 $SHA256)
+    SPEC_SHA256=$(nix-prefetch-url --quiet --unpack https://github.com/fluxcd/flux2/releases/download/${LATEST_TAG}/manifests.tar.gz)
+    SPEC_SHA256=$(nix hash to-sri --type sha256 $SPEC_SHA256)
+
+    setKV () {
+        sed -i "s|$1 = \".*\"|$1 = \"${2:-}\"|" "${FLUXCD_PATH}/default.nix"
+    }
+
+    setKV version ${LATEST_VERSION}
+    setKV sha256 ${SHA256}
+    setKV manifestsSha256 ${SPEC_SHA256}
+    setKV vendorHash "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" # The same as lib.fakeHash
+
+    set +e
+    VENDOR_HASH=$(nix-build --no-out-link -A fluxcd $NIXPKGS_PATH 2>&1 >/dev/null | grep "got:" | cut -d':' -f2 | sed 's| ||g')
+    VENDOR_HASH=$(nix hash to-sri --type sha256 $VENDOR_HASH)
+    set -e
+
+    if [ -n "${VENDOR_HASH:-}" ]; then
+        setKV vendorHash ${VENDOR_HASH}
+    else
+        echo "Update failed. VENDOR_HASH is empty."
+        exit 1
+    fi
+
+    # `git` flag here is to be used by local maintainers to speed up the bump process
+    if [ $# -eq 1 ] && [ "$1" = "git" ]; then
+        git switch -c "package-fluxcd-${LATEST_VERSION}"
+        git add "$FLUXCD_PATH"/default.nix
+        git commit -m "fluxcd: ${OLD_VERSION} -> ${LATEST_VERSION}
+
+Release: https://github.com/fluxcd/flux2/releases/tag/v${LATEST_VERSION}"
+    fi
+else
+    echo "fluxcd is already up-to-date at $OLD_VERSION"
+fi