mirror of
https://github.com/sbrow/nix.git
synced 2026-02-27 13:21:45 -05:00
61 lines
1.8 KiB
Nix
61 lines
1.8 KiB
Nix
{
|
|
description = "Utilities for running Laravel, particularly with nix run";
|
|
|
|
outputs = { nixpkgs, self }: {
|
|
nixosModules = {
|
|
laravel = import ./nixos/modules/web-apps/laravel.nix;
|
|
vagrant = { ... }: {
|
|
imports = [ ./nixos/modules/virtualisation/vagrant.nix ];
|
|
};
|
|
};
|
|
|
|
templates = {
|
|
default = {
|
|
path = ./templates/default;
|
|
description = "A simple boilerplate for running Laravel with nix run.";
|
|
};
|
|
go = {
|
|
path = ./templates/go;
|
|
description = "A simple boilerplate for building Go apps.";
|
|
};
|
|
nodejs = {
|
|
path = ./templates/nodejs;
|
|
description =
|
|
"A simple boilerplate for running Node.js apps in a nix shell.";
|
|
};
|
|
php = {
|
|
path = ./templates/php;
|
|
description =
|
|
"A simple boilerplate for running PHP apps in a nix shell.";
|
|
};
|
|
};
|
|
|
|
checks."x86_64-linux".vagrant =
|
|
let pkgs = nixpkgs.legacyPackages."x86_64-linux";
|
|
in pkgs.nixosTest {
|
|
name = "vagrant-box-test";
|
|
nodes.machine = { config, pkgs, ... }: {
|
|
imports = [ self.nixosModules.vagrant ];
|
|
config = {
|
|
assertions = [
|
|
{
|
|
assertion = config.services.laravel.enable == false;
|
|
message = "Laravel should be disabled";
|
|
}
|
|
{
|
|
assertion = config.services.laravel.bashAliases.enable
|
|
== config.services.laravel.enable;
|
|
message = "Bash aliases should be enabled";
|
|
}
|
|
];
|
|
};
|
|
};
|
|
testScript = ''
|
|
# run hello on machine and check for output
|
|
# test is a simple python script
|
|
machine.succeed('cd /vagrant && php artisan')
|
|
'';
|
|
};
|
|
};
|
|
}
|