Skip to content

Commit

Permalink
slides: more smooth presentation
Browse files Browse the repository at this point in the history
  • Loading branch information
xieby1 committed Oct 14, 2024
1 parent db15b70 commit 41db700
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 84 deletions.
111 changes: 58 additions & 53 deletions docs/slides/2023.nix-env.slides.html
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ <h2 data-number="1.3" data-auto-animate="1"><span
<ul>
<li>Imperative(命令式)/Declarative(声明式)</li>
<li><strong></strong>函数式编程语言 (Purely Functional)</li>
<li>可重现 (Reproducible)</li>
<li>可重现 (Reproducible) &amp; 确定性 (Deterministic)</li>
</ul>
</div>
</section>
Expand All @@ -341,7 +341,7 @@ <h2 data-number="1.4" data-auto-animate="1"><span
<li>🟢Declarative即需要编程</li>
<li><strong></strong>函数式编程语言 (Purely Functional)</li>
<li>🟢在nix配置代码中:<code>home.packages = [nixpkgs.vim];</code></li>
<li>可重现 (Reproducible)</li>
<li>可重现 (Reproducible) &amp; 确定性 (Deterministic)</li>
<li>🔴apt install,不同时间安装的内容不一样</li>
</ul>
</div>
Expand Down Expand Up @@ -431,15 +431,41 @@ <h2 data-number="1.5"><span class="header-section-number">1.5</span>
<h2 data-number="1.6"><span class="header-section-number">1.6</span>
<img src="images/nix-snowflake.svg" style="height:1em;">Nix/NixOS vs
<img src="images/Moby-logo.png" style="height:1em;">Docker</h2>
<p>Docker融入现有环境</p>
<p>没办法简单的在docker环境中用自己的vim/vscode配置</p>
<div style="font-size: 0.7em;">
<table>
<colgroup>
<col style="width: 18%" />
<col style="width: 33%" />
<col style="width: 48%" />
</colgroup>
<thead>
<tr class="header">
<th></th>
<th>Nix/NixOS</th>
<th>Docker</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>确定性</td>
<td>是 (确定性derivation)</td>
<td>否 (非确定性layer)</td>
</tr>
<tr class="even">
<td>融入现有环境</td>
<td>轻松:nix-env/nix-shell</td>
<td>难:本质各种隔离,bind/network/…</td>
</tr>
</tbody>
</table>
</div>
</section>

<section id="学习nixnixos" class="title-slide slide level2"
data-number="1.7">
<h2 data-number="1.7"><span class="header-section-number">1.7</span>
学习Nix/NixOS</h2>
<p><span class="fragment">学习曲线陡峭📈,但也别担心😸</span></p>
<p>学习曲线陡峭📈,但也别担心😸</p>
<div class="container">
<div class="col">
<h3>
Expand Down Expand Up @@ -728,18 +754,21 @@ <h2 data-number="2.7"><span class="header-section-number">2.7</span>
</div>
</div>
<p></br></p>
<p><span class="fragment"
data-fragment-index="3">成功编译🎉🎉🎉</span></p>
<div class="fragment" data-fragment-index="3">
<p>成功编译🎉🎉🎉</p>
<p>并且结果一模一样!</p>
</div>
<div class="fragment" data-fragment-index="4">
<p>并且</p>
<p>一模一样具体是指?</p>
</div>
<p>一模一样!</p>
</section>

<section id="编译结果二进制级别一致" class="title-slide slide level2"
data-number="2.8" data-auto-animate="1">
<h2 data-number="2.8" data-auto-animate="1"><span
class="header-section-number">2.8</span> 编译结果二进制级别一致!</h2>
<section id="一模一样具体指二进制级别一样"
class="title-slide slide level2" data-number="2.8"
data-background-video="./images/ohhh.mp4" data-auto-animate="1">
<h2 data-number="2.8" data-background-video="./images/ohhh.mp4"
data-auto-animate="1"><span class="header-section-number">2.8</span>
一模一样具体指:二进制级别一样!</h2>
<div class="container">
<div class="col">
<p>同学壹🤓</p>
Expand All @@ -757,30 +786,6 @@ <h2 data-number="2.8" data-auto-animate="1"><span
<p>一模一样!</p>
</div>
</section>

