feat: added pwn template

This commit is contained in:
Patrick Großmann 2023-10-08 13:42:53 +02:00
parent 6702d07d39
commit 03b92503e2
Signed by: patrick
GPG key ID: 451F95EFB8BECD0F
6 changed files with 184 additions and 0 deletions

View file

@ -7,6 +7,10 @@
path = ./default;
description = "My own basic flake template";
};
pwn = {
path = ./pwn;
description = "My pwn flake template";
};
};
};
}

2
pwn/.envrc Normal file
View file

@ -0,0 +1,2 @@
nix_direnv_watch_file ./devshell.nix
use flake

1
pwn/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
.direnv

44
pwn/devshell.nix Normal file
View file

@ -0,0 +1,44 @@
{
nixpkgs,
devshell,
...
}: system: let
pkgs = import nixpkgs {
inherit system;
overlays = [devshell.overlays.default];
};
shell = with pkgs; {
name = "devshell template";
packages = [
nil
sl
patchelf
];
commands = [
{
package = statix;
help = "The nix linter";
}
{
package = alejandra;
help = "The nix formatter";
}
{
package = (python3.withPackages(ps: with ps; [pwntools]));
help = "python with pwntools";
}
];
env = [
{
name = "NIX_LD";
value = "$PWD/ld-linux-x86-64.so.2";
}
{
name = "NIX_LD_LIBRARY_PATH";
value = "$PWD/libc.so.6";
}
];
};
in
pkgs.devshell.mkShell shell

112
pwn/flake.lock Normal file
View file

@ -0,0 +1,112 @@
{
"nodes": {
"devshell": {
"inputs": {
"nixpkgs": "nixpkgs",
"systems": "systems"
},
"locked": {
"lastModified": 1695973661,
"narHash": "sha256-BP2H4c42GThPIhERtTpV1yCtwQHYHEKdRu7pjrmQAwo=",
"owner": "numtide",
"repo": "devshell",
"rev": "cd4e2fda3150dd2f689caeac07b7f47df5197c31",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "devshell",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1694529238,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1677383253,
"narHash": "sha256-UfpzWfSxkfXHnb4boXZNaKsAcUrZT9Hw+tao1oZxd08=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "9952d6bc395f5841262b006fbace8dd7e143b634",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1696604326,
"narHash": "sha256-YXUNI0kLEcI5g8lqGMb0nh67fY9f2YoJsILafh6zlMo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "87828a0e03d1418e848d3dd3f3014a632e4a4f64",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"devshell": "devshell",
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs_2"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

21
pwn/flake.nix Normal file
View file

@ -0,0 +1,21 @@
{
description = "Patrick tolles flake template";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
devshell.url = "github:numtide/devshell";
};
outputs = {
self,
nixpkgs,
flake-utils,
devshell,
} @ inputs:
flake-utils.lib.eachDefaultSystem (
system: {
devShell = import ./devshell.nix inputs system;
}
);
}