finalish slides

This commit is contained in:
Jade Lovelace 2023-09-09 09:57:06 +02:00
parent 6860a82c05
commit 74b771e62c
11 changed files with 102 additions and 20 deletions

BIN
content/posts/nixcon2023/slides/dynamic-demo.mp4 (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -58,10 +58,11 @@
<section data-markdown><textarea data-template>
# the sources are for everyone
* We do need to improve our documentation
* We *do* need to improve our documentation
* Nix is uniquely participatory: a *lot* of us write modules and packages, which means reading sources
* Navigating the source is a bit of witchcraft, and there's a lot of it
* With good tooling, the sources of the docs sometimes are faster than the docs
* We should have more interactive docs!
</textarea>
</section>
@ -101,8 +102,12 @@ dev/nixpkgs » tokei -t nix .
# Static analysis
* Any method that takes 15 seconds or less and doesn't involve running any code
* I am showing the fancy ways of doing it
* ripgrep is static analysis too; it's a good fallback
* First way to try:
* Extremely fast
* Objective: "works most of the time"
* I am showing the fancy ways of doing it here
* ripgrep is static analysis too
* Objective of fancy ways: faster and less stuff to sort through
</textarea>
</section>
@ -118,8 +123,7 @@ Good for:
Limitations:
* does not eval everything
* needs some setup per-project
* completions are imperfect but they exist
* not sure how to get goto definition to go past args for some things
* imperfect go-to-definition
</textarea>
</section>
@ -145,10 +149,10 @@ Install from nixpkgs and configure in your editor. Then:
</textarea>
</section>
<section data-markdown><textarea data-template>
<section class="video" data-markdown><textarea data-template>
# demo (nixd)
FIXME
<video class="r-stretch" src="./nixd.mp4" controls>
</textarea>
</section>
@ -158,11 +162,11 @@ FIXME
* Very old and simple source code index format
* Usually gets through abstraction by being too naive to get broken
* Typically generated by simple parse-tree traversal
* Wide editor support ([VSCode extension](https://marketplace.visualstudio.com/items?itemName=jaydenlin.ctags-support), built into vim/emacs)
* Wide editor support ([VSCode extension](https://marketplace.visualstudio.com/items?itemName=jaydenlin.ctags-support); also built into vim/emacs)
Sample:
```
```text
boot.initrd.luks.reusePassphrases nixos/modules/system/boot/luksroot.nix 533
```
</textarea>
@ -173,19 +177,21 @@ boot.initrd.luks.reusePassphrases nixos/modules/system/boot/luksroot.nix
# ctags on nix
* `nix-doc tags .` in nixpkgs, then in vim you can `:tj fixedPoints`, `C-]`, etc.
* [WIP ctags for NixOS options](https://github.com/NixOS/nixpkgs/pull/249243)
* [WIP ctags for NixOS options (#249243)](https://github.com/NixOS/nixpkgs/pull/249243)
</textarea>
</section>
<section data-markdown><textarea data-template>
<section class="video" data-markdown><textarea data-template>
# demo (ctags on nix)
FIXME
<video class="r-stretch" src="./nix-ctags.mp4" controls>
</textarea>
</section>
<section data-markdown><textarea data-template>
# summary (static analysis)
First try language server, then ctags, then ripgrep.
</textarea>
</section>
@ -264,6 +270,7 @@ null
</textarea>
</section>
<!--
<section data-markdown><textarea data-template>
# `builtins.unsafeGetAttrPos`
@ -282,6 +289,21 @@ s.nix"; line = 1193; }
</script></code></pre>
</textarea>
</section>
-->
<section class="video" data-markdown><textarea data-template>
<video class="r-stretch" src="./dynamic-demo.mp4" controls>
</textarea>
</section>
<section data-markdown><textarea data-template>
# bonus: using the debugger
* pass `--debugger` to nix
* use `builtins.break (value)` somewhere in the evaluation path
* then use `unsafeGetAttrPos` and others to figure out the source of a value
</textarea>
</section>
<section data-markdown><textarea data-template>
# summary (dynamic analysis)
@ -294,14 +316,19 @@ s.nix"; line = 1193; }
* `builtins.doc` (nix-doc)
* \+ concise output on functions
* \- issues with wrappers
</textarea>
</section>
<section data-markdown><textarea data-template>
# summary (dynamic analysis)
* `builtins.unsafeGetAttrPos`
* \+ can get you close to the source if other things fail due to abstraction
* \+ gets close even with abstraction
* \- unergonomic args and return value for interactive use
</textarea>
</section>
<section data-markdown><textarea data-template>
# NixOS ctags ([PR](https://github.com/NixOS/nixpkgs/pull/249243))
# NixOS ctags ([PR #249243](https://github.com/NixOS/nixpkgs/pull/249243))
With the PR checked out:
@ -313,10 +340,10 @@ $ nix build -f nixos/release.nix optionsCtags -o opts-tags
Then add `opts-tags` to ctags search path (`:set tags+=opts-tags` in vim).
</section>
<section data-markdown><textarea data-template>
<section class="video" data-markdown><textarea data-template>
# NixOS ctags (demo)
FIXME
<video class="r-stretch" src="./nixos-ctags.mp4" controls>
</textarea>
</section>
@ -326,14 +353,14 @@ FIXME
Getting the configuration into the repl:
* Non-flakes: `nix repl -I nixos-config=/path/to/configuration.nix -f &lt;nixpkgs/nixos&gt;`
* Flakes: `nix repl`, `:lf .`, `nixosConfigurations.xx.{....}`
* Flakes: `nix repl` then `:lf .` then `nixosConfigurations.xx.{....}`
</textarea>
</section>
<section data-markdown><textarea data-template>
<section class="video" data-markdown><textarea data-template>
# NixOS in the repl (demo)
FIXME
<video class="r-stretch" src="./nixos-repl.mp4" controls>
<!--
nix-repl> config.documentation.man.generateCaches
@ -361,6 +388,22 @@ lue = true; } ]
</section>
<section data-markdown><textarea data-template>
# questions?
slides: https://jade.fyi/nixcon2023
masto: @leftpaddotpy\@hachyderm.io
email: jade at jade dot fyi
code: https://github.com/LF-
github sponsors: https://github.com/sponsors/LF-
</textarea>
</section>
<script type="module" src="main.js"></script>
</body>
</html>

View file

@ -11,4 +11,7 @@ Reveal.initialize({
transitionSpeed: "fast",
transition: "none",
slideNumber: true,
margin: 0.04,
disableLayout: true,
});

BIN
content/posts/nixcon2023/slides/nix-ctags.mp4 (Stored with Git LFS) Normal file

Binary file not shown.

BIN
content/posts/nixcon2023/slides/nixd.mp4 (Stored with Git LFS) Normal file

Binary file not shown.

BIN
content/posts/nixcon2023/slides/nixos-ctags.mp4 (Stored with Git LFS) Normal file

Binary file not shown.

BIN
content/posts/nixcon2023/slides/nixos-repl.mp4 (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -1,3 +1,14 @@
.slides {
display: flex;
/*! flex: max-content; */
align-items: center;
justify-content: center;
}
.slides section:not(.video) {
max-width: var(--slide-width);
}
:root {
--r-heading-text-transform: none !important;
--r-background-color: #190022 !important;