-
Notifications
You must be signed in to change notification settings - Fork 2
/
runtime.nix
49 lines (48 loc) · 1.59 KB
/
runtime.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
48
49
topLevel@{ flake-parts-lib, inputs, lib, ... }: {
imports = [
./common.nix
./systems.nix
./nixpkgs.nix
inputs.flake-parts.flakeModules.flakeModules
];
flake.flakeModules.runtime = {
imports = [
topLevel.config.flake.flakeModules.common
topLevel.config.flake.flakeModules.systems
topLevel.config.flake.flakeModules.nixpkgs
];
options.perSystem = flake-parts-lib.mkPerSystemOption (perSystem@{ pkgs, ... }: {
options.ml-ops.runtime = lib.mkOption {
description = lib.mdDoc ''
Common config shared among all `ml-ops.jobs.<name>` and `ml-ops.services.<name>`.
'';
type = lib.types.deferredModuleWith {
staticModules = [
(runtime: {
imports = [ perSystem.config.ml-ops.common ];
options.name = lib.mkOption {
type = lib.types.str;
default = runtime.config._module.args.name;
};
config.devenvShellModule.name = runtime.config.name;
options.launcher = lib.mkOption {
type = lib.types.deferredModuleWith {
staticModules = [
{
options.environmentVariables = lib.mkOption {
type = lib.types.attrsOf lib.types.str;
};
config.environmentVariables = runtime.config.environmentVariables;
}
];
};
default = { };
};
})
];
};
default = { };
};
});
};
}