From a30d1a93dd012f2ced923bc7c4a0df5e8def8730 Mon Sep 17 00:00:00 2001 From: yukkop Date: Fri, 5 Jun 2026 10:55:51 +0000 Subject: [PATCH] fix: element things --- .../bfs.poland.xray/bfs.poland.xray.nix | 12 ++++ nixos/system/neuro/neuro.nix | 1 + package/default.nix | 1 + package/hiddify-core/default.nix | 59 +++++++++++++++++++ 4 files changed, 73 insertions(+) create mode 100644 package/hiddify-core/default.nix diff --git a/nixos/system/bfs.poland.xray/bfs.poland.xray.nix b/nixos/system/bfs.poland.xray/bfs.poland.xray.nix index 6fd37fa4..9427161b 100644 --- a/nixos/system/bfs.poland.xray/bfs.poland.xray.nix +++ b/nixos/system/bfs.poland.xray/bfs.poland.xray.nix @@ -76,6 +76,18 @@ in { defaults.email = "security@bfs.band"; }; + # NOTE(yukkop): this host gets an IPv6 route via RA, but object storage + # fetches to hel1.your-objectstorage.com currently stall over IPv6 while + # IPv4 works. Synapse's S3 media backend uses getaddrinfo ordering, so + # prefer IPv4 here to keep Element media downloads responsive. + environment.etc."gai.conf".text = '' + precedence ::ffff:0:0/96 100 + ''; + + systemd.services.matrix-synapse.restartTriggers = [ + config.environment.etc."gai.conf".source + ]; + services.nginx = { enable = true; diff --git a/nixos/system/neuro/neuro.nix b/nixos/system/neuro/neuro.nix index afcec5e9..c19c7fa6 100644 --- a/nixos/system/neuro/neuro.nix +++ b/nixos/system/neuro/neuro.nix @@ -263,6 +263,7 @@ in { in [ #python-ai git + hectic.hiddify-core neovim wget ethtool diff --git a/package/default.nix b/package/default.nix index 85058a81..83ac1312 100644 --- a/package/default.nix +++ b/package/default.nix @@ -123,6 +123,7 @@ in { py3-swifter = pkgs.callPackage ./py3-swifter.nix {}; py3-aiogram-newsletter = pkgs.callPackage ./py3-aiogram-newsletter.nix {}; py3-openai-shap-e = pkgs.callPackage ./py3-openai-shap-e.nix {}; + hiddify-core = pkgs.callPackage ./hiddify-core {}; nvim-alias = pkgs.callPackage ./nvim-alias.nix {}; bolt-unpack = pkgs.callPackage ./bolt-unpack.nix {}; merge-archive = pkgs.callPackage ./merge-archive {}; diff --git a/package/hiddify-core/default.nix b/package/hiddify-core/default.nix new file mode 100644 index 00000000..a3a0f633 --- /dev/null +++ b/package/hiddify-core/default.nix @@ -0,0 +1,59 @@ +{ + autoPatchelfHook, + lib, + gnutar, + makeWrapper, + stdenv, + stdenvNoCC, + fetchurl, +}: +let + version = "4.1.0"; +in +stdenvNoCC.mkDerivation { + pname = "hiddify-core"; + inherit version; + + src = fetchurl { + url = "https://github.com/hiddify/hiddify-core/releases/download/v${version}/hiddify-core-linux-amd64.tar.gz"; + hash = "sha256-efVXJbnBwLPK1GpF7e2zxb6D16YjbMHfqb14+zxofm8="; + }; + + nativeBuildInputs = [ + autoPatchelfHook + gnutar + makeWrapper + ]; + + buildInputs = [ + stdenv.cc.cc.lib + ]; + + unpackPhase = '' + runHook preUnpack + tar -xzf $src + cd hiddify-core-linux-amd64 + runHook postUnpack + ''; + + installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/lib/hiddify-core $out/share/licenses/hiddify-core + cp LICENSE.md $out/share/licenses/hiddify-core/LICENSE.md + cp hiddify-core $out/lib/hiddify-core/ + cp libcronet.so $out/lib/hiddify-core/ + makeWrapper $out/lib/hiddify-core/hiddify-core $out/bin/hiddify-core \ + --set-default LD_LIBRARY_PATH "$out/lib/hiddify-core" + ln -s $out/bin/hiddify-core $out/bin/hiddify-cli + ln -s $out/bin/hiddify-core $out/bin/HiddifyCli + runHook postInstall + ''; + + meta = { + description = "Hiddify CLI core binary"; + homepage = "https://github.com/hiddify/hiddify-core"; + license = lib.licenses.gpl3Only; + mainProgram = "hiddify-core"; + platforms = [ "x86_64-linux" ]; + }; +}