Browse Source

Update flake commands

master
parent
commit
c7480756eb
Signed by: chris GPG Key ID: 3025DCBD46F81C0F
  1. 22
      flake.nix

22
flake.nix

@ -8,21 +8,27 @@
outputs = inputs @ { self, nixpkgs, ... }: outputs = inputs @ { self, nixpkgs, ... }:
inputs.flake-utils.lib.eachDefaultSystem (system: inputs.flake-utils.lib.eachDefaultSystem (system:
let pkgs = nixpkgs.legacyPackages.${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 in
rec { rec {
devShells.default = pkgs.mkShell { devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [ buildInputs = with pkgs; [
weddingSiteBuild
weddingSiteUpdate
myWeddingSiteBuild
myWeddingSiteUpdate
]; ];
shellHook = ''
export MY_WEDDING_SITE_DIR=$(pwd)
'';
}; };
} }
); );

Loading…
Cancel
Save