Skip to content

Commit

Permalink
feat(build): #546 packages
Browse files Browse the repository at this point in the history
- Expose everything as packages, pending to see
  how we can identify apps
  • Loading branch information
kamadorueda committed Sep 16, 2021
1 parent ebc235a commit 1e50a46
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 5 deletions.
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Daniel Salazar <[email protected]> Daniel Salazar <[email protected]>
Daniel Salazar <[email protected]> Daniel Salazar <[email protected]>
Daniel Salazar <[email protected]> Daniel Salazar <[email protected]>
David Arnold <[email protected]> David Arnold <[email protected]>
Fluid Attacks <[email protected]> Fluid Attacks <[email protected]>
Github Octocat <[email protected]> GitHub <[email protected]>
Kevin Amado <[email protected]> Kevin Amado <[email protected]>
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1963,7 +1963,8 @@ Types:
- helloWorld:
- enable (`boolean`): Optional.
Defaults to `false`.
- name (`string`): Required.Some test
- name (`string`):
Name of the user we should greet.
Example `makes.nix`:
Expand Down
9 changes: 7 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@
};

outputs = { flakeUtils, ... }:
flakeUtils.lib.eachDefaultSystem
(flakeUtils.lib.eachDefaultSystem
(system:
let makes = import ./default.nix { inherit system; };
in
{
defaultPackage = makes;
defaultApp.program = "${makes}/bin/m";
defaultApp.type = "app";
});
}))
// {
lib = {
fromFlake = import ./src/evaluator/from-flake.nix;
};
};
}
3 changes: 2 additions & 1 deletion src/args/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
, outputs
, projectSrc
, projectSrcMutable
, system
, ...
}:
let
agnostic = import ./agnostic.nix { };
agnostic = import ./agnostic.nix { inherit system; };

args = agnostic // {
inherit inputs;
Expand Down
5 changes: 4 additions & 1 deletion src/evaluator/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
# Path to the user's project, outside the sandbox.
# Only available when running local Makes projects.
, projectSrcMutable ? projectSrc
# System we should evaluate for
, system ? builtins.currentSystem
, ...
}:
let
Expand All @@ -46,8 +48,9 @@ let
outputs = result.config.outputs;
inherit projectSrc;
inherit projectSrcMutable;
inherit system;
};
nixpkgs = import sources.nixpkgs { };
nixpkgs = import sources.nixpkgs { inherit system; };
sources = import "${makesSrcOverriden}/src/nix/sources.nix";
result = nixpkgs.lib.modules.evalModules {
modules = [
Expand Down
22 changes: 22 additions & 0 deletions src/evaluator/from-flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{ inputs
, system
, ...
}:
let
evaluatorOutputs = import ./default.nix {
# TODO: How to compute this on Flakes?
makesExecutionId = "123";
makesSrc = inputs.makes.outPath;
projectSrc = inputs.self.sourceInfo.outPath;
# TODO: Make it mutable
projectSrcMutable = inputs.self.sourceInfo.outPath;
inherit system;
};

apps = { };
packages = evaluatorOutputs.config.outputs;
in
{
inherit apps;
inherit packages;
}

0 comments on commit 1e50a46

Please sign in to comment.