Skip to content

Commit

Permalink
misc: pandoc highlighter theme to zenburn
Browse files Browse the repository at this point in the history
  • Loading branch information
codgician committed May 16, 2024
1 parent fef79ee commit beef6fc
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 17 deletions.
24 changes: 12 additions & 12 deletions lib/default.nix
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{ nixpkgs, ... }:
let
lib = nixpkgs.lib;
concatAttrs = attrList: builtins.foldl' (x: y: x // y) { } attrList;
in
rec {
{ nixpkgs, ... }: rec {
# Put all custom library functions under "seelie" namespace
seelies = concatAttrs [
(import ./revealjs.nix)
(import ./filesystem.nix { inherit lib; })
(import ./misc.nix { inherit lib; })
(import ./site.nix)
];
seelies =
let
lib = nixpkgs.lib // { inherit seelies; };
concatAttrs = attrList: builtins.foldl' (x: y: x // y) { } attrList;
in
concatAttrs [
(import ./revealjs.nix)
(import ./filesystem.nix { inherit lib; })
(import ./misc.nix { inherit lib; })
(import ./site.nix)
];
}
6 changes: 5 additions & 1 deletion lib/revealjs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,15 @@
mdPath = "${src}/slides.md";
args = builtins.concatStringsSep " " ([
# Use reveal.js from input
"-V revealjs-url=./assets/reveal.js"
"--variable"
"revealjs-url=./assets/reveal.js"

# Use katex from nixpkgs
(lib.optionals katex "--katex=./assets/katex-dist/")

# Code highlight theme
"--highlight-style=zenburn"

"--slide-level ${builtins.toString slideLevel}"
] ++ builtins.attrValues (builtins.mapAttrs (k: v: "-V ${k}=${builtins.toString v}") pandocVariables));
in
Expand Down
4 changes: 2 additions & 2 deletions slides/nix-intro/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ lib.seelies.mkRevealJs {
pandocVariables = {
menu = true;
theme = "black";
width = 1366;
height = 768;
width = 1280;
height = 720;
};

additonalFolders = [ ./images ];
Expand Down
35 changes: 33 additions & 2 deletions slides/nix-intro/slides.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ Implement pseudo-solvers, e.g. rpm, apt, etc.

::: { .incremental }

- Two components dependeing different versions of the same package?
- Two components depending different versions of the same package?
- Two components providing file to the same path?
- Two components may interfere with others in the case of incomplete dependencies and inexact notions of component compatibility.

Expand All @@ -176,6 +176,12 @@ Introducing [The Purely Functional Software Deployment Model](https://edolstra.g

and one of its implementation, Nix.

::: { style="justify-content: center" }
```bash
curl https://nixos.org/nix/install | sh
```
:::

::: { .notes }

Nix is not the only implementation, we also have [Guix](https://guix.gnu.org/nb-NO/blog/2006/purely-functional-software-deployment-model/) inspired by the same thesis.
Expand Down Expand Up @@ -209,10 +215,35 @@ $$
:::
:::

## Dealing side-effects
## Why pure function?

::: { .incremental }

- Reproducible.
* The same inputs always yield the same output.
- No side-effects.
* Calculation of one function never interfere other functions.
- Cachable.
* Safe to cache computed results.

:::

## But how?

::: { .incremental }

- Require explicit dependency declaration.
- Ensure by building in a *clean* sandbox.
- In Nix, we call the smallest unit of compliation as *derivation*.
- A *derivation* is written in a functional programming language, also named Nix.

:::

## Derivation

```nix
```

## Nix Store


Expand Down

0 comments on commit beef6fc

Please sign in to comment.