diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/drm-kmod/package.nix b/pkgs/os-specific/bsd/freebsd/pkgs/drm-kmod/package.nix index 42806392d217..c604ee573628 100644 --- a/pkgs/os-specific/bsd/freebsd/pkgs/drm-kmod/package.nix +++ b/pkgs/os-specific/bsd/freebsd/pkgs/drm-kmod/package.nix @@ -22,6 +22,9 @@ let fetchOptions = (lib.importJSON ./versions.json).${branch}; in mkDerivation { + # this derivation is tricky; it is not an in-tree FreeBSD build but it is meant to be built + # at the same time as the in-tree FreeBSD code, so it expects the same environment. Therefore, + # it is appropriate to use the freebsd mkDerivation. pname = "drm-kmod"; version = branch; diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/mkDerivation.nix b/pkgs/os-specific/bsd/freebsd/pkgs/mkDerivation.nix index 3ff7258734ef..81b6cb1ae662 100644 --- a/pkgs/os-specific/bsd/freebsd/pkgs/mkDerivation.nix +++ b/pkgs/os-specific/bsd/freebsd/pkgs/mkDerivation.nix @@ -117,7 +117,9 @@ lib.makeOverridable ( // { patches = (lib.optionals (attrs.autoPickPatches or true) ( - freebsd-lib.filterPatches patches (attrs.extraPaths or [ ] ++ [ attrs.path ]) + freebsd-lib.filterPatches patches ( + attrs.extraPaths or [ ] ++ (lib.optional (attrs ? path) attrs.path) + ) )) ++ attrs.patches or [ ]; }