-
Notifications
You must be signed in to change notification settings - Fork 893
/
flake.nix
114 lines (108 loc) · 3.22 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
{
description = "pwndbg";
nixConfig = {
extra-substituters = [
"https://pwndbg.cachix.org"
];
extra-trusted-public-keys = [
"pwndbg.cachix.org-1:HhtIpP7j73SnuzLgobqqa8LVTng5Qi36sQtNt79cD3k="
];
};
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
inputs.poetry2nix = {
url = "github:nix-community/poetry2nix";
inputs.nixpkgs.follows = "nixpkgs";
};
outputs =
{
self,
nixpkgs,
poetry2nix,
}:
let
# Self contained packages for: Debian, RHEL-like (yum, rpm), Alpine, Arch packages
forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed;
forPortables = nixpkgs.lib.genAttrs [
"deb"
"rpm"
"apk"
"archlinux"
];
pkgsBySystem = forAllSystems (
system:
import nixpkgs {
inherit system;
overlays = [ poetry2nix.overlays.default ];
}
);
pkgUtil = forAllSystems (system: import ./nix/bundle/pkg.nix { pkgs = pkgsBySystem.${system}; });
portableDrvLldb =
system:
import ./nix/portable.nix {
pkgs = pkgsBySystem.${system};
pwndbg = self.packages.${system}.pwndbg-lldb;
};
portableDrv =
system:
import ./nix/portable.nix {
pkgs = pkgsBySystem.${system};
pwndbg = self.packages.${system}.pwndbg;
};
portableDrvs =
system:
forPortables (
packager:
pkgUtil.${system}.buildPackagePFPM {
inherit packager;
drv = portableDrv system;
config = ./nix/bundle/nfpm.yaml;
preremove = ./nix/bundle/preremove.sh;
}
);
tarballDrv = system: {
tarball = pkgUtil.${system}.buildPackageTarball { drv = portableDrv system; };
tarball-lldb = pkgUtil.${system}.buildPackageTarball { drv = portableDrvLldb system; };
};
in
{
packages = forAllSystems (
system:
{
pwndbg = import ./nix/pwndbg.nix {
pkgs = pkgsBySystem.${system};
python3 = pkgsBySystem.${system}.python3;
gdb = pkgsBySystem.${system}.gdb;
inputs.pwndbg = self;
};
default = self.packages.${system}.pwndbg;
pwndbg-dev = import ./nix/pwndbg.nix {
pkgs = pkgsBySystem.${system};
python3 = pkgsBySystem.${system}.python3;
gdb = pkgsBySystem.${system}.gdb;
inputs.pwndbg = self;
isDev = true;
};
pwndbg-lldb = import ./nix/pwndbg.nix {
pkgs = pkgsBySystem.${system};
python3 = pkgsBySystem.${system}.python3;
gdb = pkgsBySystem.${system}.gdb;
inputs.pwndbg = self;
isDev = true;
isLLDB = true;
};
}
// (portableDrvs system)
// (tarballDrv system)
);
devShells = forAllSystems (
system:
import ./nix/devshell.nix {
pkgs = pkgsBySystem.${system};
python3 = pkgsBySystem.${system}.python3;
inputs.pwndbg = self;
isLLDB = true;
}
);
formatter = forAllSystems (system: pkgsBySystem.${system}.nixfmt-rfc-style);
};
}