diff --git a/content/posts/nixcon2023/demo-config/configuration.nix b/content/posts/nixcon2023/demo-config/configuration.nix
new file mode 100644
index 0000000..ce4ec65
--- /dev/null
+++ b/content/posts/nixcon2023/demo-config/configuration.nix
@@ -0,0 +1,9 @@
+{ pkgs, config, ... }: {
+ programs.fish.enable = true;
+
+ fileSystems."/" = {
+ device = "/dev/sda1";
+ };
+ boot.loader.grub.enable = false;
+ system.stateVersion = "23.05";
+}
diff --git a/content/posts/nixcon2023/index.md b/content/posts/nixcon2023/index.md
index 1fea700..b9049bd 100644
--- a/content/posts/nixcon2023/index.md
+++ b/content/posts/nixcon2023/index.md
@@ -1,9 +1,10 @@
+++
title = "NixCon 2023: Finding things in nixpkgs and NixOS source"
path = "/nixcon2023"
-draft = true
+draft = false
tags = ["nix", "nixcon"]
date = "2023-09-09"
+++
+Slides here:
diff --git a/content/posts/nixcon2023/slides/.yarn/install-state.gz b/content/posts/nixcon2023/slides/.yarn/install-state.gz
index 9307623..a2595aa 100644
Binary files a/content/posts/nixcon2023/slides/.yarn/install-state.gz and b/content/posts/nixcon2023/slides/.yarn/install-state.gz differ
diff --git a/content/posts/nixcon2023/slides/dynamic-demo.mp4 b/content/posts/nixcon2023/slides/dynamic-demo.mp4
new file mode 100644
index 0000000..641d3bd
--- /dev/null
+++ b/content/posts/nixcon2023/slides/dynamic-demo.mp4
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:55f1cb458194635ee01acc93463beba3246ddbfa7c1a1aaa59f26eb28f210889
+size 1419413
diff --git a/content/posts/nixcon2023/slides/index.html b/content/posts/nixcon2023/slides/index.html
index 091b6bf..2b164b3 100644
--- a/content/posts/nixcon2023/slides/index.html
+++ b/content/posts/nixcon2023/slides/index.html
@@ -58,10 +58,11 @@
@@ -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
@@ -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
@@ -145,10 +149,10 @@ Install from nixpkgs and configure in your editor. Then:
-
@@ -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)
-
+
+
+
+
+
+# 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
+
+
# summary (dynamic analysis)
@@ -294,14 +316,19 @@ s.nix"; line = 1193; }
* `builtins.doc` (nix-doc)
* \+ concise output on functions
* \- issues with wrappers
+
+
+
+
+# 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
-# 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).
-
+
# NixOS ctags (demo)
-FIXME
+
@@ -326,14 +353,14 @@ FIXME
Getting the configuration into the repl:
* Non-flakes: `nix repl -I nixos-config=/path/to/configuration.nix -f <nixpkgs/nixos>`
-* Flakes: `nix repl`, `:lf .`, `nixosConfigurations.xx.{....}`
+* Flakes: `nix repl` then `:lf .` then `nixosConfigurations.xx.{....}`
-
+
# NixOS in the repl (demo)
-FIXME
+