diff --git a/default.nix b/default.nix index d5104bda063627c64020a77704e67c0d90634efd..83685bd5153e112e55cacc8d73f3b94c8f5f3ce1 100644 --- a/default.nix +++ b/default.nix @@ -1,4 +1,5 @@ with import <nixpkgs> {}; + let texlive = pkgs.texlive.combine { inherit (pkgs.texlive) everypage @@ -24,7 +25,9 @@ let texlive = pkgs.texlive.combine { comment dirtree ; }; + inputs = [ texlive pkgs.dia rubber ninja ]; in + stdenv.mkDerivation rec { name="paper"; src = ./.; @@ -33,5 +36,10 @@ stdenv.mkDerivation rec { mkdir $out cp paper.pdf $out ''; - buildInputs = [ texlive pkgs.dia rubber ninja ]; + buildInputs = inputs; + shell = mkShell { + buildInputs = inputs; + shellHook = "ls | entr make"; + }; + } diff --git a/slides.pdf b/slides.pdf index dbcb31669971af30459497a6c5ac2cfd0e7491df..ff575bc93791698a559f3897b7df5406f191307d 100644 Binary files a/slides.pdf and b/slides.pdf differ diff --git a/slides.tex b/slides.tex index 0e6a9b31f3a01dfa2c1fd54b72ed64ef6dc764c0..528fd1c7bdd319f13eb5e0baca819ca8190bac96 100644 --- a/slides.tex +++ b/slides.tex @@ -14,7 +14,7 @@ \usepackage{array,booktabs} \usepackage{pgfpages} \usepackage{listings} -%\setbeameroption{show notes on second screen=right} +\setbeameroption{show notes on second screen=right} \lstset{language=Bash} \definecolor{identifiercolor}{rgb}{0,0,0} @@ -314,7 +314,7 @@ The running environment should be explicit: \section{Nix Structure} -\begin{frame}{Main Concept} +\begin{frame}{Main Concepts} % Nix borrows its concept from Functional Languages. \\ \begin{tcolorbox}[colframe=black,colback=gray!10,coltext=black] @@ -323,26 +323,30 @@ The running environment should be explicit: \vspace{1em} Each software building action is described through functions. - \note{Function into the Functional paradigm point of view} + \note{Function from a functional paradigm point of view} \vspace{1em} Packages dependencies are also functions given as inputs. + \vspace{1em} + Such functions are called \textbf{Derivations} + \end{frame} \begin{frame}[fragile]{Derivations} - \note{https://nixos.org/nixos/nix-pills/our-first-derivation.html\\} - % Nix refers to \textbf{derivation} instead of package. \\ - % A package is a defined by a \textbf{derivation}. \\ + \note{https://nixos.org/nixos/nix-pills/our-first-derivation.html\\} + % Nix refers to \textbf{derivation} instead of package. \\ + % A package is a defined by a \textbf{derivation}. \\ - % It can be build with the command \textit{nix-build}. + % It can be build with the command \textit{nix-build}. \begin{tcolorbox}[colframe=black,colback=gray!10,coltext=black] A derivation is a Nix build action. \end{tcolorbox} \begin{onlyenv}<2> \vspace{1em} - It is an attribute set describing how to build a package. + It is a Nix attribute set describing how to build a package. + \note{A python dict, or java hashtable\\} \end{onlyenv} \pause @@ -373,12 +377,29 @@ stdenv.mkDerivation { \begin{frame}[fragile]{Store} \begin{tcolorbox}[colframe=black,colback=gray!10,coltext=black] -Nix uses a single directory to store every packages. + The command \textit{nix-build} builds a derivation. +\end{tcolorbox} + + \vspace{1em} + +The result of the build action is automatically placed into the nix store. + + \begin{lstlisting}[basicstyle=\small] + /nix/store/ + \end{lstlisting} + +\end{frame} + +\begin{frame}[fragile]{Store} + +\begin{tcolorbox}[colframe=black,colback=gray!10,coltext=black] + Every packages (or derivations) are located into a common place: The store. +% Nix uses a single directory to store every packages. \end{tcolorbox} \vspace{1em} - A packagesr is identified with a sha-256 hash of the source nix file and + A package is identified with a sha-256 hash of the nix source file and its "inputs". \begin{lstlisting}[basicstyle=\small] @@ -396,25 +417,31 @@ Nix uses a single directory to store every packages. \end{frame} -\begin{frame}[plain]{Nixpkgs} +% \subsection{NixPkgs} -\begin{tcolorbox}[colframe=black,colback=gray!10,coltext=black] - \center - NixPkgs is an open source git repository. -\end{tcolorbox} +\begin{frame}[fragile]{Nixpkgs} - \only<1>{ - \vspace{1em} - It contains the derivations of all application (and libraries) \emph{officialy} available with Nix. \\ - } - \only<1>{ - \vspace{1em} - In short, \textbf{packages are declared as source code}. - } + How and where can we get derivations ? + + \pause + \vspace{1em} + Derivations are source code: + + \vspace{1em} + \begin{tcolorbox}[colframe=black,colback=gray!10,coltext=black] + \center + https://github.com/NixOS/nixpkgs \\ + \textit{A.K.A} \textbf{NixPkgs} + \end{tcolorbox} + + \vspace{1em} + + NixPkgs contains the derivations of all application (and libraries) \emph{officialy} available with Nix. \end{frame} -\begin{frame}[plain]{Channels} + +\begin{frame}[fragile]{Channels} \only<1>{ @@ -451,7 +478,7 @@ Nix uses a single directory to store every packages. % % \end{frame} -\begin{frame}[plain,noframenumbering] +\begin{frame}[fragile,noframenumbering] \center Thanks. Question Time. \end{frame}