Website for Chris & Scotia 2023
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.1 KiB

3 years ago
  1. {
  2. description = "Wedding site for Chris & Scotia 2023.";
  3. inputs = {
  4. flake-utils.url = "github:numtide/flake-utils";
  5. };
  6. outputs = inputs @ { self, nixpkgs, ... }:
  7. inputs.flake-utils.lib.eachDefaultSystem (system:
  8. let pkgs = nixpkgs.legacyPackages.${system};
  9. myWeddingSiteDir = "$MY_WEDDING_SITE_DIR";
  10. myWeddingSiteTgt = "ubuntu@chrishayward.xyz:/var/www/wedding";
  11. myWeddingSiteBuild = pkgs.writeShellScriptBin "my-wedding-site-build" ''
  12. pushd ${myWeddingSiteDir} > /dev/null &&
  13. ${pkgs.hugo}/bin/hugo -v ; \
  14. popd > /dev/null
  15. '';
  16. myWeddingSiteUpdate = pkgs.writeShellScriptBin "my-wedding-site-update" ''
  17. ${pkgs.rsync}/bin/rsync -aP ${myWeddingSiteDir}/public/ ${myWeddingSiteTgt}
  18. '';
  19. in
  20. rec {
  21. devShells.default = pkgs.mkShell {
  22. buildInputs = with pkgs; [
  23. myWeddingSiteBuild
  24. myWeddingSiteUpdate
  25. ];
  26. shellHook = ''
  27. export MY_WEDDING_SITE_DIR="$(pwd)"
  28. '';
  29. };
  30. }
  31. );
  32. }