<section id="编译结果二进制级别一致-1" class="title-slide slide level2"
data-number="2.9" data-background-video="./images/ohhh.mp4"
data-auto-animate="1">
<h2 data-number="2.9" data-background-video="./images/ohhh.mp4"
data-auto-animate="1"><span class="header-section-number">2.9</span>
编译结果二进制级别一致!</h2>
<div class="container">
<div class="col">
<p>同学壹🤓</p>
</div>
<div class="col">
<p>同学贰😍</p>
</div>
<div class="col">
<p>同学叁🥰</p>
</div>
</div>
<div style="font-size: 48pt;">
<div class="sourceCode" id="cb12"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a><span class="fu">md5sum</span> ~/Codes/gem5/build/X86/gem5.debug</span></code></pre></div>
<p>一模一样!</p>
</div>
</section>
</section>
<section>
<section id="nix原理" class="title-slide slide level1" data-number="3"
Expand All @@ -799,11 +804,11 @@ <h2 data-number="3.1"><span class="header-section-number">3.1</span>
<li>命名方式<code>/nix/store/&lt;hash&gt;-&lt;pname&gt;-&lt;version&gt;</code></li>
</ul>
<div class="fragment">
<div class="sourceCode" id="cb13"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a><span class="ex">bap4d0lpcrhpwmpb8ayjcgkmvfj62lnq-bash-interactive-5.1-p16</span></span>
<span id="cb13-2"><a href="#cb13-2" aria-hidden="true" tabindex="-1"></a><span class="ex">bjp36ahgqs5m2j29kp3ni8x8zb3s7crc-bash-interactive-5.1-p16</span></span>
<span id="cb13-3"><a href="#cb13-3" aria-hidden="true" tabindex="-1"></a><span class="ex">f01r6lmbi7mg0xg80mvzdwqhlmrzvy4v-bash-interactive-5.2-p15</span></span>
<span id="cb13-4"><a href="#cb13-4" aria-hidden="true" tabindex="-1"></a><span class="ex">gmz9kyy7m7dvbp34wjpmqjyir58z0xch-bash-interactive-5.1-p16</span></span></code></pre></div>
<div class="sourceCode" id="cb12"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a><span class="ex">bap4d0lpcrhpwmpb8ayjcgkmvfj62lnq-bash-interactive-5.1-p16</span></span>
<span id="cb12-2"><a href="#cb12-2" aria-hidden="true" tabindex="-1"></a><span class="ex">bjp36ahgqs5m2j29kp3ni8x8zb3s7crc-bash-interactive-5.1-p16</span></span>
<span id="cb12-3"><a href="#cb12-3" aria-hidden="true" tabindex="-1"></a><span class="ex">f01r6lmbi7mg0xg80mvzdwqhlmrzvy4v-bash-interactive-5.2-p15</span></span>
<span id="cb12-4"><a href="#cb12-4" aria-hidden="true" tabindex="-1"></a><span class="ex">gmz9kyy7m7dvbp34wjpmqjyir58z0xch-bash-interactive-5.1-p16</span></span></code></pre></div>
</div>
<p><span class="fragment">混乱的用户环境?</span></p>
</section>
Expand All @@ -820,14 +825,14 @@ <h3>
<p><code>PATH=~/.nix-profile/bin:...</code></p>
<p>所有用户需要程序会被符号链接到改文件夹</p>
<div class="fragment" style="font-size: 36pt;">
<div class="sourceCode" id="cb14"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb14-1"><a href="#cb14-1" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> which vim</span>
<span id="cb14-2"><a href="#cb14-2" aria-hidden="true" tabindex="-1"></a><span class="ex">~/.nix-profile/bin/vim</span></span></code></pre></div>
<div class="sourceCode" id="cb13"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> which vim</span>
<span id="cb13-2"><a href="#cb13-2" aria-hidden="true" tabindex="-1"></a><span class="ex">~/.nix-profile/bin/vim</span></span></code></pre></div>
</div>
<div class="fragment" style="font-size: 36pt;">
<div class="sourceCode" id="cb15"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb15-1"><a href="#cb15-1" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> realpath ~/.nix-profile/bin/vim</span>
<span id="cb15-2"><a href="#cb15-2" aria-hidden="true" tabindex="-1"></a><span class="ex">/nix/store/9gzxr4ij4i0h1zyvkai8k7jq2dpprr2k-neovim-0.8.1/bin/nvim</span></span></code></pre></div>
<div class="sourceCode" id="cb14"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb14-1"><a href="#cb14-1" aria-hidden="true" tabindex="-1"></a><span class="ex">$</span> realpath ~/.nix-profile/bin/vim</span>
<span id="cb14-2"><a href="#cb14-2" aria-hidden="true" tabindex="-1"></a><span class="ex">/nix/store/9gzxr4ij4i0h1zyvkai8k7jq2dpprr2k-neovim-0.8.1/bin/nvim</span></span></code></pre></div>
</div>
</div>
</section>
Expand Down Expand Up @@ -1024,11 +1029,11 @@ <h2 data-number="4.5"><span class="header-section-number">4.5</span>
class="title-slide slide level3" data-number="4.5.1">
<h3 data-number="4.5.1"><span class="header-section-number">4.5.1</span>
确定性切片(deterministic_checkpoints)用法</h3>
<div class="sourceCode" id="cb16"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb16-1"><a href="#cb16-1" aria-hidden="true" tabindex="-1"></a><span class="co"># 准备源码spec2006.tar.gz # </span><span class="al">TODO</span><span class="co">: 更智能化</span></span>
<span id="cb16-2"><a href="#cb16-2" aria-hidden="true" tabindex="-1"></a><span class="fu">git</span> clone https://github.com/xieby1/deterministic_checkpoints</span>
<span id="cb16-3"><a href="#cb16-3" aria-hidden="true" tabindex="-1"></a><span class="bu">cd</span> deterministic_checkpoints</span>
<span id="cb16-4"><a href="#cb16-4" aria-hidden="true" tabindex="-1"></a><span class="ex">nix-build</span> <span class="at">-A</span> checkpoints</span></code></pre></div>
<div class="sourceCode" id="cb15"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb15-1"><a href="#cb15-1" aria-hidden="true" tabindex="-1"></a><span class="co"># 准备源码spec2006.tar.gz # </span><span class="al">TODO</span><span class="co">: 更智能化</span></span>
<span id="cb15-2"><a href="#cb15-2" aria-hidden="true" tabindex="-1"></a><span class="fu">git</span> clone https://github.com/xieby1/deterministic_checkpoints</span>
<span id="cb15-3"><a href="#cb15-3" aria-hidden="true" tabindex="-1"></a><span class="bu">cd</span> deterministic_checkpoints</span>
<span id="cb15-4"><a href="#cb15-4" aria-hidden="true" tabindex="-1"></a><span class="ex">nix-build</span> <span class="at">-A</span> checkpoints</span></code></pre></div>
</section>


