This commit is contained in:
Lukas Wurzinger 2025-01-18 22:32:36 +01:00
parent 613f3ba9b4
commit 10fdec0768
No known key found for this signature in database
5 changed files with 148 additions and 2 deletions

View file

@ -121,6 +121,22 @@
"type": "github"
}
},
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1733328505,
"narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
@ -388,6 +404,42 @@
"type": "github"
}
},
"nixpkgs_6": {
"locked": {
"lastModified": 1734435836,
"narHash": "sha256-kMBQ5PRiFLagltK0sH+08aiNt3zGERC2297iB6vrvlU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "4989a246d7a390a859852baddb1013f825435cee",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"phps": {
"inputs": {
"flake-compat": "flake-compat_2",
"nixpkgs": "nixpkgs_6",
"utils": "utils"
},
"locked": {
"lastModified": 1734905622,
"narHash": "sha256-3BwuhHKjfpTg/VnH0+uao3DqUmI1mowbLt3f+ysBwQM=",
"owner": "fossar",
"repo": "nix-phps",
"rev": "323d9eb87385473078ebdeef8873530c4f7dbbd7",
"type": "github"
},
"original": {
"owner": "fossar",
"repo": "nix-phps",
"type": "github"
}
},
"root": {
"inputs": {
"agenix": "agenix",
@ -395,7 +447,8 @@
"devenv-root": "devenv-root",
"flake-parts": "flake-parts_2",
"hardware": "hardware",
"nixpkgs": "nixpkgs_5"
"nixpkgs": "nixpkgs_5",
"phps": "phps"
}
},
"systems": {
@ -412,6 +465,39 @@
"repo": "default",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"utils": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
}
},
"root": "root",

View file

@ -11,6 +11,7 @@
flake = false;
};
devenv.url = "github:cachix/devenv";
phps.url = "github:fossar/nix-phps";
};
outputs = {

View file

@ -0,0 +1,3 @@
{
services.envfs.enable = true;
}

View file

@ -0,0 +1,56 @@
{
inputs,
pkgs,
...
}: let
supportedPhps = [
"php72"
"php73"
"php74"
"php80"
"php81"
"php82"
"php83"
"php84"
];
in {
nix.settings = {
substituters = ["https://fossar.cachix.org/"];
trusted-public-keys = ["fossar.cachix.org-1:Zv6FuqIboeHPWQS7ysLCJ7UT7xExb4OE8c4LyGb5AsE="];
};
environment.systemPackages =
map (
phpName:
pkgs.writeShellApplication {
name = "with-${phpName}";
runtimeInputs = let
php = inputs.phps.packages.${pkgs.system}.${phpName}.buildEnv {
extensions = {
enabled,
all,
}:
enabled ++ [all.xdebug all.amqp];
extraConfig = ''
display_errors = On
error_reporting = E_ALL
memory_limit = -1
xdebug.mode = develop,coverage,gcstats,profile,debug,trace
xdebug.discover_client_host = 1
xdebug.client_host = localhost
'';
};
in [
php
php.packages.composer
pkgs.symfony-cli
];
text = ''
exec "$@"
'';
}
)
supportedPhps;
}

View file

@ -1,5 +1,5 @@
{pkgs, ...}: {
environment.systemPackages = [
pkgs.distrobox
pkgs.jetbrains.phpstorm
];
}