M default.nix => default.nix +2 -0
@@ 3,6 3,8 @@
with pkgs;
rec {
+ beaker = import ./beaker.nix { inherit pkgs; };
+
eggCache = {
name ? "eggs",
eggs, hash,
M flake.nix => flake.nix +4 -4
@@ 3,17 3,17 @@
let
systems = [ "aarch64-linux" "aarch64-darwin" "x86_64-darwin" "x86_64-linux" ];
forAllSystems = nixpkgs.lib.genAttrs systems;
- callForSystem = path: system: nixpkgs.legacyPackages.${system}.callPackage path {};
- eggHelper = name: system: args: (callForSystem ./. system).${name} args;
+ callForSystem = system: nixpkgs.legacyPackages.${system}.callPackage ./. {};
+ eggHelper = name: system: args: (callForSystem system).${name} args;
in {
- lib = forAllSystems (callForSystem ./.) // {
+ lib = forAllSystems callForSystem // {
eggCache = { system, ... } @ args: eggHelper "eggCache" system args;
eggDerivation = { system, ... } @ args: eggHelper "eggDerivation" system args;
eggProgram = { system, ... } @ args: eggHelper "eggProgram" system args;
};
packages = forAllSystems (system: rec {
- beaker = callForSystem ./beaker.nix system;
+ beaker = (callForSystem system).beaker;
default = beaker;
});
};
M nix.md => nix.md +6 -4
@@ 32,10 32,11 @@ You can use a specific version of the Nix packages collection by setting the
To use this project with Nix flakes, add the archive URL as an input.
-The following example will pin a version of this project as an input and force
-it to use the same version of `nixpkgs` as the flake itself. The `beaker`
-library is be passed to the `outputs` builder, and you can access the helpers
-for a specific system via `beaker.lib.${system}`:
+The following example will pin a version of this project as an input and
+force it to use the same version of `nixpkgs` as the flake itself. The
+`beaker` library is passed to your `outputs` function, and you can
+access the helpers for a specific system via `beaker.lib.${system}` or
+the egg itself as `beaker.packages.${system}.beaker`:
{
inputs = {
@@ 50,6 51,7 @@ for a specific system via `beaker.lib.${system}`:
packages.${system}.default = beaker.lib.${system}.eggProgram {
name = "example-using-flakes";
src = ./.;
+ buildInputs = [ beaker.packages.${system}.beaker ];
};
};
}