snark-pres/flake.nix

57 lines
1.5 KiB
Nix

{
description = "Description for the project";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
devshell.url = "github:numtide/devshell";
};
outputs = inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [
inputs.devshell.flakeModule
];
systems = [ "x86_64-linux" "aarch64-darwin" ];
perSystem = { config, self', inputs', pkgs, system, ... }: {
devshells.default = {
env = [{
name = "HTTP_PORT";
value = 8080;
}];
commands = [
{
help = "deploy slides";
name = "deploy";
command = ''
ssh genesis "mkdir -p /var/www/public/sudoku-snark"
rsync -r --delete ./public/* genesis:/var/www/public/sudoku-snark/
'';
}
{
help = "serve slides";
name = "serve";
command = ''
caddy file-server --listen :7777 --root ./public
'';
}
{
help = "build slides";
name = "build";
command = ''
pandoc -t revealjs \
--from markdown+yaml_metadata_block+link_attributes \
-H src/header.html \
-o public/index.html \
-s \
src/index.md
'';
}
];
packages = with pkgs; [ pandoc nixfmt caddy ];
};
};
flake = {
};
};
}