home

My NixOS systems configurations.
Log | Files | Refs | LICENSE

moving-home-to-nix-flakes.org (1610B)


      1 #+TITLE: Moving =home= to nix flakes
      2 #+FILETAGS: #home nix dotfiles configuration
      3 
      4 This document is a /live/ document on moving this =monorepo= to using nix flakes. It will go
      5 through why as well as trying to dig around what was done for it.
      6 
      7 * Why flakes
      8 
      9 #+begin_quote
     10 Nix is a package manager that lets you have a more deterministic view of your software
     11 dependencies and build processes. One if its biggest weaknesses out of the box is that
     12 there are very few conventions on how projects using Nix should work together. It's like
     13 having a build system but also having to configure systems to run software yourself. This
     14 could mean copying a NixOS module out of the project's git repo, writing your own or
     15 more. In contrast to this, Nix flakes define a set of conventions for how software can be
     16 build, run, integrated and deployed without having to rely on external tools such as Niv
     17 or Lorri to help you do basic tasks in a timely manner.
     18 – from [[https://christine.website/blog/nix-flakes-1-2022-02-21]]
     19 #+end_quote
     20 
     21 Nix flakes seems to be more and more stable and usable, and thus, as I needed to
     22 re-install one of my laptop powered by NixOS, I felt I would migrate the repository
     23 towards nix flakes.
     24 
     25 The idea is to make this repository a "flake-enabled" repository while still working with
     26 the current setup I have (=niv=, =morph=, …).
     27 
     28 * Digging into the flake
     29 
     30 - Going with flake-utils-plus. Why ?
     31   For a "configuration" repository, I think it makes perfect sense. For standalone flakes,
     32   like projects, … I wouldn't say the same but for this one it does.
     33 
     34 #+include: "../flake.nix" src nix