Add initial dev shells

This commit is contained in:
Oliver Davies 2025-06-22 21:08:07 +01:00
commit c12dcc81fa
6 changed files with 90 additions and 0 deletions

1
.envrc Normal file
View file

@ -0,0 +1 @@
use flake

27
flake.lock generated Normal file
View file

@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1750365781,
"narHash": "sha256-XE/lFNhz5lsriMm/yjXkvSZz5DfvKJLUjsS6pP8EC50=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "08f22084e6085d19bcfb4be30d1ca76ecb96fe54",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

31
flake.nix Normal file
View file

@ -0,0 +1,31 @@
{
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
outputs =
{ nixpkgs, ... }:
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
inherit (pkgs) callPackage;
commonPhpPackages = with pkgs; [
phpactor
];
in
{
devShells.${system} = {
default = pkgs.mkShell {
packages = with pkgs; [ nixd ];
};
nodejs = callPackage ./modules/nodejs.nix { };
php82 = callPackage ./modules/php82.nix { inherit commonPhpPackages; };
php83 = callPackage ./modules/php83.nix { inherit commonPhpPackages; };
};
formatter.${system} = pkgs.nixfmt-rfc-style;
};
}

9
modules/nodejs.nix Normal file
View file

@ -0,0 +1,9 @@
{ pkgs }:
pkgs.mkShell {
packages = with pkgs; [
nodejs
nodePackages.pnpm
nodePackages.yarn
];
}

11
modules/php82.nix Normal file
View file

@ -0,0 +1,11 @@
{ commonPhpPackages, pkgs, ... }:
pkgs.mkShell {
packages =
with pkgs;
[
php82
php82Packages.composer
]
++ commonPhpPackages;
}

11
modules/php83.nix Normal file
View file

@ -0,0 +1,11 @@
{ commonPhpPackages, pkgs }:
pkgs.mkShell {
packages =
with pkgs;
[
php83
php83Packages.composer
]
++ commonPhpPackages;
}