Mentions légales du service

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

[NixTuto] Channels

parent f26af683
Branches
No related tags found
No related merge requests found
figures/fig3large.jpg

83.4 KiB

No preview for this file type
...@@ -140,9 +140,9 @@ The running environment should be explicit: ...@@ -140,9 +140,9 @@ The running environment should be explicit:
\begin{itemize} \begin{itemize}
\item the running environment should be defined \item the running environment should be defined
\note[itemize]{ \note{
\item How(had-hoc script, complex runtime etc), How(had-hoc script, complex runtime etc),
\item Where(your laptop, your old laptop etc) you run you experiment.} Where(your laptop, your old laptop etc) you run you experiment.}
\item Documenting how to run the experiment. \item Documenting how to run the experiment.
\note{The input, the running scripts etc \\} \note{The input, the running scripts etc \\}
...@@ -304,49 +304,110 @@ The running environment should be explicit: ...@@ -304,49 +304,110 @@ The running environment should be explicit:
\end{frame} \end{frame}
\begin{frame}[fragile]{Derivations} \begin{frame}[fragile]{Derivations}
\only<1>{ \begin{onlyenv}<1>
\note{https://nixos.org/nixos/nix-pills/our-first-derivation.html\\} \note{https://nixos.org/nixos/nix-pills/our-first-derivation.html\\}
Nix refers to \texbf{derivation} instead of packages. \\ 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.
\vspace{1em}
Once built, a derivation is located into a common place\\
the \textbf{Nix store}.
\vspace{1em} \vspace{1em}
Derivation are the building block of Nix, from a file system point of view.
A derivation is identified with a unique hash as follows:
\begin{lstlisting}[language=Nix,basicstyle=\small]
/nix/store/hash-name
\end{lstlisting}
\note{A derivation is a set of attributes describing a building process \\} \note{A derivation is a set of attributes describing a building process \\}
}
\end{onlyenv}
\begin{onlyenv}<2> \begin{onlyenv}<2>
%\begin{adjustbox}{width=\textwidth,height=\textheight,keepaspectratio} %\begin{adjustbox}{width=\textwidth,height=\textheight,keepaspectratio}
\vspace{-1em} \vspace{-1em}
\begin{lstlisting}[language=Nix,basicstyle=\Small] \begin{lstlisting}[language=Nix,basicstyle=\small]
{ stdenv, fetchurl , cmake, simgrid, boost }: {
stdenv.mkDerivation rec { name = "chord";
name = "chord-vprez";
src = fetchurl { src = fetchurl {
url = "https://gitlab.com/me/chord.tar.gz"; url = "https://gitlab.com/me/chord.tar.gz";
sha256 = "1h2jgq5pspyiskffq777nhi5rf0y8hg..."; sha256 = "1h2jgq5pspyiskffq777nhi5rf0y8h...";
}; };
cmakeFlags= " -Denable_debug=on"; builder = "build.sh";
buildInputs = [ simgrid boost cmake ]; buildInputs = [ simgrid boost cmake ];
meta = ..; meta = ..;
} }
\end{lstlisting} \end{lstlisting}
%\end{adjustbox} \end{onlyenv}
\end{frame}
\end{onlyenv}
\end{frame} \begin{frame}[fragile]{Store}
All build derivations are stored in the nix store: \texttt{/nix/store}.\\
\vspace{1em}
\begin{frame}{Store}
Packages are stored in the nix store: \texttt{/nix/store}.\\
They are identified with a sha-256 hash of the source nix file and They are identified with a sha-256 hash of the source nix file and
its "inputs".\\ its "inputs".
\texttt{/nix/store/an9dli66ng2jzvqf13b2i230mm9fq7qk-cdo-1.7.2}\\
changing a flag alters the inputs produce new packages: \\ \begin{lstlisting}[basicstyle=\small]
\texttt{/nix/store/srf6grrfy9vkc9fsplk8xk292lm8jvz5-cdo-1.7.2} /nix/store/wi199j9qz9n1z3f4inlnx4rdxja54vg2-vim/bin/vim
\end{lstlisting}
\vspace{1em}
Changing the inputs changes the path:
\note{Here I changed my vimrc}
\begin{lstlisting}[basicstyle=\small]
/nix/store/58gs3qxyqb2xh03jkai7cmph8086d2dd-vim/bin/vim
\end{lstlisting}
\end{frame}
\begin{frame}[plain]{Channels}
\only<1>{
\textbf{NixPkgs} is a git repository containing the code of all \emph{official} derivations.
\vspace{1em}
A \textbf{channel} is link to branch of NixPkgs tested with continuous integration.
\vspace{1em}
\begin{itemize}
\item nixpkgs-unstable (feeling lucky?)
\item nixpkgs-19.03 (current stable)
\item nixpkgs-18.09 (outdated)
\end{itemize}
}
\only<2>{
Channels are not fully reproducible, as they are subject to updates.
}
\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}[plain,noframenumbering] \begin{frame}[plain,noframenumbering]
\center Thanks. Question Time. \center Thanks. Question Time.
\end{frame} \end{frame}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment