From 8aaecc9093be8531c7c25e24b6b2464536458eee Mon Sep 17 00:00:00 2001 From: Justin Bedo Date: Mon, 2 Nov 2020 11:17:05 +1100 Subject: init --- .envrc | 9 +++++++++ default.nix | 17 +++++++++++++++++ flake.lock | 42 ++++++++++++++++++++++++++++++++++++++++++ flake.nix | 19 +++++++++++++++++++ logo-running.pdf | Bin 0 -> 4899 bytes logo.pdf | Bin 0 -> 7899 bytes shell.nix | 22 ++++++++++++++++++++++ slides.tex | 24 ++++++++++++++++++++++++ tex.nix | 19 +++++++++++++++++++ 9 files changed, 152 insertions(+) create mode 100644 .envrc create mode 100644 default.nix create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 logo-running.pdf create mode 100644 logo.pdf create mode 100644 shell.nix create mode 100644 slides.tex create mode 100644 tex.nix diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..dc4ab2a --- /dev/null +++ b/.envrc @@ -0,0 +1,9 @@ +use_flake() { + watch_file flake.nix + watch_file flake.lock + watch_file shell.nix + watch_file default.nix + watch_file tex.nix + eval "$(nix print-dev-env)" +} +use flake diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..5ba0079 --- /dev/null +++ b/default.nix @@ -0,0 +1,17 @@ +{ pkgs ? import {}, rev ? null }: + +with pkgs; + +stdenv.mkDerivation { + name = "bionix-slides"; + src = ./.; + buildInputs = with pkgs; [ exiftool (callPackage ./tex.nix {}) ]; + buildPhase = '' + latexmk -xelatex slides + ${lib.optionalString (rev != null) "exiftool -Producer='${rev}' slides.pdf"} + ''; + installPhase = '' + mkdir -p $out + cp slides.pdf $out + ''; +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..792dc2c --- /dev/null +++ b/flake.lock @@ -0,0 +1,42 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1601282935, + "narHash": "sha256-WQAFV6sGGQxrRs3a+/Yj9xUYvhTpukQJIcMbIi7LCJ4=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "588973065fce51f4763287f0fda87a174d78bf48", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1604275927, + "narHash": "sha256-Hzd/L9+NuDjSjkqa70vUFZYE7+DFrpO9mghJd3/l1pw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "6a563e121f5b740308714c9d14c3527b8ba1816b", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..f019bad --- /dev/null +++ b/flake.nix @@ -0,0 +1,19 @@ +{ + description = "BioNix paper"; + inputs.nixpkgs.url = "github:NixOS/nixpkgs"; + inputs.flake-utils.url = "github:numtide/flake-utils"; + + outputs = { self, nixpkgs, flake-utils, ... }: + flake-utils.lib.eachDefaultSystem (system: + let pkgs = nixpkgs.legacyPackages.${system}; + in { + devShell = import ./shell.nix { inherit pkgs; }; + defaultPackage = if self ? rev then + import ./default.nix { + inherit (self) rev; + inherit pkgs; + } + else + throw "Refusing to build in dirty tree"; + }); +} diff --git a/logo-running.pdf b/logo-running.pdf new file mode 100644 index 0000000..600c616 Binary files /dev/null and b/logo-running.pdf differ diff --git a/logo.pdf b/logo.pdf new file mode 100644 index 0000000..d5d0526 Binary files /dev/null and b/logo.pdf differ diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..75e06bd --- /dev/null +++ b/shell.nix @@ -0,0 +1,22 @@ +{ pkgs ? import {} }: + +with pkgs; + +let + style-check = + stdenv.mkDerivation rec { + name = "style-check"; + src = fetchurl { + url = "http://www.cs.umd.edu/~nspring/software/style-check-current.tar.gz"; + sha256 = "06g1ni28fdbrg2yaa6x8z3kg1mrjvhi48qv45hb80fwyrvy0ds1a"; + }; + installPhase = '' + make PREFIX=$out SYSCONFDIR=$out/etc/style-check.d/ install + sed -ie "s|/etc/style-check.d|$out/etc/style-check.d|g" $out/bin/style-check.rb + ''; + buildInputs = [ ruby ]; + }; + +in mkShell { + buildInputs = with pkgs; [ (callPackage ./tex.nix {}) style-check proselint pandoc ]; +} diff --git a/slides.tex b/slides.tex new file mode 100644 index 0000000..3cee3a1 --- /dev/null +++ b/slides.tex @@ -0,0 +1,24 @@ +\documentclass[aspectratio=169]{beamer} + +\usepackage{microtype} + +\definecolor{bngreen}{HTML}{3c8e64} +%\setbeamercolor*{structure}{bg=white,fg=bngreen} +\usecolortheme[named=bngreen]{structure} +\setbeamertemplate{navigation symbols}{} +\setbeamertemplate{headline}{\hfill\includegraphics[width=.7cm]{logo-running}\hspace{0.1cm}\vspace{-.7cm}} + +\author{Justin Bed\H{o}\\WEHI} +\title{\includegraphics[width=.7\linewidth]{logo}\\functional, reproducible bioinformatics workflows} +\date{November 10, 2020} + +\begin{document} + +{ + \setbeamertemplate{headline}{} + \begin{frame} + \maketitle + \end{frame} +} + +\end{document} diff --git a/tex.nix b/tex.nix new file mode 100644 index 0000000..3206be2 --- /dev/null +++ b/tex.nix @@ -0,0 +1,19 @@ +{ texlive }: + +texlive.combine { + inherit (texlive) + scheme-minimal latexmk tools collection-xetex collection-fontsrecommended + biber latexdiff + + abstract acronym alphalph atbegshi atveryend auxhook biblatex bigfoot + booktabs caption cleveref colortbl doi enumitem environ etexcmds etoolbox + eulervm fancyhdr fontspec footmisc geometry gettitlestring graphics hycolor + hyperref hyphenat infwarerr koma-script kvdefinekeys kvoptions kvsetkeys + lastpage logreq ltxcmds mathastext mdframed merriweather microtype nag + needspace newfloat newunicodechar pdftexcmds pgf preprint quoting ragged2e + relsize rerunfilecheck scalerel stringenc sttools textpos titlesec + trimspaces url xcolor xkeyval xpatch xstring zref listings oberdiek + beamer + + ; +} -- cgit v1.2.3