From f3a3d8a631c6d578a6f6ca816a84200b47840d9c Mon Sep 17 00:00:00 2001 From: Joni Hendrickson Date: Thu, 23 Jul 2026 09:05:55 -0700 Subject: [PATCH] Add "without Flakelight" example to README.md Adds an example of the shell flake.nix which doesn't use Flakelight for comparison. Helpful for being able to see exactly what boilerplate is made unnecessary by Flakelight. --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index bedc7f7..bb22dd8 100644 --- a/README.md +++ b/README.md @@ -93,6 +93,28 @@ To use a different nixpkgs, you can instead use: } ``` +Without Flakelight or another flake library, a flake would have to generate +per-system `devShells.${system}.default` attributes with shell derivations: + +```nix +{ + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + outputs = { nixpkgs, ... }: + let + systems = [ "x86_64-linux" "aarch64-linux" ]; + eachSystem = f: nixpkgs.lib.genAttrs systems + (system: f nixpkgs.legacyPackages.${system}); + in + { + devShells = eachSystem (pkgs: { + default = pkgs.mkShell { + packages = [ pkgs.hello pkgs.coreutils ]; + }; + }); + }; +} +``` + ### Rust package The following is an example flake for a Rust project using `flakelight-rust`,