-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
31 lines (31 loc) · 990 Bytes
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{ java11?false, java14?false }:
with import<nixpkgs>{};
let baseInputs = with pkgs; [
maven
lsof
nodejs
yarn
netcat-gnu
];
buildInp = if (java11) then baseInputs ++ [pkgs.jdk11]
else if(java14) then baseInputs ++ [pkgs.jdk14]
else baseInputs ++ [pkgs.openjdk];
in
pkgs.stdenv.mkDerivation {
name="mf-debugging";
version="1";
buildInputs = buildInp;
shellHook = ''
getEchoRequest() {
echo "{ \"messageID\": \"`getUUID`\"; \"topic\": \"org.Team107.MF.Echo\"; \"data\": { \"uuid\": \"`getUUID`\"; \"id\": 1; \"otherInfo\": \"SD1\"; \"request\": \"true\" }}\"";
};
alias getUUID="cat /proc/sys/kernel/random/uuid";
sendEchoTo() {
req=`getEchoRequest`
printf "sending %s\n" $req
echo "to $1"
echo "press ^C to send the request"
(echo "$req") | nc localhost $1
}
'';
}