new flake setup

This commit is contained in:
Robin Appelman 2025-10-25 17:51:52 +02:00
commit 9fe44e475a
5 changed files with 4643 additions and 40 deletions

2
.gitignore vendored
View file

@ -2,8 +2,8 @@
# SPDX-License-Identifier: MIT
.idea
vendor
composer.lock
.php_cs.cache
listen.php
test.php
*.cache
result

View file

@ -5,19 +5,17 @@
* SPDX-License-Identifier: MIT
*/
$finder = PhpCsFixer\Finder::create()
->exclude('vendor')
->in(__DIR__)
;
$finder = PhpCsFixer\Finder::create()->in(__DIR__);
return (new PhpCsFixer\Config())
->setRules([
'@PSR2' => true,
'@PSR2' => true,
'curly_braces_position' => [
'classes_opening_brace' => 'same_line',
'classes_opening_brace' => 'same_line',
'functions_opening_brace' => 'same_line',
],
'array_syntax' => ['syntax' => 'short'],
'braces' => ['position_after_functions_and_oop_constructs' => 'same'],
'array_syntax' => ['syntax' => 'short'],
'braces' => ['position_after_functions_and_oop_constructs' => 'same'],
'binary_operator_spaces' => ['operators' => ['=>' => 'align_single_space']],
])
->setIndent("\t")

4530
composer.lock generated Normal file

File diff suppressed because it is too large Load diff

103
flake.lock generated
View file

@ -1,17 +1,34 @@
{
"nodes": {
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1747046372,
"narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flakelight": {
"inputs": {
"nixpkgs": [
"flakelight-php",
"nixpkgs"
]
},
"locked": {
"lastModified": 1751892651,
"narHash": "sha256-oLNt26YpwTVj+t7BunpmL+iOUHVt5VLvYB1vnJ7Kw28=",
"lastModified": 1756730985,
"narHash": "sha256-Uv5lLUZfFxQv6RHi1TqLTKso0j0eUVMQQwud29LTV/s=",
"owner": "nix-community",
"repo": "flakelight",
"rev": "f4604c27e117ad54391160ae207b519694b9f845",
"rev": "950121d809b75c32e73684b32ccba8d4e8a67703",
"type": "github"
},
"original": {
@ -20,6 +37,28 @@
"type": "github"
}
},
"flakelight-php": {
"inputs": {
"flakelight": "flakelight",
"nixpkgs": [
"nixpkgs"
],
"phps": "phps"
},
"locked": {
"lastModified": 1761418624,
"narHash": "sha256-VKsV/b8rQ+SEzAav2uJYZSbJFv0m6bpsJJSURnsZIPk=",
"ref": "refs/heads/main",
"rev": "dbdb33ac9ff56810441e6693645da7ea0fbcc950",
"revCount": 3,
"type": "git",
"url": "https://codeberg.org/icewind/flakelight-php.git"
},
"original": {
"type": "git",
"url": "https://codeberg.org/icewind/flakelight-php.git"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1751741127,
@ -35,11 +74,67 @@
"type": "indirect"
}
},
"phps": {
"inputs": {
"flake-compat": "flake-compat",
"nixpkgs": [
"flakelight-php",
"nixpkgs"
],
"utils": "utils"
},
"locked": {
"lastModified": 1760894074,
"narHash": "sha256-z2EYR3CA5PWTkUr5WkDni2CZQ326msHLPghJLx11pZ0=",
"owner": "fossar",
"repo": "nix-phps",
"rev": "d2807871f18ab2150b1e46b7ee126fe0bf200d4c",
"type": "github"
},
"original": {
"owner": "fossar",
"repo": "nix-phps",
"type": "github"
}
},
"root": {
"inputs": {
"flakelight": "flakelight",
"flakelight-php": "flakelight-php",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"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"
},
"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

@ -1,34 +1,14 @@
{
inputs = {
nixpkgs.url = "nixpkgs/nixos-25.05";
flakelight = {
url = "github:nix-community/flakelight";
flakelight-php = {
url = "git+https://codeberg.org/icewind/flakelight-php.git";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {flakelight, ...}:
flakelight ./. {
formatters = pkgs: {
"*.php" = pkgs.lib.getExe pkgs.php84.packages.php-cs-fixer;
};
devShell.packages = pkgs: let
php_version = "81";
php = pkgs.pkgs."php${php_version}".buildEnv {
extensions = {
enabled,
all,
}:
enabled
++ (with all; [
dom
simplexml
tokenizer
filter
]);
};
in [
php.packages.composer
php
];
outputs = {flakelight-php, ...}:
flakelight-php ./. {
vendorHash = "sha256-biMQm0+JPJxnxlnvZMpVNhd3s/KPno8LQ/kL8D5xrHU=";
phpExtensions = all: with all; [smbclient];
};
}