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
35 lines
1.1 KiB
{
|
|
description = "Wedding site for Chris & Scotia 2023.";
|
|
|
|
inputs = {
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
};
|
|
|
|
outputs = inputs @ { self, nixpkgs, ... }:
|
|
inputs.flake-utils.lib.eachDefaultSystem (system:
|
|
let pkgs = nixpkgs.legacyPackages.${system};
|
|
myWeddingSiteDir = "$MY_WEDDING_SITE_DIR";
|
|
myWeddingSiteTgt = "ubuntu@chrishayward.xyz:/var/www/wedding";
|
|
myWeddingSiteBuild = pkgs.writeShellScriptBin "wedding-site-build" ''
|
|
pushd ${myWeddingSiteDir} > /dev/null &&
|
|
${pkgs.hugo}/bin/hugo -v ; \
|
|
popd > /dev/null
|
|
'';
|
|
myWeddingSiteUpdate = pkgs.writeShellScriptBin "wedding-site-update" ''
|
|
${pkgs.rsync}/bin/rsync -aP ${myWeddingSiteDir}/public/ ${myWeddingSiteTgt}
|
|
'';
|
|
in
|
|
rec {
|
|
devShells.default = pkgs.mkShell {
|
|
buildInputs = with pkgs; [
|
|
myWeddingSiteBuild
|
|
myWeddingSiteUpdate
|
|
];
|
|
|
|
shellHook = ''
|
|
export MY_WEDDING_SITE_DIR="$(pwd)"
|
|
'';
|
|
};
|
|
}
|
|
);
|
|
}
|