Skip to content

Commit

Permalink
feat: update go lab slides
Browse files Browse the repository at this point in the history
  • Loading branch information
hmajid2301 committed Nov 12, 2024
1 parent 0c96f40 commit d9a207f
Show file tree
Hide file tree
Showing 18 changed files with 3,861 additions and 13 deletions.
39 changes: 26 additions & 13 deletions content/slides/go-lab-reproducible-envs-with-nix/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ slide_number = true

{{% section %}}


## Introduction

- Haseeb Majid
Expand Down Expand Up @@ -892,7 +893,6 @@ In some cases, the build process of a package might embed the timestamp of the f

<img width="70%" height="auto" data-src="images/bin-cat.jpg">


[Credit](https://old.reddit.com/r/linuxmemes/comments/15yi79m/explaining_linux_with_cats/)

---
Expand Down Expand Up @@ -1064,10 +1064,12 @@ go: downloading github.com/gomig/avatar v1.0.2

---

## ci.nix

```nix{6|13-21|21}
{
pkgs,
myPackages,
devPackages,
...
}:
pkgs.dockerTools.buildImage {
Expand All @@ -1085,7 +1087,7 @@ pkgs.dockerTools.buildImage {
curl
git
]
++ myPackages;
++ devPackages;
};
config = {
Env = [
Expand All @@ -1102,6 +1104,8 @@ pkgs.dockerTools.buildImage {

---

## flake.nix

```nix{23-32|34-37|38-41}
# flake.nix
{
Expand All @@ -1125,7 +1129,7 @@ pkgs.dockerTools.buildImage {
(system: let
pkgs = nixpkgs.legacyPackages.${system};
myPackages = with pkgs; [
devPackages = with pkgs; [
go_1_22
golangci-lint
gotools
Expand All @@ -1138,11 +1142,11 @@ pkgs.dockerTools.buildImage {
in {
packages.ci = pkgs.callPackage ./ci.nix {
inherit pkgs;
inherit myPackages;
inherit devPackages;
};
devShells.default = pkgs.mkShell ./shell.nix {
inherit pkgs;
inherit myPackages;
inherit devPackages;
}
};
})
Expand All @@ -1152,6 +1156,8 @@ pkgs.dockerTools.buildImage {

---

## .gitlab-ci.yml

```bash{17-18|19-24}
publish:docker:ci:
stage: pre
Expand Down Expand Up @@ -1284,11 +1290,16 @@ same Dockerfile can (and often do) end up with two different images.
---

```vim
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
nix flake init --template "https://flakehub.com/f/the-nix-way/dev-templates/*#go"
curl --proto '=https' --tlsv1.2 -sSf -L \
https://install.determinate.systems/nix | sh -s -- install
nix flake init --template \
"https://flakehub.com/f/the-nix-way/dev-templates/*#go"
nix profile install nixpkgs#nix-direnv
```


{{% /section %}}

---
Expand All @@ -1306,11 +1317,6 @@ nix profile install nixpkgs#nix-direnv

<img width="70%" height="auto" data-src="images/nix-feature.jpg">

---

## Slides

- Slides: https://haseebmajid.dev/slides/go-lab-reproducible-envs-with-nix/

---

Expand Down Expand Up @@ -1362,11 +1368,18 @@ More about flakes:

---

<img width="50%" height="auto" data-src="images/qr-code.svg">

https://haseebmajid.dev/slides/go-lab-reproducible-envs-with-nix/

---

## References & Thanks

- GIFs made with [vhs](https://github.com/charmbracelet/vhs)
- Photos editted with [pixlr](https://pixlr.com/)
- All my friends who took time to give me feedback on this talk
- Some memes from https://github.com/gytis-ivaskevicius/high-quality-nix-content

{{% note %}}
Don't forget to thank the audience.
Expand Down
1,236 changes: 1,236 additions & 0 deletions content/slides/go-lab-reproducible-envs-with-nix/images/qr-code.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content/slides/go-lab-reproducible-envs-with-nix/slides.pdf
Binary file not shown.
Loading

0 comments on commit d9a207f

Please sign in to comment.