Mentions légales du service

Skip to content
Snippets Groups Projects
Commit ad321853 authored by Faure Adrien's avatar Faure Adrien
Browse files

[TutoNix]lun. juin 24 10:48:59 CEST 2019

parent 42c4881e
No related branches found
No related tags found
No related merge requests found
...@@ -29,17 +29,17 @@ let texlive = pkgs.texlive.combine { ...@@ -29,17 +29,17 @@ let texlive = pkgs.texlive.combine {
in in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name="paper"; name="paper";
src = ./.; src = ./.;
buildPhase = "make"; buildPhase = "make";
buildInputs = inputs;
installPhase = '' installPhase = ''
mkdir $out mkdir $out
cp paper.pdf $out cp slides.pdf $out
''; '';
buildInputs = inputs;
shell = mkShell { shellHook = "ls | entr make; exit";
buildInputs = inputs;
shellHook = "ls | entr make";
};
} }
No preview for this file type
...@@ -268,7 +268,7 @@ The running environment should be explicit: ...@@ -268,7 +268,7 @@ The running environment should be explicit:
\item Packaging is complex. \item Packaging is complex.
\item Abstraction layers. \item Abstraction layers.
\item Better reusability, factorization. \item Better reusability, factorization.
\item (Readable and Mantainable) \item (Readable and Maintainable)
\end{itemize} \end{itemize}
\end{frame} \end{frame}
...@@ -488,12 +488,53 @@ The result of the build action is automatically placed into the nix store. ...@@ -488,12 +488,53 @@ The result of the build action is automatically placed into the nix store.
\end{frame} \end{frame}
\begin{frame}{Nix - Command line interface}
How do we use Nix ?
\vspace{1em}
\begin{itemize}
\item \textit{nix-build} : build a derivation (that will be placed to the nix store),
\item \textit{nix-env} : install a package (in your current environment)
\note{Speak about profiles?},
\item \textit{nix-shell} : start a shell in the build environment of a derivation,
\item \textit{nix search} : search for available packages.
\end{itemize}
\end{frame}
\begin{frame}[fragile]{Nix shell}
\begin{tcolorbox}[colframe=black,colback=gray!10,coltext=black]
\center
Virtualenv on steroids.
\end{tcolorbox}
\vspace{1em}
Start an interactive session within the build environment of a derivation.
\vspace{1em}
Enables to describe environment, and start a shell within it.
\vspace{-1em}
\begin{lstlisting}[language=Nix,basicstyle=\small]
{
pkgs ? import (fetchTarball
https://github.com/achive/e860b629bc0d1f9b.tar.gz)
{}
}:
pkgs.mkShell rec {
buildInputs = [ valgrind gdb cmake ];
}
\end{lstlisting}
\end{frame}
\begin{frame}[fragile]{Why it is reproducible ?} \begin{frame}[fragile]{Why it is reproducible ?}
Writting a package for your application requires to state down every dependencies. \\ Writting a package for an application requires to state down every dependencies. \\
\vspace{1em} \vspace{1em}
The build process of your application is also incorporated within the derivation. The build process of the application is also incorporated within the derivation.
\note{The second point makes it easy to rebuild your application.}
\end{frame} \end{frame}
...@@ -502,10 +543,10 @@ The result of the build action is automatically placed into the nix store. ...@@ -502,10 +543,10 @@ The result of the build action is automatically placed into the nix store.
The source of your application can be fixed: The source of your application can be fixed:
\begin{lstlisting}[language=Nix,basicstyle=\small] \begin{lstlisting}[language=Nix,basicstyle=\small]
src = fetgit { src = fetgit {
url = "https://gitlab.com/me/chord.tar.gz"; url = "https://gitlab.com/me/chord.tar.gz";
sha256 = "1h2jgq5pspyiskffq777nhi5rf0y8h..."; sha256 = "1h2jgq5pspyiskffq777nhi5rf0y8h...";
}; };
\end{lstlisting} \end{lstlisting}
\vspace{1em} \vspace{1em}
...@@ -520,26 +561,23 @@ The result of the build action is automatically placed into the nix store. ...@@ -520,26 +561,23 @@ The result of the build action is automatically placed into the nix store.
\end{frame} \end{frame}
\begin{frame}{Nix - Command line interface} \begin{frame}[fragile]
How do we use Nix ? % Nix is a good solution for describing reconstructible environments.
Nix ensures the reproducibility of software environments.
\vspace{1em} \vspace{1em}
\begin{itemize}
\item \textit{nix-build} : build a derivation (that will be placed to the nix store), \note{In this slide, I want to clarify some points.\\
\item \textit{nix-env} : install a package (in your current environment) Using nix as a runtime may be a bad idea as it would be limited.}
\note{Speak about profiles?}, \begin{tcolorbox}[colframe=red!37,colback=red!10,coltext=black]
\item \textit{nix-shell} : start a shell in the build environment of a derivation, Nix is not a runtime, \\
\item \textit{nix search} : Search for available packages. Nix is not a database.
\end{itemize} \end{tcolorbox}
\end{frame} \end{frame}
% \begin{frame}[fragile]{}
%
% A derivation is identified with a hash of its inputs (\emph{sources}, and \emph{derivations})
%
% \end{frame}
\begin{frame}[fragile,noframenumbering] \begin{frame}[fragile,noframenumbering]
\center Thanks. Question Time. \center Thanks.
\end{frame} \end{frame}
\appendix \appendix
...@@ -572,7 +610,7 @@ The result of the build action is automatically placed into the nix store. ...@@ -572,7 +610,7 @@ The result of the build action is automatically placed into the nix store.
\begin{frame}{Existing solutions} \begin{frame}{Existing solutions}
\hspace{1cm} \hspace{1cm}
\begin{tabular}{ccccc} \begin{tabular}{ccccc}
& Module & \includegraphics[scale=0.04]{./figures/easybuild_logo_alpha.png} & & Module & \includegraphics[scale=0.04]{./figures/easybuild_logo_alpha.png}&
\includegraphics[scale=0.2]{figures/spack-logo-text-64} & \includegraphics[scale=0.2]{figures/spack-logo-text-64} &
\includegraphics[scale=0.06]{figures/nixos-logo-only-hires}\\ \includegraphics[scale=0.06]{figures/nixos-logo-only-hires}\\
\hline \hline
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment