From fa20c1d562a01a115ebc06b95405bea1d7291ef9 Mon Sep 17 00:00:00 2001 From: chn Date: Sun, 11 May 2025 09:20:43 +0800 Subject: [PATCH] port patches --- lib/systems/examples.nix | 2 ++ nixos/modules/services/databases/mysql.nix | 4 ++-- nixos/modules/services/web-servers/nginx/default.nix | 9 +++++++++ pkgs/applications/editors/vscode/with-extensions.nix | 3 ++- pkgs/by-name/op/openmpi/package.nix | 3 ++- pkgs/kde/default.nix | 3 +++ 6 files changed, 20 insertions(+), 4 deletions(-) diff --git a/lib/systems/examples.nix b/lib/systems/examples.nix index de33fce3e8eb..0dee68e49e3b 100644 --- a/lib/systems/examples.nix +++ b/lib/systems/examples.nix @@ -327,6 +327,8 @@ rec { libc = "msvcrt"; # This distinguishes the mingw (non posix) toolchain }; + mingwW64Static = mingwW64 // { isStatic = true; }; + ucrt64 = { config = "x86_64-w64-mingw32"; libc = "ucrt"; # This distinguishes the mingw (non posix) toolchain diff --git a/nixos/modules/services/databases/mysql.nix b/nixos/modules/services/databases/mysql.nix index 59c868d6628e..1580fea28af8 100644 --- a/nixos/modules/services/databases/mysql.nix +++ b/nixos/modules/services/databases/mysql.nix @@ -611,10 +611,10 @@ in then # While MariaDB comes with a 'mysql' super user account since 10.4.x, MySQL does not # Since we don't want to run this service as 'root' we need to ensure the account exists on first run - ( echo "CREATE USER IF NOT EXISTS '${cfg.user}'@'localhost' IDENTIFIED WITH ${ + ( echo "CREATE USER IF NOT EXISTS '${cfg.user}' IDENTIFIED WITH ${ if isMariaDB then "unix_socket" else "auth_socket" };" - echo "GRANT ALL PRIVILEGES ON *.* TO '${cfg.user}'@'localhost' WITH GRANT OPTION;" + echo "GRANT ALL PRIVILEGES ON *.* TO '${cfg.user}' WITH GRANT OPTION;" ) | ${cfg.package}/bin/mysql -u ${superUser} -N ${lib.concatMapStrings (database: '' diff --git a/nixos/modules/services/web-servers/nginx/default.nix b/nixos/modules/services/web-servers/nginx/default.nix index bf658564515c..b262aa5953a2 100644 --- a/nixos/modules/services/web-servers/nginx/default.nix +++ b/nixos/modules/services/web-servers/nginx/default.nix @@ -113,6 +113,14 @@ let proxy_set_header X-Forwarded-Server $host; ''; + recommendedProxyConfigNoHost = pkgs.writeText "nginx-recommended-proxy-headers-no-host.conf" '' + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-Server $host; + ''; + proxyCachePathConfig = concatStringsSep "\n" ( mapAttrsToList (name: proxyCachePath: '' proxy_cache_path ${ @@ -543,6 +551,7 @@ let ${optionalString ( config.proxyPass != null && config.recommendedProxySettings ) "include ${recommendedProxyConfig};"} + ${optionalString (config.proxyPass != null && config.recommendedProxySettingsNoHost) "include ${recommendedProxyConfigNoHost};"} ${optionalString ( config.uwsgiPass != null && config.recommendedUwsgiSettings ) "include ${cfg.package}/conf/uwsgi_params;"} diff --git a/pkgs/applications/editors/vscode/with-extensions.nix b/pkgs/applications/editors/vscode/with-extensions.nix index 5097d177d624..2311cd85ba7b 100644 --- a/pkgs/applications/editors/vscode/with-extensions.nix +++ b/pkgs/applications/editors/vscode/with-extensions.nix @@ -8,6 +8,7 @@ makeWrapper, writeTextFile, vscodeExtensions ? [ ], + extraFlags ? "", }: /* @@ -68,7 +69,7 @@ let extensionsFlag = '' --add-flags "--extensions-dir ${combinedExtensionsDrv}/share/vscode/extensions" - ''; + '' + extraFlags; in runCommand "${wrappedPkgName}-with-extensions-${wrappedPkgVersion}" diff --git a/pkgs/by-name/op/openmpi/package.nix b/pkgs/by-name/op/openmpi/package.nix index 5c72a6dbbc7f..9a55b3163c38 100644 --- a/pkgs/by-name/op/openmpi/package.nix +++ b/pkgs/by-name/op/openmpi/package.nix @@ -37,6 +37,7 @@ # note that opempi fails to build with AVX disabled, meaning that everything # up to AVX is enabled by default. avxOptions ? { }, + enableSubstitute ? true, }: stdenv.mkDerivation (finalAttrs: { @@ -230,7 +231,7 @@ stdenv.mkDerivation (finalAttrs: { # compilers at build time ${lib.pipe wrapperDataFileNames [ (lib.mapCartesianProduct ( - { part1, part2 }: + { part1, part2 }: lib.optionalString enableSubstitute '' substituteInPlace "''${!outputDev}/share/openmpi/${part1}${part2}-wrapper-data.txt" \ --replace-fail \ diff --git a/pkgs/kde/default.nix b/pkgs/kde/default.nix index 14acfe0f2f7f..3532c3c09f1c 100644 --- a/pkgs/kde/default.nix +++ b/pkgs/kde/default.nix @@ -91,6 +91,9 @@ let krohnkite = self.callPackage ./third-party/krohnkite { }; kzones = self.callPackage ./third-party/kzones { }; wallpaper-engine-plugin = self.callPackage ./third-party/wallpaper-engine-plugin { }; + + # Convenient for users to install various tools provided by kde + kdeGear = gear; } ); in