r/Nix

▲ 26 r/Nix+1 crossposts

A fully reproducible Markdown presentation environment

I often present technical topics at work, but I've never liked PowerPoint, Google Slides, and similar tools. As a Nix enthusiast and a Kubernetes/DevOps lead, it always feels clumsy to rely on WYSIWYG editors. It's not code, it’s not reproducible: it’s a liability.

I found Marp a few years back and immediately adopted it to write and generate my slides. But I found myself constantly copying assets, snippets, and themes back and forth between presentations. And ultimately, without a pinned toolchain, it still wasn't truly reproducible across machines and time.

To solve this once and for all, I put together Marp Deck Directory during my time off. It's a public template that combines Marp with the absolute guarantees of Nix flakes to store all your slide decks/assets and guarantee you can generate them identically 5 years from now.

GitHub Repo: nicolas-goudry/marp-deck-directory

Live Demo (built via GH Actions): nicolas-goudry.github.io/marp-deck-directory

A few Nix-specific technical details of how it works under the hood:

  • Dynamic Discovery & Path Rewriting: A single core derivation discovers decks under slides/ and builds HTML, PDFs, and PNG covers. It handles path rewriting dynamically so you can seamlessly mix global assets (/assets) and deck-specific local assets without breaking local dev previews.
  • Offline Emojis: Because Nix builds run without network access, I built a small derivation to vendor Twemoji assets locally during the build step.
  • The PDF Sandbox Hack: Normal Chromium sandboxing fails inside Nix builds. I created a wrapper around the Brave browser to pass --no-sandbox. Why Brave? Because standard Chromium isn't natively available on aarch64-darwin, and headless Firefox currently struggles on Darwin (plus it renders Marp differently than Chromium). Brave was the safest cross-platform bet.

Oh, one last thing! The template comes bundled with Catppuccin themes for Marp, which I built specifically for this project and is currently in the process of becoming an official Catppuccin port.

I'd love to get feedback from anyone else doing "presentations as code". Let me know what you think!

github.com
u/ngoudry — 1 day ago
▲ 1 r/Nix+2 crossposts

The moment I started using AI coding agents like Claude Code with real shell access, I realised my normal dev setup wasn’t built for this.

These agents can install packages, change configs, run scripts, and generally operate your machine like a very fast junior engineer with root access. That’s powerful—but also risky. I didn’t want experiments happening on my primary environment.

What I needed was a development setup that was both reproducible and disposable: spin up a fresh VM, preload all my dev tools, let the agent work, and throw it away if needed.

Using NixOS + Home Manager made that practical. My entire environment became portable—one command and the same setup anywhere.

Wrote the full setup in a Towards AI article, including full code and agent wiring with nix-agent-wire.

I’m still relatively new to the Nix world, so I’m especially interested in how others here approach this. If there are better patterns for agent-safe, portable dev environments, I’d genuinely love to learn.
Article  🔗 : https://towardsai.net/p/machine-learning/the-dev-environment-setup-every-ai-engineer-should-have

https://preview.redd.it/t0iksmojhiyg1.png?width=2560&format=png&auto=webp&s=a3351ca6eebdb7d6fbfa17c7dcfed0654e5d796e

reddit.com
u/gupta_ujjwal14 — 13 days ago
▲ 24 r/Nix+1 crossposts

Nix and NixOS are almost too good to be true. Isolation, libraries coexisting, transparent binary cache and software that just works. Not works on my machine, just works. But is that always the case? Or... Did we manage to get ourselves into... impurities? Join us for a discussion about libGL and find out what anomalies lurk in the dark depths of our operating systems.

https://fulltimenix.com/episodes/the-libgl-anomaly

u/mightyiam — 11 days ago
▲ 1 r/Nix+1 crossposts

I currently use Nix and home-manager on top of Arch Linux.

I have the following GPU set-up in my home-manager configuration:

nixpkgs.config.nvidia.acceptLicense = true;
targets.genericLinux = {
  enable = true;
  gpu = {
    enable = true;
    nvidia = {
      enable = true;
      sha256 = "sha256-NiA7iWC35JyKQva6H1hjzeNKBek9KyS3mK8G3YRva4I=";
      version = "595.71.05";
    };
  };
};

This is following advice from https://nix-community.github.io/home-manager/#sec-usage-gpu-nvidia

This had been working fine until a recent nixpkgs input update (i.e. nix flake update). With all nixpkgs after revision 9cadaf6932b7c926e468f777549d57f04a7212da (which works fine) I get the following error:

error:
       … while calling the 'derivationStrict' builtin
         at «nix-internal»/derivation-internal.nix:37:12:
           36|
           37|   strict = derivationStrict drvAttrs;
             |            ^
           38|

       … while evaluating derivation 'home-manager-generation'
         whose name attribute is located at «github:nixos/nixpkgs/15f4ee454b1dce334612fa6843b3e05cf546efab?narHash=sha256-Ad49moKWeXtKBJNy2ebiTQUEgdLyvGmTeykAQ9xM%2BZ4%3D»/pkgs/stdenv/generic/make-derivation.nix:535:11

       … while evaluating attribute 'buildCommand' of derivation 'home-manager-generation'
         at «github:nixos/nixpkgs/15f4ee454b1dce334612fa6843b3e05cf546efab?narHash=sha256-Ad49moKWeXtKBJNy2ebiTQUEgdLyvGmTeykAQ9xM%2BZ4%3D»/pkgs/build-support/trivial-builders/default.nix:80:17:
           79|         enableParallelBuilding = true;
           80|         inherit buildCommand name;
             |                 ^
           81|         passAsFile = [ "buildCommand" ] ++ (derivationArgs.passAsFile or [ ]);

       … while evaluating the option `home.activation.checkExistingGpuDrivers.data':

       … while evaluating definitions from `/nix/store/ixgab494sxxyrb4ws08pgm05ms5rr3n7-source/modules/targets/generic-linux/gpu':

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: function 'anonymous lambda' called with unexpected argument 'kernel'
       at «github:nixos/nixpkgs/15f4ee454b1dce334612fa6843b3e05cf546efab?narHash=sha256-Ad49moKWeXtKBJNy2ebiTQUEgdLyvGmTeykAQ9xM%2BZ4%3D»/pkgs/os-specific/linux/nvidia-x11/generic.nix:34:1:
           33|
           34| {
             | ^
           35|   lib,

The version and sha256 values in my configuration are correct for the version of the Nvidia drivers installed in Arch. Also the home-manager nixpkgs input is set to follow my main nixpkgs input in flake.nix. As mentioned, this all works fine until I use a newer revision of nixpkgs.

Any ideas?

reddit.com
u/polaris64 — 11 days ago