Repository navigation
Expand file tree
/
Copy pathsettingspec.toml
More file actions
83 lines (74 loc) · 3.24 KB
/
Copy pathsettingspec.toml
File metadata and controls
83 lines (74 loc) · 3.24 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
[spec] # Optional: Declare the specification here
profile.key = "SETTINGSPEC_PROFILE" # Default: Environment variable name to switch between profiles
profile.options = [ # Optional: Enables strict checking of per-profile declarations
"dev",
"stage",
"prod",
]
profile.default = "dev" # Optional: Default profile when the switch is not set
envfile.default = ".env" # Default environment file
envfile.stage = ".env.age" # Also supports age encrypted env files
envfile.prod = "-" # Read from stdin, encrypted or not
decryption.key.env = "SETTINGSPEC_DECRYPTION_KEY" # Default: Environment variable name to read the decryption key from
decryption.key.path = "~/.ssh/" # Default: Fallback lookup path(s) for the decryption key (can be list)
# export.file = true # Default: Export all settings into settings.toml
export.file = { # Optional: Fine-grained control over what to export
"settings.toml" = true,
"settings.py" = true,
"settings.lua" = true,
"settings.js" = true,
"settings.ts" = true,
"settings.rs" = true,
"settings.go" = true,
"settings.zig" = true,
"settings.c" = true,
"settings.cpp" = true,
"Settings.java" = true,
"settings.elm" = true,
"settings.rb" = true,
"settings.scala" = true,
"settings.hs" = true,
"settings.tf" = true,
"settings.env" = true,
"settings.yaml" = {
key1 = true,
group1 = true,
group2.subgroup = true,
group3.subgroup.key1 = false,
},
"settings.json" = {
"#tag1" = true, # Export all settings with tag1
group2 = false, # Exclude this setting from export
},
}
export.skip_gitignore = false # Default: Auto-append exported files to .gitignore if inside a git repo
export.mode = 0x600 # Default: File permission mode for the exported files
export.keep = false # Default: Cleanup the exported files after the program exits
export.stdout = "toml" # Optional: Print in toml format
export.env = "PREFIX_" # Optional: Export as environment variables prefixed with this string
export.stdin = "toml" # Optional: Pass settings to program stdin in specified format
[settings] # Declare the settings here with syntax: `<key>._.<profile>.<directive> = <value>`
key1._.default.val = "val1" # Default value for all profiles
key1._.prod.val = "prod1" # Override the default value when SETTINGSPEC_PROFILE=prod
key2._ = { # Strictly define different values for different profiles
dev.null = true, # When SETTINGSPEC_PROFILE=dev, key2=null
stage.val = "stage2",
prod.env = "KEY2", # When SETTINGSPEC_PROFILE=prod, key2 is read from the environment variable KEY2
}
group1.key1._.default.val = "group1val1"
group1.key1._.tags = ["tag1", "tag2"] # Optional: Tags for the setting
[settings.group2.subgroup]
key1._.default.val = "group2val1"
key2._.default.val = "group2val2"
key3._.default.val = "group2val3"
key3._.tags = ["tag1"]
[settings.group3.subgroup]
key1._.default.val = "group3val1"
key2._.default.val = "group3val2"
key3._.default.val = "group3val3"
key3._.tags = ["tag2"]
[settings.group4] # These work as we expect
key1._.default.val = { val = 1 }
key2._.default.val = { default = { val = 1 } }
key3._.default.val = { default = { null = true } }
key4._.default.val = { default = { val = { null = true } } }