Skip to main content

Static site, Nix flakes and GitLab

·2 mins

I was preparing a technical talk but later discarded it because I decided it wouldn’t have enough depth. Following are my notes from that.


Title:

Over-engineer your blog with Nix flakes, IaC (i.e. infrastructure as code) and CI/CD

Description:

Imagine you have a simple system that works with a handful of CLI commands and a few clicks on a cloud provider’s console. What happens if you tinker a little too much? Well, you could transform it into a declaratively defined and fully reproducible system that employs CI/CD.

This talk will introduce you to Nix package manager through a practical use case. Specifically, it’ll show how you can develop a website locally through a static-site generator like Hugo and deploy it for free on GitLab Pages.


  • Nix concepts:
    • Umbrella of projects, all similarly named:
      • Nix as package manager.
        • Purely functional package manager.
      • NixOS.
      • Nix language.
      • Nixpkgs.
    • Why Nix?
      • Reproducible.
      • Declarative.
      • Reliable.
      • Vibrant community.
  • Overall things to cover:
    • Nix flakes.
    • Hugo.
    • GitLab pages, with custom domains maybe.
  • What a regular system looks like? (Hugo CLI installed through Home Brew, Netlify console etc.)
  • Why do it?
    • No good reason if your current setup works.
    • Benefits:
      • No need for Git submodules.
      • No need to separately manage Hugo versions - such as, ensuring version locally is same as on Netlify.
      • Reproducible?
  • How to update the dependencies later.

Notes:

  • CI - continuous maybe misleading.
  • Show before tell?
    • Start with the problem. Problem driven.
    • Spend time on complexity.
    • Cross-technology? Across Java, Python etc.