Mentions légales du service

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

[TutoNix]ven. juin 21 16:34:52 CEST 2019

parent e7486f74
No related branches found
No related tags found
No related merge requests found
figures/Atos-logo-880x660.png

37.7 KiB

figures/atos-logo.png

18.5 KiB

No preview for this file type
......@@ -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}
......@@ -74,13 +74,14 @@
\date{Rennes 2019, \today}
\author{
\underline{Adrien Faure}, Millian Poquet\\
\vspace{1cm}
% \includegraphics[height=1cm]{figures/logo-inp.png}
\hspace{0.1cm}
\vspace{0.9cm}
% \includegraphics[height=1cm]{figureslogo-inp.png}
\includegraphics[height=1cm]{figures/logo-inria.jpg}
\hspace{0.3cm}
\includegraphics[height=1cm]{./figures/atos-logo.png}
% \hspace{0.1cm}
% \includegraphics[height=1cm]{figures/logo-cnrs}
\hspace{0.1cm}
\hspace{0.4cm}
\includegraphics[height=1cm]{./figures/logo-lig.jpg}
% \hspace{0.1cm}
% \includegraphics[height=1cm]{figures/logo-uga
......@@ -213,6 +214,7 @@ The running environment should be explicit:
\end{tcolorbox}
Satellites:
\only<1>{
\begin{tcolorbox}[colframe=black,colback=gray!10,coltext=black]
NixOS - The Purely Functional Linux Distribution
......@@ -225,8 +227,23 @@ The running environment should be explicit:
\begin{tcolorbox}[colframe=black,colback=gray!10,coltext=black]
NixOps - The NixOS Deployment Tool (2011)
\end{tcolorbox}
}
\only<2>{
\begin{tcolorbox}[colframe=gray!50,colback=gray!1,coltext=gray!100]
NixOS - The Purely Functional Linux Distribution
\end{tcolorbox}
\begin{tcolorbox}[colframe=gray!50,colback=gray!1,coltext=gray!100]
Hydra - Nix-based continuous build system (2008)
\end{tcolorbox}
\begin{tcolorbox}[colframe=gray!50,colback=gray!1,coltext=gray!100]
NixOps - The NixOS Deployment Tool (2011)
\end{tcolorbox}
}
\end{frame}
\subsection{Expression Language}
\begin{frame}{}
......@@ -275,65 +292,67 @@ The running environment should be explicit:
\end{itemize}
\end{frame}
\begin{frame}{}
All \emph{official} packages are defined into the repository:
\begin{tcolorbox}[colframe=black,colback=gray!10,coltext=black]{Nixpkgs - \textcolor{red}{\url{https://github.com/NixOS/nixpkgs}}}
\end{tcolorbox}
\begin{columns}
\begin{column}{0.5\textwidth}
\begin{itemize}
\item First commit: Mar 2003
\item \textbf{$>$22 000} packages
\item \textbf{$>$2 100} contributors
\end{itemize}
\end{column}
\begin{column}{0.5\textwidth}
\begin{itemize}
\item \textbf{$>$183 600} commits
\end{itemize}
\end{column}
\end{columns}
\end{frame}
\section{How Does it Work ?}
% \begin{frame}{}
% All \emph{official} packages are defined into the repository:
% \begin{tcolorbox}[colframe=black,colback=gray!10,coltext=black]{Nixpkgs - \textcolor{red}{\url{https://github.com/NixOS/nixpkgs}}}
% \end{tcolorbox}
% \begin{columns}
% \begin{column}{0.5\textwidth}
% \begin{itemize}
% \item First commit: Mar 2003
% \item \textbf{$>$22 000} packages
% \item \textbf{$>$2 100} contributors
% \end{itemize}
% \end{column}
% \begin{column}{0.5\textwidth}
% \begin{itemize}
% \item \textbf{$>$183 600} commits
% \end{itemize}
% \end{column}
% \end{columns}
% \end{frame}
\section{Nix Structure}
\begin{frame}{Main Concept}
% Nix borrows its concept from Functional Languages. \\
\begin{tcolorbox}[colframe=black,colback=gray!10,coltext=black]
Nix applies the concept of functional programming languages to packages management.
\end{tcolorbox}
\vspace{1em}
\begin{frame}
Each software building action is described through functions.
\note{Function into the Functional paradigm point of view}
How does it works / How can we use it ?
\vspace{1em}
Packages dependencies are also functions given as inputs.
\end{frame}
\begin{frame}[fragile]{Derivations}
\begin{onlyenv}<1>
\note{https://nixos.org/nixos/nix-pills/our-first-derivation.html\\}
Nix refers to \textbf{derivation} instead of package. \\
\vspace{1em}
From the Nix point of view, a derivation is a build action, \\
described by a Nix set.
\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}. \\
\vspace{1em}
Once built, a derivation is located into a common place\\
the \textbf{Nix store}.
\vspace{1em}
A derivation is identified with a unique hash as follows:
\begin{lstlisting}[language=Nix,basicstyle=\small]
/nix/store/hash-name
\end{lstlisting}
% 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>
\note{A derivation is a set of attributes describing a building process \\}
\vspace{1em}
It is an attribute set describing how to build a package.
\end{onlyenv}
\pause
\begin{onlyenv}<2>
%\begin{adjustbox}{width=\textwidth,height=\textheight,keepaspectratio}
\vspace{-1em}
\begin{onlyenv}<3>
\begin{lstlisting}[language=Nix,basicstyle=\small]
{
stdenv.mkDerivation {
name = "chord";
src = fetchurl {
......@@ -341,24 +360,25 @@ The running environment should be explicit:
sha256 = "1h2jgq5pspyiskffq777nhi5rf0y8h...";
};
builder = "build.sh";
buildInputs = [ simgrid boost cmake ];
meta = ..;
}
\end{lstlisting}
\end{lstlisting}
\end{onlyenv}
\end{frame}
\end{onlyenv}
\end{frame}
\begin{frame}[fragile]{Store}
All build derivations are stored in the nix store: \texttt{/nix/store}.\\
\begin{tcolorbox}[colframe=black,colback=gray!10,coltext=black]
Nix uses a single directory to store every packages.
\end{tcolorbox}
\vspace{1em}
They are identified with a sha-256 hash of the source nix file and
A packagesr is identified with a sha-256 hash of the source nix file and
its "inputs".
\begin{lstlisting}[basicstyle=\small]
......@@ -376,6 +396,24 @@ The running environment should be explicit:
\end{frame}
\begin{frame}[plain]{Nixpkgs}
\begin{tcolorbox}[colframe=black,colback=gray!10,coltext=black]
\center
NixPkgs is an open source git repository.
\end{tcolorbox}
\only<1>{
\vspace{1em}
It contains the derivations of all application (and libraries) \emph{officialy} available with Nix.
}
\only<1>{
\vspace{1em}
Packages are distributed as Nix expression (the so called derivations).
}
\end{frame}
\begin{frame}[plain]{Channels}
\only<1>{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment