-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathoptions.nix
71 lines (71 loc) · 2.26 KB
/
options.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
{
lib,
pkgs,
...
}:
{
options.services.process-compose-deploy = lib.mkOption {
default = { };
type = lib.types.attrsOf (
lib.types.submodule (
{ name, ... }:
{
options = {
enable = lib.mkEnableOption "process-compose instance";
environment = lib.mkOption rec {
type = lib.types.attrsOf (
lib.types.oneOf [
lib.types.str
lib.types.int
]
);
default = rec {
HOME = "/var/lib/process-compose/${name}";
PC_PROFILE_PATH = "${HOME}/profile";
PC_SOCKET_PATH = "${HOME}/sock";
};
example = {
PC_PORT_NUM = 8080;
};
description = ''
Environment variables for the process-compose.
'';
apply = lib.recursiveUpdate default;
};
environmentFile = lib.mkOption {
type = lib.types.nullOr lib.types.path;
default = null;
example = "/run/secrets/process-compose.env";
description = ''
Environment file to be passed to the systemd service.
Useful for passing secrets to the service to prevent them from being
world-readable in the Nix store.
'';
};
useUnixSocket = lib.mkEnableOption "use unix domain sockets instead of tcp" // {
default = true;
};
defaultProfile = lib.mkOption {
type = lib.types.path;
default = pkgs.writeShellScriptBin name ''
export PC_CONFIG_FILES=${
builtins.toFile "config.json" (
builtins.toJSON {
version = "0.5";
processes = { };
}
)
}
exec ${lib.getExe pkgs.process-compose} "$@"
'';
defaultText = "<process-compose script with empty config>";
description = ''
The process-compose-flake instance to start for the first time.
'';
};
};
}
)
);
};
}