Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
presentation-slides
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
GitLab upgrade completed. Current version is 17.11.3.
Show more breadcrumbs
nix-tutorial
presentation-slides
Commits
fa61b795
Commit
fa61b795
authored
5 years ago
by
Faure Adrien
Browse files
Options
Downloads
Patches
Plain Diff
[TutoNix]dim. juin 23 16:07:04 CEST 2019
parent
45218e6e
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
default.nix
+9
-1
9 additions, 1 deletion
default.nix
slides.pdf
+0
-0
0 additions, 0 deletions
slides.pdf
slides.tex
+52
-25
52 additions, 25 deletions
slides.tex
with
61 additions
and
26 deletions
default.nix
+
9
−
1
View file @
fa61b795
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"
;
};
}
This diff is collapsed.
Click to expand it.
slides.pdf
+
0
−
0
View file @
fa61b795
No preview for this file type
This diff is collapsed.
Click to expand it.
slides.tex
+
52
−
25
View file @
fa61b795
...
...
@@ -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 Concept
s
}
% 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 F
unctional paradigm point of view
}
\note
{
Function
from a f
unctional 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 package
sr
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]
{
Nix
p
kgs
}
% \subsection
{Nix
P
kgs}
\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}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment