Skip to content

Commit

Permalink
refac(cross): #0 cross system
Browse files Browse the repository at this point in the history
- Provide makes for many systems

Signed-off-by: Kevin Amado <[email protected]>
  • Loading branch information
kamadorueda committed Nov 1, 2022
1 parent 5149361 commit 83b5a85
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 45 deletions.
14 changes: 7 additions & 7 deletions flake.lock

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

53 changes: 15 additions & 38 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,52 +4,29 @@
{
description = "A DevSecOps framework powered by Nix!";

inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
};
inputs.nixpkgs.url = "github:nix-community/nixpkgs.lib";

outputs = {
self,
nixpkgs,
...
} @ inputs: let
makes = import ./default.nix {system = "x86_64-linux";};

lib.flakes.evaluate = {
inputs,
system,
}: let
evaluated = import ./src/evaluator/default.nix {
flakeInputs = inputs;
makesSrc = inputs.makes.outPath;
projectSrc = inputs.self.sourceInfo.outPath;
inherit system;
makeOutputsForSystem = system: {
apps.${system}.default = {
program = "${inputs.self.packages.${system}.default}/bin/m";
type = "app";
};
evaluatedOutputs =
nixpkgs.lib.mapAttrs'
(output: value: {
name = "config:outputs:${output}";
inherit value;
})
evaluated.config.outputs;
in {
__makes__ =
evaluatedOutputs
// {
"config:configAsJson" = evaluated.config.configAsJson;
};
};
in
(lib.flakes.evaluate {
inputs = inputs // {makes = self;};
system = "x86_64-linux";
})
// {
inherit lib;

defaultPackage.x86_64-linux = makes;
lib.${system} = import ./src/args/agnostic.nix {inherit system;};

defaultApp.x86_64-linux.program = "${makes}/bin/m";
defaultApp.x86_64-linux.type = "app";
packages.${system}.default = import ./default.nix {inherit system;};
};
in
builtins.foldl' nixpkgs.lib.recursiveUpdate {}
(builtins.map makeOutputsForSystem [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
]);
}

0 comments on commit 83b5a85

Please sign in to comment.