-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
47 lines (44 loc) · 1.53 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{
description =
"Create common system regardless of system architecture or context.";
outputs = { self, ... }: {
lib.commonSystem = { roots, inputs, ... }@userArgs:
let
inherit (inputs.nixpkgs) lib;
inherit (lib.attrsets) recursiveUpdate;
vars = import ./src/vars.nix;
util = import ./src/util.nix { inherit lib vars; };
applyDefaults = recursiveUpdate {
injectX86AsXpkgs = false;
systems = vars.supportedSystems;
contexts = vars.supportedContexts;
configs.nix = {
extraOptions = "experimental-features = nix-command flakes";
};
configs.nixpkgs = { };
configs.home-manager = { };
configs.nix-darwin = { };
overlays = [ ];
packages = [ ];
modules = [ ];
};
args = applyDefaults userArgs;
gen = import ./src/generators.nix { inherit inputs args util; };
in {
# Produce map of <system>.<context>.<profile>
packages = with gen;
# For Each System type:
eachSystem (system:
# and for each context:
eachContext (context:
# and for Each Profile:
eachProfile (profile:
let
user = userByProfile."${profile}";
make = makeByCtx."${context}";
pkgs = pkgsBySystem."${system}";
xpkgs = xpkgsBySystem.${system};
in make { inherit system user pkgs xpkgs; })));
};
};
}