From b9e6f77db0871da3c72928619395590b28ea0181 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 13 Mar 2023 11:07:12 +0100 Subject: ... --- overlays/libdscp/default.nix | 18 ++++++++++++++++++ user-profiles/utils.nix | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) 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 @@ makeFlags = [ "PREFIX=$(out)" ]; }; + + dscp = prev.writeShellApplication { + name = "dscp"; + + text = '' + export LD_PRELOAD + LD_PRELOAD=''${LD_PRELOAD:+':'$LD_PRELOAD':'} + if [[ $LD_PRELOAD != *':'''${final.libdscp}/lib/libdscp.so''':'* ]]; then + LD_PRELOAD='${final.libdscp}/lib/libdscp.so'$LD_PRELOAD + fi + LD_PRELOAD=''${LD_PRELOAD#':'} + LD_PRELOAD=''${LD_PRELOAD%':'} + + : "''${DSCP:=0}" + + exec -- "$@" + ''; + }; } diff --git a/user-profiles/utils.nix b/user-profiles/utils.nix index 48df50ea..775b9339 100644 --- a/user-profiles/utils.nix +++ b/user-profiles/utils.nix @@ -67,7 +67,7 @@ in { psmisc mosh tree vnstat file pv bc zip nmap aspell aspellDicts.de aspellDicts.en borgbackup man-pages rsync socat inetutils yq cached-nix-shell persistent-nix-shell rage - smartmontools hdparm nix-output-monitor wrappedLess + smartmontools hdparm nix-output-monitor wrappedLess dscp ]; }; } -- cgit v1.2.3