devshells/flake.nix

56 lines
1.7 KiB
Nix
Raw Permalink Normal View History

2022-05-11 10:48:03 +02:00
{
description = "Webdev flake";
inputs.nixpkgs.url = "github:NixOS/nixpkgs";
2022-05-20 15:31:42 +02:00
inputs.flake-utils.url = "git+https://g.m5w.de/mawalu/flake-utils";
inputs.flake-utils.inputs.nixpkgs.follows = "nixpkgs";
2022-05-11 10:48:03 +02:00
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
2022-05-20 15:31:42 +02:00
inputs = with pkgs; [
2022-05-11 10:48:03 +02:00
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 ];
2022-05-20 15:31:42 +02:00
devShell = config: pkgs.mkShell ({
2022-05-11 10:48:03 +02:00
shellHook = ''
cd $DEVSHELL_OLDPWD
exec bwbox --profile dev zsh
'';
2022-05-20 15:31:42 +02:00
} // config);
2022-05-11 10:48:03 +02:00
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; [
pip
2022-05-20 15:31:42 +02:00
pwntools
requests
2022-05-11 10:48:03 +02:00
setuptools
]);
in
2022-05-20 15:31:42 +02:00
with pkgs; inputs ++ [ python curl pwndbg metasploit john gobuster nmap ];
2022-05-11 10:48:03 +02:00
};
};
}
);
}