nixpkgs/pkgs/tools/misc/ddcutil/nixos-paths.diff
2021-04-24 11:21:11 +02:00

31 lines
809 B
Diff

--- a/src/util/linux_util.c
+++ b/src/util/linux_util.c
@@ -125,6 +125,7 @@
"lib64",
"lib32",
"usr/lib", // needed for arch?
+ "run/booted-system/kernel-modules/lib", // NixOS
NULL};
int result = -1;
int ndx = 0;
@@ -204,14 +205,15 @@
if (debug)
printf("(%s) machine: %s", __func__, utsbuf.machine);
- char * libdirs[3];
+ char * libdirs[4];
libdirs[0] = "lib";
+ libdirs[1] = "run/booted-system/kernel-modules/lib";
if (streq(utsbuf.machine, "amd_64")){
- libdirs[1] = "lib64";
- libdirs[2] = NULL;
+ libdirs[2] = "lib64";
+ libdirs[3] = NULL;
}
else
- libdirs[1] = NULL;
+ libdirs[2] = NULL;
int libsndx = 0;
bool found = false;