Mentions légales du service

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

[TutoNix]dim. juin 23 16:07:04 CEST 2019

parent 45218e6e
No related branches found
No related tags found
No related merge requests found
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";
};
}
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}
......@@ -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}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment