lol

Merge master into staging-next

authored by

github-actions[bot] and committed by
GitHub
5a3667ee 67922fec

+222 -6
+11 -3
.github/workflows/check-by-name.yml
··· 17 17 # as specified in nixos/release-combined.nix 18 18 runs-on: ubuntu-latest 19 19 steps: 20 + - name: Resolving the merge commit 21 + run: | 22 + if result=$(git ls-remote --exit-code ${{ github.event.pull_request.base.repo.clone_url }} refs/pull/${{ github.event.pull_request.number }}/merge); then 23 + mergedSha=$(cut -f1 <<< "$result") 24 + echo "The PR appears to not have any conflicts, checking the merge commit $mergedSha" 25 + else 26 + echo "The PR may have a merge conflict" 27 + exit 1 28 + fi 29 + echo "mergedSha=$mergedSha" >> "$GITHUB_ENV" 20 30 - uses: actions/checkout@v4 21 31 with: 22 32 # pull_request_target checks out the base branch by default 23 - ref: refs/pull/${{ github.event.pull_request.number }}/merge 33 + ref: ${{ env.mergedSha }} 24 34 # Fetches the merge commit and its parents 25 35 fetch-depth: 2 26 36 - name: Determining PR git hashes 27 37 run: | 28 - echo "mergedSha=$(git rev-parse HEAD)" >> "$GITHUB_ENV" 29 - 30 38 # For pull_request_target this is the same as $GITHUB_SHA 31 39 echo "baseSha=$(git rev-parse HEAD^1)" >> "$GITHUB_ENV" 32 40
+172
pkgs/applications/networking/cluster/opentofu/default.nix
··· 1 + { stdenv 2 + , lib 3 + , buildGoModule 4 + , fetchFromGitHub 5 + , makeWrapper 6 + , coreutils 7 + , runCommand 8 + , runtimeShell 9 + , writeText 10 + , terraform-providers 11 + , installShellFiles 12 + }: 13 + 14 + let 15 + package = buildGoModule rec { 16 + pname = "opentofu"; 17 + version = "1.6.0-alpha1"; 18 + 19 + src = fetchFromGitHub { 20 + owner = "opentofu"; 21 + repo = "opentofu"; 22 + rev = "v${version}"; 23 + hash = "sha256-0FO55H1nOyhAd+ex1zA0XycH6x/HKkLlxzuIJNoaI9g="; 24 + }; 25 + vendorHash = "sha256-3jQfIIZOgOmNHQ06rXz+3QTZ37WcuCc7A7/MhC7udrg="; 26 + ldflags = [ "-s" "-w" ]; 27 + 28 + postConfigure = '' 29 + # speakeasy hardcodes /bin/stty https://github.com/bgentry/speakeasy/issues/22 30 + substituteInPlace vendor/github.com/bgentry/speakeasy/speakeasy_unix.go \ 31 + --replace "/bin/stty" "${coreutils}/bin/stty" 32 + ''; 33 + 34 + nativeBuildInputs = [ installShellFiles ]; 35 + patches = [ ./provider-path-0_15.patch ]; 36 + 37 + passthru = { 38 + inherit plugins withPlugins; 39 + tests = { inherit opentofu_plugins_test; }; 40 + }; 41 + 42 + # https://github.com/posener/complete/blob/9a4745ac49b29530e07dc2581745a218b646b7a3/cmd/install/bash.go#L8 43 + postInstall = '' 44 + installShellCompletion --bash --name tofu <(echo complete -C tofu tofu) 45 + ''; 46 + 47 + preCheck = '' 48 + export HOME=$TMPDIR 49 + export TF_SKIP_REMOTE_TESTS=1 50 + ''; 51 + 52 + subPackages = [ "./cmd/..." ]; 53 + 54 + meta = with lib; { 55 + description = "Tool for building, changing, and versioning infrastructure"; 56 + homepage = "https://opentofu.org/"; 57 + changelog = "https://github.com/opentofu/opentofu/blob/v${version}/CHANGELOG.md"; 58 + license = licenses.mpl20; 59 + maintainers = with maintainers; [ 60 + gmemstr 61 + ]; 62 + mainProgram = "tofu"; 63 + }; 64 + }; 65 + 66 + opentofu_plugins_test = let 67 + mainTf = writeText "main.tf" '' 68 + resource "random_id" "test" {} 69 + ''; 70 + opentofu = package.withPlugins (p: [ p.random ]); 71 + test = runCommand "opentofu-plugin-test" { 72 + buildInputs = [ opentofu ]; 73 + } '' 74 + # make it fail outside of sandbox 75 + export HTTP_PROXY=http://127.0.0.1:0 HTTPS_PROXY=https://127.0.0.1:0 76 + cp ${mainTf} main.tf 77 + tofu init 78 + touch $out 79 + ''; 80 + in 81 + test; 82 + 83 + plugins = removeAttrs terraform-providers [ 84 + "override" 85 + "overrideDerivation" 86 + "recurseForDerivations" 87 + ]; 88 + 89 + withPlugins = plugins: 90 + let 91 + actualPlugins = plugins package.plugins; 92 + 93 + # Wrap PATH of plugins propagatedBuildInputs, plugins may have runtime dependencies on external binaries 94 + wrapperInputs = lib.unique (lib.flatten 95 + (lib.catAttrs "propagatedBuildInputs" 96 + (builtins.filter (x: x != null) actualPlugins))); 97 + 98 + passthru = { 99 + withPlugins = newplugins: 100 + withPlugins (x: newplugins x ++ actualPlugins); 101 + full = withPlugins (p: lib.filter lib.isDerivation (lib.attrValues p.actualProviders)); 102 + 103 + # Expose wrappers around the override* functions of the terraform 104 + # derivation. 105 + # 106 + # Note that this does not behave as anyone would expect if plugins 107 + # are specified. The overrides are not on the user-visible wrapper 108 + # derivation but instead on the function application that eventually 109 + # generates the wrapper. This means: 110 + # 111 + # 1. When using overrideAttrs, only `passthru` attributes will 112 + # become visible on the wrapper derivation. Other overrides that 113 + # modify the derivation *may* still have an effect, but it can be 114 + # difficult to follow. 115 + # 116 + # 2. Other overrides may work if they modify the terraform 117 + # derivation, or they may have no effect, depending on what 118 + # exactly is being changed. 119 + # 120 + # 3. Specifying overrides on the wrapper is unsupported. 121 + # 122 + # See nixpkgs#158620 for details. 123 + overrideDerivation = f: 124 + (package.overrideDerivation f).withPlugins plugins; 125 + overrideAttrs = f: 126 + (package.overrideAttrs f).withPlugins plugins; 127 + override = x: 128 + (package.override x).withPlugins plugins; 129 + }; 130 + # Don't bother wrapping unless we actually have plugins, since the wrapper will stop automatic downloading 131 + # of plugins, which might be counterintuitive if someone just wants a vanilla Terraform. 132 + in 133 + if actualPlugins == [ ] then 134 + package.overrideAttrs 135 + (orig: { passthru = orig.passthru // passthru; }) 136 + else 137 + lib.appendToName "with-plugins" (stdenv.mkDerivation { 138 + inherit (package) meta pname version; 139 + nativeBuildInputs = [ makeWrapper ]; 140 + 141 + # Expose the passthru set with the override functions 142 + # defined above, as well as any passthru values already 143 + # set on `terraform` at this point (relevant in case a 144 + # user overrides attributes). 145 + passthru = package.passthru // passthru; 146 + 147 + buildCommand = '' 148 + # Create wrappers for terraform plugins because Terraform only 149 + # walks inside of a tree of files. 150 + for providerDir in ${toString actualPlugins} 151 + do 152 + for file in $(find $providerDir/libexec/terraform-providers -type f) 153 + do 154 + relFile=''${file#$providerDir/} 155 + mkdir -p $out/$(dirname $relFile) 156 + cat <<WRAPPER > $out/$relFile 157 + #!${runtimeShell} 158 + exec "$file" "$@" 159 + WRAPPER 160 + chmod +x $out/$relFile 161 + done 162 + done 163 + 164 + # Create a wrapper for opentofu to point it to the plugins dir. 165 + mkdir -p $out/bin/ 166 + makeWrapper "${package}/bin/tofu" "$out/bin/tofu" \ 167 + --set NIX_TERRAFORM_PLUGIN_DIR $out/libexec/terraform-providers \ 168 + --prefix PATH : "${lib.makeBinPath wrapperInputs}" 169 + ''; 170 + }); 171 + in 172 + package
+23
pkgs/applications/networking/cluster/opentofu/provider-path-0_15.patch
··· 1 + diff -Naur terraform.old/internal/command/init.go terraform.new/internal/command/init.go 2 + --- terraform.old/internal/command/init.go 3 + +++ terraform.new/internal/command/init.go 4 + @@ -3,6 +3,7 @@ 5 + import ( 6 + "context" 7 + "fmt" 8 + + "os" 9 + "log" 10 + "strings" 11 + 12 + @@ -55,6 +56,11 @@ 13 + 14 + var diags tfdiags.Diagnostics 15 + 16 + + val, ok := os.LookupEnv("NIX_TERRAFORM_PLUGIN_DIR") 17 + + if ok { 18 + + flagPluginPath = append(flagPluginPath, val) 19 + + } 20 + + 21 + if len(flagPluginPath) > 0 { 22 + c.pluginPath = flagPluginPath 23 + }
+2 -2
pkgs/development/python-modules/pyfaidx/default.nix
··· 12 12 13 13 buildPythonPackage rec { 14 14 pname = "pyfaidx"; 15 - version = "0.7.2.1"; 15 + version = "0.7.2.2"; 16 16 format = "pyproject"; 17 17 18 18 src = fetchPypi { 19 19 inherit pname version; 20 - hash = "sha256-MPDSCp49UzU/sg62m34i5vAaU+1PIbPhfdQI8L5QUaA="; 20 + hash = "sha256-O3aTwFLIJpEAD+SpJHXbgv/DtachoSsQ37yHEZxLTTA="; 21 21 }; 22 22 23 23 nativeBuildInputs = [
+12 -1
pkgs/os-specific/linux/alsa-project/alsa-utils/default.nix
··· 1 - {lib, stdenv, fetchurl, alsa-lib, gettext, makeWrapper, ncurses, libsamplerate, pciutils, which, fftw}: 1 + {lib, stdenv, fetchurl, fetchpatch, alsa-lib, gettext, makeWrapper, ncurses, libsamplerate, pciutils, which, fftw}: 2 2 3 3 stdenv.mkDerivation rec { 4 4 pname = "alsa-utils"; ··· 8 8 url = "mirror://alsa/utils/${pname}-${version}.tar.bz2"; 9 9 sha256 = "sha256-EEti7H8Cp84WynefSBVhbfHMIZM1A3g6kQe1lE+DBjo="; 10 10 }; 11 + patches = [ 12 + # Backport fixes for musl libc. Remove on next release 13 + (fetchpatch { 14 + url = "https://github.com/alsa-project/alsa-utils/commit/8c229270f6bae83b705a03714c46067a7aa57b02.patch"; 15 + hash = "sha256-sUaBHY8EHf4805nF6tyNV5jYXcJf3O+r04VXFu4dUCE="; 16 + }) 17 + (fetchpatch { 18 + url = "https://github.com/alsa-project/alsa-utils/commit/0925ad7f09b2dc77015784f9ac2f5e34dd0dd5c3.patch"; 19 + hash = "sha256-bgGU9On82AUbOjo+KN6WfuhqUAWM87OHnKN7plpG284="; 20 + }) 21 + ]; 11 22 12 23 nativeBuildInputs = [ gettext makeWrapper ]; 13 24 buildInputs = [ alsa-lib ncurses libsamplerate fftw ];
+2
pkgs/top-level/all-packages.nix
··· 11638 11638 11639 11639 opensp = callPackage ../tools/text/sgml/opensp { }; 11640 11640 11641 + opentofu = callPackage ../applications/networking/cluster/opentofu { }; 11642 + 11641 11643 opentrack = libsForQt5.callPackage ../applications/misc/opentrack { }; 11642 11644 11643 11645 opentracker = callPackage ../applications/networking/p2p/opentracker { };