2023-08-06 20:27:30 +08:00
|
|
|
{
|
|
|
|
description = "pwndbg";
|
|
|
|
|
|
|
|
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
|
|
inputs.poetry2nix = {
|
2023-08-07 17:34:48 +08:00
|
|
|
url = "github:nix-community/poetry2nix";
|
2023-08-06 20:27:30 +08:00
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
2024-05-21 22:09:50 +08:00
|
|
|
outputs =
|
|
|
|
{
|
|
|
|
self,
|
|
|
|
nixpkgs,
|
|
|
|
poetry2nix,
|
|
|
|
}:
|
2023-08-06 20:27:30 +08:00
|
|
|
let
|
2023-09-29 04:08:24 +08:00
|
|
|
# Self contained packages for: Debian, RHEL-like (yum, rpm), Alpine, Arch packages
|
2023-08-06 20:27:30 +08:00
|
|
|
forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed;
|
2024-05-21 22:09:50 +08:00
|
|
|
forPortables = nixpkgs.lib.genAttrs [
|
|
|
|
"deb"
|
|
|
|
"rpm"
|
|
|
|
"apk"
|
|
|
|
"archlinux"
|
|
|
|
];
|
2023-08-06 20:27:30 +08:00
|
|
|
|
2024-05-21 22:09:50 +08:00
|
|
|
pkgsBySystem = forAllSystems (
|
|
|
|
system:
|
|
|
|
import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
overlays = [ poetry2nix.overlays.default ];
|
|
|
|
}
|
|
|
|
);
|
|
|
|
pkgUtil = forAllSystems (system: import ./nix/bundle/pkg.nix { pkgs = pkgsBySystem.${system}; });
|
2023-08-06 20:27:30 +08:00
|
|
|
|
2024-05-21 22:09:50 +08:00
|
|
|
portableDrv =
|
|
|
|
system:
|
|
|
|
import ./nix/portable.nix {
|
|
|
|
pkgs = pkgsBySystem.${system};
|
|
|
|
pwndbg = self.packages.${system}.pwndbg;
|
2023-08-06 20:27:30 +08:00
|
|
|
};
|
2024-05-21 22:09:50 +08:00
|
|
|
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; };
|
2023-08-06 20:27:30 +08:00
|
|
|
};
|
|
|
|
in
|
2024-05-21 22:09:50 +08:00
|
|
|
{
|
|
|
|
packages = forAllSystems (
|
|
|
|
system:
|
|
|
|
{
|
2023-08-06 20:27:30 +08:00
|
|
|
pwndbg = import ./nix/pwndbg.nix {
|
|
|
|
pkgs = pkgsBySystem.${system};
|
|
|
|
python3 = pkgsBySystem.${system}.python3;
|
|
|
|
gdb = pkgsBySystem.${system}.gdb;
|
|
|
|
inputs.pwndbg = self;
|
|
|
|
};
|
|
|
|
default = self.packages.${system}.pwndbg;
|
2024-06-25 07:42:34 +08:00
|
|
|
pwndbg-dev = import ./nix/pwndbg.nix {
|
|
|
|
pkgs = pkgsBySystem.${system};
|
|
|
|
python3 = pkgsBySystem.${system}.python3;
|
|
|
|
gdb = pkgsBySystem.${system}.gdb;
|
|
|
|
inputs.pwndbg = self;
|
|
|
|
isDev = true;
|
|
|
|
};
|
2024-09-03 23:27:59 +08:00
|
|
|
pwndbg-lldb = import ./nix/pwndbg.nix {
|
|
|
|
pkgs = pkgsBySystem.${system};
|
|
|
|
python3 = pkgsBySystem.${system}.python3;
|
|
|
|
gdb = pkgsBySystem.${system}.gdb;
|
|
|
|
inputs.pwndbg = self;
|
|
|
|
isDev = true;
|
|
|
|
isLLDB = true;
|
|
|
|
};
|
2023-08-06 20:27:30 +08:00
|
|
|
}
|
|
|
|
// (portableDrvs system)
|
|
|
|
// (tarballDrv system)
|
|
|
|
);
|
2024-06-25 07:42:34 +08:00
|
|
|
|
|
|
|
devShells = forAllSystems (
|
|
|
|
system:
|
|
|
|
import ./nix/devshell.nix {
|
|
|
|
pkgs = pkgsBySystem.${system};
|
|
|
|
python3 = pkgsBySystem.${system}.python3;
|
|
|
|
inputs.pwndbg = self;
|
2024-09-03 23:27:59 +08:00
|
|
|
isLLDB = true;
|
2024-06-25 07:42:34 +08:00
|
|
|
}
|
|
|
|
);
|
2024-05-21 22:09:50 +08:00
|
|
|
};
|
2023-10-13 00:32:54 +08:00
|
|
|
}
|