Skip to content

Commit

Permalink
refac(build): #546 simplify scope and code
Browse files Browse the repository at this point in the history
- Refactor code so we know what's flake specific
- Limit scope of this experimental feature to linux x86-64
  • Loading branch information
kamadorueda committed Sep 17, 2021
1 parent 48776e7 commit f04f8ae
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 53 deletions.
18 changes: 9 additions & 9 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 34 additions & 14 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,42 @@
description = "A DevSecOps framework powered by Nix!";

inputs = {
flakeUtils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:nixos/nixpkgs";
};

outputs = { flakeUtils, ... }:
(flakeUtils.lib.eachDefaultSystem
(system:
let makes = import ./default.nix { inherit system; };
outputs = { nixpkgs, ... }:
let makes = import ./default.nix { system = "x86_64-linux"; };
in
{
defaultPackage.x86_64-linux = makes;

defaultApp.x86_64-linux.program = "${makes}/bin/m";
defaultApp.x86_64-linux.type = "app";

lib.flakes.evaluate =
{ inputs
, system
}:
let
evaluated = import ./src/evaluator/default.nix {
# TODO: Deprecate this
makesExecutionId = "123";
makesSrc = inputs.makes.outPath;
projectSrc = inputs.self.sourceInfo.outPath;
# TODO: Make it mutable
projectSrcMutable = inputs.self.sourceInfo.outPath;
inherit system;
};
evaluatedOutputs = nixpkgs.lib.mapAttrs'
(output: value: {
name = "makes:config:outputs:${output}";
inherit value;
})
evaluated.config.outputs;
in
{
defaultPackage = makes;
defaultApp.program = "${makes}/bin/m";
defaultApp.type = "app";
}))
// {
lib = {
fromFlake = import ./src/evaluator/from-flake.nix;
};
evaluatedOutputs // {
"makes:config:attrs" = evaluated.config.attrs;
"makes:config:cacheAsJson" = evaluated.config.cacheAsJson;
};
};
}
30 changes: 0 additions & 30 deletions src/evaluator/from-flake.nix

This file was deleted.

0 comments on commit f04f8ae

Please sign in to comment.