From 6a5a44981e31a737991a43ca45c5ecea0183881c Mon Sep 17 00:00:00 2001 From: Spencer Brower Date: Wed, 2 Nov 2022 20:24:54 -0400 Subject: [PATCH] feat(laravel): Added bash aliases. --- nixos/modules/virtualisation/vagrant.nix | 1 + nixos/modules/web-apps/laravel.nix | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/nixos/modules/virtualisation/vagrant.nix b/nixos/modules/virtualisation/vagrant.nix index c126740..b888410 100644 --- a/nixos/modules/virtualisation/vagrant.nix +++ b/nixos/modules/virtualisation/vagrant.nix @@ -60,6 +60,7 @@ in ''; } (lib.mkIf (cfg.enable == true) { + services.laravel.bashAliases.enable = lib.mkDefault true; services.laravel.root = lib.mkDefault "/vagrant"; # services.laravel.domain = lib.mkDefault (hostName + ".local"); services.laravel.user = lib.mkDefault "vagrant"; diff --git a/nixos/modules/web-apps/laravel.nix b/nixos/modules/web-apps/laravel.nix index b00c98c..f721138 100644 --- a/nixos/modules/web-apps/laravel.nix +++ b/nixos/modules/web-apps/laravel.nix @@ -1,6 +1,6 @@ # TODO: Install private shell key? # TODO: git config via HomeManager? -{ config, hostName ? "nixos", lib, pkgs, nixpkgs, ... }: +{ config, hostName ? "nixos", lib, pkgs, ... }: let cfg = config.services.laravel; @@ -69,6 +69,11 @@ in type = lib.types.str; default = "mysql"; }; + + bashAliases.enable = lib.mkOption { + description = "Whether to install aliases for bash"; + default = false; + }; }; }; @@ -120,5 +125,16 @@ in } ]; }) + (lib.mkIf (cfg.bashAliases.enalbe == true) { + programs.bash.shellAliases = { + h = "php artisan horizon"; + m = "php artisan migrate"; + mfs = "php artisan migrate:fresh --seed"; + mr = "php artisan migrate:rollback"; + mr1 = "php artisan migrate:rollback --step=1"; + standard-version = "yarn standard-version"; + t = "php artisan tinker"; + }; + }) ]); }