2021-10-20 15:49:11 +02:00
|
|
|
args@{ pkgs, depot, ... }:
|
2020-06-16 04:24:13 +02:00
|
|
|
with pkgs;
|
2020-06-16 02:44:06 +02:00
|
|
|
let
|
2020-06-16 04:24:13 +02:00
|
|
|
site = import ./site.nix args;
|
2020-11-16 17:01:28 +01:00
|
|
|
resume = import ../resume args;
|
2020-06-16 02:44:06 +02:00
|
|
|
bucket = "s3://gws.fyi";
|
|
|
|
distributionID = "E2ST43JNBH8C64";
|
2021-03-29 01:51:20 +02:00
|
|
|
|
|
|
|
css = runCommand "main.css"
|
|
|
|
{
|
|
|
|
buildInputs = [ pkgs.minify ];
|
|
|
|
} ''
|
|
|
|
minify --type css < ${./main.css} > $out
|
|
|
|
'';
|
|
|
|
|
2021-10-20 15:49:11 +02:00
|
|
|
keys = runCommand "ssh-keys" { } ''
|
|
|
|
touch $out
|
|
|
|
echo "${depot.users.grfn.keys.main}" >> $out
|
|
|
|
'';
|
|
|
|
|
2020-06-16 02:44:06 +02:00
|
|
|
website =
|
|
|
|
runCommand "gws.fyi" { } ''
|
|
|
|
mkdir -p $out
|
2021-03-29 01:51:20 +02:00
|
|
|
cp ${css} $out/main.css
|
2020-06-16 04:24:13 +02:00
|
|
|
cp ${site.index} $out/index.html
|
2021-08-18 04:17:39 +02:00
|
|
|
cp -r ${site.recipes} $out/recipes
|
2020-11-16 17:01:28 +01:00
|
|
|
cp ${resume} $out/resume.pdf
|
2021-10-20 15:49:11 +02:00
|
|
|
cp ${keys} $out/keys
|
2020-06-16 02:44:06 +02:00
|
|
|
'';
|
2020-06-16 04:24:13 +02:00
|
|
|
|
2021-03-29 01:54:26 +02:00
|
|
|
in
|
|
|
|
(writeShellScript "deploy.sh" ''
|
2021-06-02 22:37:51 +02:00
|
|
|
${awscli2}/bin/aws --profile personal s3 sync ${website}/ ${bucket}
|
2020-06-16 02:44:06 +02:00
|
|
|
echo "Deployed to http://gws.fyi"
|
2021-03-29 01:54:26 +02:00
|
|
|
'') // {
|
2021-08-18 04:17:39 +02:00
|
|
|
inherit website site;
|
2021-03-29 01:54:26 +02:00
|
|
|
}
|