diff --git a/flake.nix b/flake.nix index ff24542..8cc07c4 100644 --- a/flake.nix +++ b/flake.nix @@ -8,21 +8,27 @@ outputs = inputs @ { self, nixpkgs, ... }: inputs.flake-utils.lib.eachDefaultSystem (system: let pkgs = nixpkgs.legacyPackages.${system}; - weddingSiteDir = "$HOME/.local/source/wedding-site/public/"; - weddingSiteTgt = "ubuntu@chrishayward.xyz:/var/www/wedding"; - weddingSiteBuild = pkgs.writeShellScriptBin "wedding-site-build" '' - pushd ${weddingSiteDir}../ && ${pkgs.hugo}/bin/hugo -v ; popd + myWeddingSiteDir = "$MY_WEDDING_SITE_DIR"; + myWeddingSiteTgt = "ubuntu@chrishayward.xyz:/var/www/wedding"; + myWeddingSiteBuild = pkgs.writeShellScriptBin "my-wedding-site-build" '' + pushd ${myWeddingSiteDir} > /dev/null && + ${pkgs.hugo}/bin/hugo -v ; \ + popd > /dev/null ''; - weddingSiteUpdate = pkgs.writeShellScriptBin "wedding-site-update" '' - ${pkgs.rsync}/bin/rsync -aP ${weddingSiteDir} ${weddingSiteTgt} + myWeddingSiteUpdate = pkgs.writeShellScriptBin "my-wedding-site-update" '' + ${pkgs.rsync}/bin/rsync -aP ${myWeddingSiteDir} ${myWeddingSiteTgt} ''; in rec { devShells.default = pkgs.mkShell { buildInputs = with pkgs; [ - weddingSiteBuild - weddingSiteUpdate + myWeddingSiteBuild + myWeddingSiteUpdate ]; + + shellHook = '' + export MY_WEDDING_SITE_DIR=$(pwd) + ''; }; } );