@@ 22,13 22,39 @@ to pull into scope, for example:
}
You can use a specific version of the Nix packages collection by setting the
-`pkgs` property in the import statement. By default, the `<nixpkgs>` path is
-used:
+`pkgs` property of the library. By default, the `<nixpkgs>` path is used:
with import (fetchTarball https://git.sr.ht/~evhan/beaker/archive/master.tar.gz) {
- pkgs = import <nixpkgs-unstable> {};
+ pkgs = your.nixpkgs.collection;
};
+==== With Flakes
+
+This project can be used directly with Nix flakes, using the same repository
+archive URL as an input.
+
+The following example will pin an input version of this project and force it
+to use the same version of `nixpkgs` as the flake itself. The `beaker` library
+will be passed to the `outputs` builder, and you can access the helpers for a
+specific system via `beaker.packages.${system}`:
+
+ {
+ inputs = {
+ beaker.url = "https://git.sr.ht/~evhan/beaker/archive/0.0.17.tar.gz";
+ beaker.inputs.nixpkgs.follows = "nixpkgs";
+ };
+
+ outputs = { self, nixpkgs, beaker }:
+ let
+ system = "x86_64-linux";
+ in {
+ packages.${system}.default = beaker.packages.${system}.eggProgram {
+ name = "example-flake";
+ src = ./.;
+ };
+ };
+ }
+
=== Fetching Egg Dependencies
[procedure] eggCache attrSet