about summary refs log tree commit diff
path: root/flake.nix
diff options
context:
space:
mode:
authorEmile <git@emile.space>2023-02-18 23:55:12 +0100
committerEmile <git@emile.space>2023-02-18 23:55:12 +0100
commit70a8d1cab484248326793bed1fa30b1365c64119 (patch)
treee91345c6fe8e5c34b61ed970c79d591530466979 /flake.nix
parent0737bc9fa0bd542ddcc2cbc2130020e3d5abfb8a (diff)
it\'s fuzzing
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix48
1 files changed, 48 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..18b4180
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,48 @@
+{
+  description = "Nix pwn env";
+  nixConfig.bash-prompt = "\[pwn\]; ";
+
+  inputs = {
+    nixpkgs.url = "github:NixOS/nixpkgs";
+  };
+
+  # Flake outputs
+  outputs = { self, nixpkgs }:
+    let
+      # Systems supported
+      allSystems = [
+        "x86_64-linux" # 64-bit Intel/AMD Linux
+        "aarch64-linux" # 64-bit ARM Linux
+        "x86_64-darwin" # 64-bit Intel macOS
+        "aarch64-darwin" # 64-bit ARM macOS
+      ];
+
+      # Helper to provide system-specific attributes
+      nameValuePair = name: value: { inherit name value; };
+      genAttrs = names: f: builtins.listToAttrs (map (n: nameValuePair n (f n)) names);
+      forAllSystems = f: genAttrs allSystems (system: f {
+        pkgs = import nixpkgs { inherit system; };
+      });
+    in
+    {
+      # Development environment output
+      devShells = forAllSystems ({ pkgs }: {
+        default =
+          let
+            python = pkgs.python311; # Use Python 3.11
+          in
+          pkgs.mkShell {
+            packages = [ # The Nix packages provided in the environment
+
+              # Python plus helper tools
+              (python.withPackages (ps: with ps; [
+                virtualenv # Virtualenv
+                pip # The pip installer
+                pwntools # The pip installer
+              ]))
+
+            ];
+          };
+      });
+    };
+}