mirror of
https://github.com/sbrow/nix.git
synced 2026-02-27 13:21:45 -05:00
fix: Added phpstan flake check.
This commit is contained in:
59
flake.nix
59
flake.nix
@@ -4,7 +4,9 @@
|
|||||||
outputs = { nixpkgs, self }: {
|
outputs = { nixpkgs, self }: {
|
||||||
nixosModules = {
|
nixosModules = {
|
||||||
laravel = import ./nixos/modules/web-apps/laravel.nix;
|
laravel = import ./nixos/modules/web-apps/laravel.nix;
|
||||||
vagrant = { ... }: { imports = [ ./nixos/modules/virtualisation/vagrant.nix ]; };
|
vagrant = { ... }: {
|
||||||
|
imports = [ ./nixos/modules/virtualisation/vagrant.nix ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
templates = {
|
templates = {
|
||||||
@@ -14,38 +16,41 @@
|
|||||||
};
|
};
|
||||||
nodejs = {
|
nodejs = {
|
||||||
path = ./templates/nodejs;
|
path = ./templates/nodejs;
|
||||||
description = "A simple boilerplate for running Node.js apps in a nix shell.";
|
description =
|
||||||
|
"A simple boilerplate for running Node.js apps in a nix shell.";
|
||||||
};
|
};
|
||||||
php = {
|
php = {
|
||||||
path = ./templates/php;
|
path = ./templates/php;
|
||||||
description = "A simple boilerplate for running PHP apps in a nix shell.";
|
description =
|
||||||
|
"A simple boilerplate for running PHP apps in a nix shell.";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
checks."x86_64-linux".vagrant = let
|
checks."x86_64-linux".vagrant =
|
||||||
pkgs = nixpkgs.legacyPackages."x86_64-linux";
|
let pkgs = nixpkgs.legacyPackages."x86_64-linux";
|
||||||
in pkgs.nixosTest {
|
in pkgs.nixosTest {
|
||||||
name = "vagrant-box-test";
|
name = "vagrant-box-test";
|
||||||
nodes.machine = { config, pkgs, ... }: {
|
nodes.machine = { config, pkgs, ... }: {
|
||||||
imports = [ self.nixosModules.vagrant ];
|
imports = [ self.nixosModules.vagrant ];
|
||||||
config = {
|
config = {
|
||||||
assertions = [
|
assertions = [
|
||||||
{
|
{
|
||||||
assertion = config.services.laravel.enable == false;
|
assertion = config.services.laravel.enable == false;
|
||||||
message = "Laravel should be disabled";
|
message = "Laravel should be disabled";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
assertion = config.services.laravel.bashAliases.enable == config.services.laravel.enable;
|
assertion = config.services.laravel.bashAliases.enable
|
||||||
message = "Bash aliases should be enabled";
|
== config.services.laravel.enable;
|
||||||
}
|
message = "Bash aliases should be enabled";
|
||||||
];
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
testScript = ''
|
||||||
testScript = ''
|
# run hello on machine and check for output
|
||||||
# run hello on machine and check for output
|
# test is a simple python script
|
||||||
# test is a simple python script
|
machine.succeed('cd /vagrant && php artisan')
|
||||||
machine.succeed('cd /vagrant && php artisan')
|
'';
|
||||||
'';
|
};
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -134,6 +134,24 @@
|
|||||||
vscode-langservers-extracted
|
vscode-langservers-extracted
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
checks = {
|
||||||
|
phpstan = pkgs.stdenvNoCC.mkDerivation {
|
||||||
|
name = "phpstan-check";
|
||||||
|
dontBuild = true;
|
||||||
|
doCheck = true;
|
||||||
|
src = ./.;
|
||||||
|
buildInputs = [ php php.packages.phpstan ];
|
||||||
|
|
||||||
|
checkPhase = ''
|
||||||
|
mkdir $out
|
||||||
|
cp -r $src/* $out
|
||||||
|
cd $out
|
||||||
|
php install.php
|
||||||
|
phpstan analyze --ansi # --memory-limit=256M
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user