diff options
Diffstat (limited to 'nix/templates')
-rw-r--r-- | nix/templates/ctf/flake.nix | 47 | ||||
-rw-r--r-- | nix/templates/python3/flake.nix | 55 |
2 files changed, 54 insertions, 48 deletions
diff --git a/nix/templates/ctf/flake.nix b/nix/templates/ctf/flake.nix index de6e2c1..67f33ca 100644 --- a/nix/templates/ctf/flake.nix +++ b/nix/templates/ctf/flake.nix @@ -7,7 +7,8 @@ }; # Flake outputs - outputs = { self, nixpkgs }: + outputs = + { self, nixpkgs }: let # Systems supported allSystems = [ @@ -20,28 +21,32 @@ # 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; }; - }); + 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 = with pkgs; [ - qemu - ] ++ [ - # Python plus helper tools - (python.withPackages (ps: with ps; [ - pwntools - pycryptodome - ])) - ]; - }; - }); + devShells = forAllSystems ( + { pkgs }: + { + default = + let + python = pkgs.python311; # Use Python 3.11 + in + pkgs.mkShell { + packages = + with pkgs; + [ qemu ] + ++ [ + # Python plus helper tools + (python.withPackages ( + ps: with ps; [ + pwntools + pycryptodome + ] + )) + ]; + }; + } + ); }; } diff --git a/nix/templates/python3/flake.nix b/nix/templates/python3/flake.nix index f5c2378..b080013 100644 --- a/nix/templates/python3/flake.nix +++ b/nix/templates/python3/flake.nix @@ -1,31 +1,32 @@ { - description = "a simple flake for using python with some dependencies"; - nixConfig.bash-promt = "py; "; + description = "a simple flake for using python with some dependencies"; + nixConfig.bash-promt = "py; "; - inputs = { + inputs = { nixpkgs.url = "git+https://github.com/nixos/nixpkgs?ref=release-23.11"; - }; - - outputs = { nixpkgs, ... }: - - let - pkgs = import nixpkgs { - system = "aarch64-darwin"; - }; - in { - devShells."aarch64-darwin".default = - let - python = pkgs.python311; - in - pkgs.mkShell { - packages = [ - (python.withPackages (ps: with ps; [ - pwntools - beautifulsoup4 - requests - ])) - ]; - }; - }; -} + }; + + outputs = + { nixpkgs, ... }: + let + pkgs = import nixpkgs { system = "aarch64-darwin"; }; + in + { + devShells."aarch64-darwin".default = + let + python = pkgs.python311; + in + pkgs.mkShell { + packages = [ + (python.withPackages ( + ps: with ps; [ + pwntools + beautifulsoup4 + requests + ] + )) + ]; + }; + }; +} |