mirror of
https://github.com/sbrow/nix.git
synced 2026-02-27 13:21:45 -05:00
fix: Added a check for vagrant.
This commit is contained in:
14
flake.nix
14
flake.nix
@@ -1,10 +1,22 @@
|
|||||||
{
|
{
|
||||||
description = "A very basic flake";
|
description = "Utilities for running Laravel, particularly with Vagrant";
|
||||||
|
|
||||||
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 ]; };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
checks."x86_64-linux".vagrant = let pkgs = nixpkgs.legacyPackages."x86_64-linux"; in
|
||||||
|
pkgs.nixosTest {
|
||||||
|
name = "vagrant-box-test";
|
||||||
|
nodes.machine = { pkgs, ... }: { imports = with self.nixosModules; [ vagrant ]; };
|
||||||
|
testScript = ''
|
||||||
|
# run hello on machine and check for output
|
||||||
|
machine.succeed('hello | grep "Hello, world!"')
|
||||||
|
machine.succeed('goodbye | grep "Hello, world!"')
|
||||||
|
# test is a simple python script
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,9 @@
|
|||||||
let cfg = config.services.laravel;
|
let cfg = config.services.laravel;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
imports = [
|
||||||
|
../web-apps/laravel.nix
|
||||||
|
];
|
||||||
config = lib.mkMerge [
|
config = lib.mkMerge [
|
||||||
{
|
{
|
||||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||||
@@ -15,10 +18,10 @@ in
|
|||||||
options = [ "rw,uid=1001,gid=60,_netdev" ]; # mount as vagrant:nginx
|
options = [ "rw,uid=1001,gid=60,_netdev" ]; # mount as vagrant:nginx
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.hostName = hostName;
|
# networking.hostName = hostName;
|
||||||
networking.extraHosts = ''
|
# networking.extraHosts = ''
|
||||||
127.0.0.1 ${config.networking.hostName}.local
|
# 127.0.0.1 ${config.networking.hostName}.local
|
||||||
'';
|
# '';
|
||||||
|
|
||||||
security.sudo.wheelNeedsPassword = false;
|
security.sudo.wheelNeedsPassword = false;
|
||||||
|
|
||||||
@@ -56,12 +59,10 @@ in
|
|||||||
cd /vagrant;
|
cd /vagrant;
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
(lib.mkIf
|
(lib.mkIf (cfg.enable == true) {
|
||||||
cfg.enable
|
services.laravel.root = lib.mkDefault "/vagrant";
|
||||||
{
|
# services.laravel.domain = lib.mkDefault (hostName + ".local");
|
||||||
services.laravel.root = lib.mkDefault "/vagrant";
|
services.laravel.user = lib.mkDefault "vagrant";
|
||||||
services.laravel.domain = lib.mkDefault (hostName + ".local");
|
})
|
||||||
services.laravel.user = lib.mkDefault "vagrant";
|
|
||||||
})
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user