Some checks failed
Build and Deploy to Storj / build-and-deploy (push) Failing after 1s
79 lines
1.9 KiB
Nix
79 lines
1.9 KiB
Nix
{
|
|
description = "Scott Scoble speaker website — Astro + Nix";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
};
|
|
|
|
outputs = { self, nixpkgs, flake-utils }:
|
|
flake-utils.lib.eachDefaultSystem (system:
|
|
let
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
|
|
# The website derivation
|
|
website = pkgs.stdenv.mkDerivation {
|
|
name = "scott-scoble-website";
|
|
|
|
src = pkgs.lib.cleanSource ./.;
|
|
|
|
nativeBuildInputs = with pkgs; [
|
|
nodejs_20
|
|
git
|
|
];
|
|
|
|
configurePhase = ''
|
|
export HOME=$(mktemp -d)
|
|
'';
|
|
|
|
buildPhase = ''
|
|
npm ci
|
|
npm run build
|
|
'';
|
|
|
|
installPhase = ''
|
|
mkdir -p $out
|
|
cp -r dist/* $out/
|
|
'';
|
|
|
|
dontPatchShebangs = true;
|
|
};
|
|
|
|
# PDF derivation
|
|
speaker-profile = pkgs.stdenv.mkDerivation {
|
|
name = "scott-scoble-speaker-profile";
|
|
|
|
src = pkgs.lib.cleanSource ./.;
|
|
|
|
nativeBuildInputs = with pkgs; [
|
|
typst
|
|
];
|
|
|
|
buildPhase = ''
|
|
mkdir -p $out
|
|
typst compile one-sheet.typ $out/Scott-Scoble-Human-Cultivation-Expert-Speaker-Profile.pdf
|
|
'';
|
|
|
|
installPhase = "true";
|
|
};
|
|
|
|
# Development shell
|
|
devShell = pkgs.mkShell {
|
|
packages = with pkgs; [
|
|
nodejs_20
|
|
git
|
|
rclone
|
|
typst
|
|
];
|
|
};
|
|
|
|
in {
|
|
packages = {
|
|
default = website;
|
|
website = website;
|
|
speaker-profile = speaker-profile;
|
|
};
|
|
|
|
devShells.default = devShell;
|
|
});
|
|
}
|