commit b882aea0464c151ed1fdf35fdc42b38ddef9b074 Author: mawalu Date: Wed May 11 10:48:03 2022 +0200 Initial commit diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..94f7edf --- /dev/null +++ b/flake.lock @@ -0,0 +1,43 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1649676176, + "narHash": "sha256-OWKJratjt2RW151VUlJPRALb7OU2S5s+f0vLj4o1bHM=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "a4b154ebbdc88c8498a5c7b01589addc9e9cb678", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "rev": "a4b154ebbdc88c8498a5c7b01589addc9e9cb678", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1651495557, + "narHash": "sha256-LtdjPfRx0JdMnNcViZ/NpqCX/v3HE7SP0P/Ipf2AVtk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "2379d9d0595d269577187053b1cdfd1e0f731894", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..6e6ad10 --- /dev/null +++ b/flake.nix @@ -0,0 +1,53 @@ +{ + description = "Webdev flake"; + + inputs.nixpkgs.url = "github:NixOS/nixpkgs"; + inputs.flake-utils.url = "github:numtide/flake-utils?rev=a4b154ebbdc88c8498a5c7b01589addc9e9cb678"; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + inputs = with pkgs; [ + nodejs nodePackages.npm nodePackages.yarn + git gnupg vim less openssh + ]; + mkPhp = pkg: let php = pkg.buildEnv { + extensions = { enabled, all }: enabled ++ [ all.imagick all.redis ]; + extraConfig = "memory_limit = 2G"; + }; in [ php php.packages.composer ]; + devShell = config: pkgs.mkShell { + shellHook = '' + cd $DEVSHELL_OLDPWD + exec bwbox --profile dev zsh + ''; + } // config; + in { + devShells = { + php74 = devShell { + buildInputs = inputs ++ (mkPhp pkgs.php74); + }; + php80 = devShell { + buildInputs = inputs ++ (mkPhp pkgs.php80); + }; + php81 = devShell { + buildInputs = inputs ++ (mkPhp pkgs.php81); + }; + devops = devShell { + buildInputs = with pkgs; inputs ++ [ ansible ]; + }; + ctf = devShell { + buildInputs = + let + python = pkgs.python310.withPackages (p: with p; [ + requests + pip + setuptools + ]); + in + with pkgs; inputs ++ [ python curl ]; + }; + }; + } + ); +}