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";
|
|
|
|
};
|
|
|
|
|
|
|
|
outputs = { self, nixpkgs, poetry2nix }:
|
|
|
|
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;
|
|
|
|
forPortables = nixpkgs.lib.genAttrs [ "deb" "rpm" "apk" "archlinux" ];
|
|
|
|
|
|
|
|
pkgsBySystem = forAllSystems (system: import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
overlays = [ poetry2nix.overlay ];
|
|
|
|
});
|
|
|
|
pkgUtil = forAllSystems (system: import ./nix/bundle/pkg.nix {
|
|
|
|
pkgs = pkgsBySystem.${system};
|
|
|
|
});
|
|
|
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
// (portableDrvs system)
|
|
|
|
// (tarballDrv system)
|
|
|
|
);
|
|
|
|
};
|
2023-09-29 05:52:59 +08:00
|
|
|
}
|