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
ad321853
Commit
ad321853
authored
5 years ago
by
Faure Adrien
Browse files
Options
Downloads
Patches
Plain Diff
[TutoNix]lun. juin 24 10:48:59 CEST 2019
parent
42c4881e
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
+6
-6
6 additions, 6 deletions
default.nix
slides.pdf
+0
-0
0 additions, 0 deletions
slides.pdf
slides.tex
+61
-23
61 additions, 23 deletions
slides.tex
with
67 additions
and
29 deletions
default.nix
+
6
−
6
View file @
ad321853
...
@@ -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"
;
};
}
}
This diff is collapsed.
Click to expand it.
slides.pdf
+
0
−
0
View file @
ad321853
No preview for this file type
This diff is collapsed.
Click to expand it.
slides.tex
+
61
−
23
View file @
ad321853
...
@@ -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 Ma
i
ntainable)
\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
...
...
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