Expand Down
46 changes: 15 additions & 31 deletions docs/slides/2023.nix-env.slides.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ toc-margin: 0 400px
::: {style="font-size:20pt;"}
* Imperative(命令式)/Declarative(声明式)
* ****函数式编程语言 (Purely Functional)
* 可重现 (Reproducible)
* 可重现 (Reproducible) & 确定性 (Deterministic)
:::

## Nix/NixOS特点-续 {data-auto-animate=1}
Expand All @@ -71,7 +71,7 @@ toc-margin: 0 400px
* 🟢Declarative即需要编程
* ****函数式编程语言 (Purely Functional)
* 🟢在nix配置代码中:`home.packages = [nixpkgs.vim];`
* 可重现 (Reproducible)
* 可重现 (Reproducible) & 确定性 (Deterministic)
* 🔴apt install,不同时间安装的内容不一样
:::

Expand Down Expand Up @@ -101,13 +101,16 @@ toc-margin: 0 400px

## <img src="images/nix-snowflake.svg" style="height:1em;">Nix/NixOS vs <img src="images/Moby-logo.png" style="height:1em;">Docker

Docker融入现有环境

没办法简单的在docker环境中用自己的vim/vscode配置
::: {style="font-size: 0.7em;"}
| | Nix/NixOS | Docker |
|--------------|-------------------------|------------------------------------|
| 确定性 | 是 (确定性derivation) | 否 (非确定性layer) |
| 融入现有环境 | 轻松:nix-env/nix-shell | 难:本质各种隔离,bind/network/... |
:::

## 学习Nix/NixOS

[学习曲线陡峭📈,但也别担心😸]{.fragment}
学习曲线陡峭📈,但也别担心😸

::: {.container}
:::: {.col}
Expand Down Expand Up @@ -383,37 +386,18 @@ nix-shell
</br>


[成功编译🎉🎉🎉]{.fragment data-fragment-index="3"}
::: {.fragment data-fragment-index="3"}
成功编译🎉🎉🎉

::: {.fragment data-fragment-index="4"}
并且
并且结果一模一样!
:::

一模一样!

## 编译结果二进制级别一致! {data-auto-animate=1}

::: {.container}
:::: {.col}
同学壹🤓
::::
:::: {.col}
同学贰😍
::::
:::: {.col}
同学叁🥰
::::
::: {.fragment data-fragment-index="4"}
一模一样具体是指?
:::

::: {style="font-size: 48pt;"}
```bash
md5sum ~/Codes/gem5/build/X86/gem5.debug
```

一模一样!
:::

## 编译结果二进制级别一致! {data-background-video="./images/ohhh.mp4" data-auto-animate=1}
## 一模一样具体指:二进制级别一样! {data-background-video="./images/ohhh.mp4" data-auto-animate=1}

::: {.container}
:::: {.col}
Expand Down

0 comments on commit 41db700

Please sign in to comment.