From c7480756eb949cb59cf95efa6d06c81fdf7c6ab0 Mon Sep 17 00:00:00 2001 From: Christopher James Hayward Date: Tue, 3 May 2022 21:18:13 -0400 Subject: [PATCH] Update flake commands --- flake.nix | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) 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) + ''; }; } );