diff options
author | Jonas Chevalier <zimbatm@zimbatm.com> | 2024-02-15 13:01:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-15 13:01:03 +0100 |
commit | c3ef726ee171a1f78def8c4da8a2e3719efbbfa4 (patch) | |
tree | 4c2f9e56b5c873f2197f9294828f534bf21d988f | |
parent | 446a9051f2749a7321c7487eeadb5be068b26519 (diff) |
nixos/ldso: avoid instance of nixpkgs (#288509)
Follow-up to #269551 Avoid creating a new instance of nixpkgs to access two variables. `pkgs.pkgsi686Linux` was being accessed whenever the feature is being used or not. A second instance of nixpkgs is being created in `nixos/modules/config/stub-ld.nix` and can be disabled by setting `environment.ldso32 = null` or `environment.stub-ld.enable = false`. Both combined fixes this error: error: attribute 'i686-linux' missing
-rw-r--r-- | nixos/modules/config/ldso.nix | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/nixos/modules/config/ldso.nix b/nixos/modules/config/ldso.nix index 72ae3958d8869..bd6f0dc5a83b8 100644 --- a/nixos/modules/config/ldso.nix +++ b/nixos/modules/config/ldso.nix @@ -6,9 +6,9 @@ let libDir = pkgs.stdenv.hostPlatform.libDir; ldsoBasename = builtins.unsafeDiscardStringContext (last (splitString "/" pkgs.stdenv.cc.bintools.dynamicLinker)); - pkgs32 = pkgs.pkgsi686Linux; - libDir32 = pkgs32.stdenv.hostPlatform.libDir; - ldsoBasename32 = builtins.unsafeDiscardStringContext (last (splitString "/" pkgs32.stdenv.cc.bintools.dynamicLinker)); + # Hard-code to avoid creating another instance of nixpkgs. Also avoids eval errors in some cases. + libDir32 = "lib"; # pkgs.pkgsi686Linux.stdenv.hostPlatform.libDir + ldsoBasename32 = "ld-linux.so.2"; # last (splitString "/" pkgs.pkgsi686Linux.stdenv.cc.bintools.dynamicLinker) in { options = { environment.ldso = mkOption { |