Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ users)
## External dependencies
* Restore the distribution detection on Gentoo [#6886 @kit-ty-kate - fix #6887]
* Add support for single-quoted values of the /etc/os-release file [#6886 @kit-ty-kate - fix #6887]
* Fix a string injection from the depexts field to nix-build, when `os-family=nixos` [#6894 @RyanGibb]

## Format upgrade

Expand Down
15 changes: 11 additions & 4 deletions src/state/opamSysInteract.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1141,11 +1141,18 @@ let install_packages_commands_t ?(env=OpamVariable.Map.empty) ~to_show st
OpamFilename.create dir
(OpamFilename.Base.of_string "env.nix")
in
let packageFile =
OpamFilename.create dir
(OpamFilename.Base.of_string "nix-depexts.json")
in
let packages =
String.concat " "
(OpamSysPkg.Set.fold (fun p l -> OpamSysPkg.to_string p :: l)
OpamSysPkg.Set.Op.(sys_packages.ti_new ++ sys_packages.ti_required) [])
"[" ^
String.concat ", "
(OpamSysPkg.Set.fold (fun p l -> ("\"" ^ OpamSysPkg.to_string p ^ "\"") :: l)
OpamSysPkg.Set.Op.(sys_packages.ti_new ++ sys_packages.ti_required) [])
^ "]"
in
OpamFilename.write packageFile packages;
(* We exclude variables from
https://github.com/NixOS/nix/blob/e4bda20918ad2af690c2e938211a7d362548e403/src/nix/develop.cc#L308-L325
append to variables from
Expand All @@ -1156,7 +1163,7 @@ let install_packages_commands_t ?(env=OpamVariable.Map.empty) ~to_show st
with pkgs;
stdenv.mkDerivation {
name = "opam-nix-env";
nativeBuildInputs = with buildPackages; [ |} ^ packages ^ {| ];
nativeBuildInputs = map (name: buildPackages.${name}) (builtins.fromJSON (builtins.readFile ./nix-depexts.json));

phases = [ "buildPhase" ];

Expand Down
Loading