blob: 4af7573bc6e6c3a3530f1781287f44b11977dc67 (
plain)
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
|
{ config, pkgs, lib, ... }:
with builtins // lib;
let
cfg = config.onboard;
in {
options.onboard = {
file = mkOption {
default = {};
type = types.attrsOf (types.submodule (pkgs.callPackage ../lib/file-type.nix {}));
apply = filterAttrs (_: v: v.enable);
};
devicePath = mkOption {
type = types.str;
readOnly = true;
internal = true;
default = "/mnt/onboard";
};
_createdFiles = mkOption {
type = types.package;
internal = true;
readOnly = true;
default = pkgs.buildEnv {
name = "onboard-files-created";
paths = mapAttrsToList (_: v: v._package) cfg.file;
extraPrefix = cfg.devicePath;
};
};
finalPackage = mkOption {
type = types.package;
readOnly = true;
internal = true;
default = pkgs.mergePaths {
name = "onboard-package";
paths = [
cfg._createdFiles
];
};
};
};
config = {
koboroot.include = mkAfter [ cfg.finalPackage ];
};
}
|