summaryrefslogtreecommitdiff
path: root/overlays/libdscp/default.nix
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2023-03-13 11:07:12 +0100
committerGregor Kleen <gkleen@yggdrasil.li>2023-03-13 11:07:12 +0100
commitb9e6f77db0871da3c72928619395590b28ea0181 (patch)
tree50236892635795eba298643d0f79e921ef76a7bd /overlays/libdscp/default.nix
parent832608bfbb6f958f2d80bd12ba194f208e8444e8 (diff)
downloadnixos-b9e6f77db0871da3c72928619395590b28ea0181.tar
nixos-b9e6f77db0871da3c72928619395590b28ea0181.tar.gz
nixos-b9e6f77db0871da3c72928619395590b28ea0181.tar.bz2
nixos-b9e6f77db0871da3c72928619395590b28ea0181.tar.xz
nixos-b9e6f77db0871da3c72928619395590b28ea0181.zip
...
Diffstat (limited to 'overlays/libdscp/default.nix')
-rw-r--r--overlays/libdscp/default.nix18
1 files changed, 18 insertions, 0 deletions
diff --git a/overlays/libdscp/default.nix b/overlays/libdscp/default.nix
index 47103fd3..9e82f20e 100644
--- a/overlays/libdscp/default.nix
+++ b/overlays/libdscp/default.nix
@@ -8,4 +8,22 @@
8 8
9 makeFlags = [ "PREFIX=$(out)" ]; 9 makeFlags = [ "PREFIX=$(out)" ];
10 }; 10 };
11
12 dscp = prev.writeShellApplication {
13 name = "dscp";
14
15 text = ''
16 export LD_PRELOAD
17 LD_PRELOAD=''${LD_PRELOAD:+':'$LD_PRELOAD':'}
18 if [[ $LD_PRELOAD != *':'''${final.libdscp}/lib/libdscp.so''':'* ]]; then
19 LD_PRELOAD='${final.libdscp}/lib/libdscp.so'$LD_PRELOAD
20 fi
21 LD_PRELOAD=''${LD_PRELOAD#':'}
22 LD_PRELOAD=''${LD_PRELOAD%':'}
23
24 : "''${DSCP:=0}"
25
26 exec -- "$@"
27 '';
28 };
11} 29}