I’ve been working on my configuration for a while now using flakes. I can already understand the appeal of flake-parts, and my configuration has always been spread out across multiple files according to specific features. ATM I don’t really have any good modules to share, but what’s your opinion?

  • hallettj
    link
    fedilink
    English
    arrow-up
    1
    ·
    2 days ago

    I’ve come around to doing it this way too. systems is not automatically supplied as a flake input - you can get such an input like this:

    inputs = {
      systems.url = "github:nix-systems/default";
      # ...
    };
    outputs = { self, nixpkgs, systems }:
      let
        eachSystem = f: lib.genAttrs (import systems) (system: f nixpkgs.legacyPackages.${system});
      in
      {
        # ...
      } 
    

    The handy thing about importing another flake to get a list of four strings is that anyone consuming your flake can override that input in case they want to use a system that isn’t included in your original flake. There is more information at https://github.com/nix-systems/nix-systems