File System Object
Title: File System Object
| Type | combining |
| Required | No |
| Additional properties | Any type allowed |
Description: This schema describes the JSON representation of Nix's File System Object.
The schema is recursive because file system objects contain other file system objects.
| Property | Type | Pattern | Title/Description |
|---|---|---|---|
| + type | enum (of string) | No | - |
| Any of(Option) |
|---|
| Regular File |
| Directory |
| Symbolic Link |
1. Property Regular File
Title: Regular File
| Type | object |
| Required | No |
| Additional properties | Not allowed |
| Defined in | In this schema |
Description: See Regular File in the manual for details.
| Property | Type | Pattern | Title/Description |
|---|---|---|---|
| - type | const | No | - |
| + contents | string | No | File contents |
| - executable | boolean | No | Whether the file is executable. |
1.1. Property type
| Type | const |
| Required | No |
Specific value: "regular"
1.2. Property contents
| Type | string |
| Required | Yes |
Description: File contents
1.3. Property executable
| Type | boolean |
| Required | No |
| Default | false |
Description: Whether the file is executable.
2. Property Directory
Title: Directory
| Type | object |
| Required | No |
| Additional properties | Not allowed |
| Defined in | In this schema |
Description: See Directory in the manual for details.
| Property | Type | Pattern | Title/Description |
|---|---|---|---|
| - type | const | No | - |
| + entries | object | No | Map of names to nested file system objects (for type=directory) |
2.1. Property type
| Type | const |
| Required | No |
Specific value: "directory"
2.2. Property entries
| Type | object |
| Required | Yes |
| Additional properties | Each additional property must conform to the schema |
Description: Map of names to nested file system objects (for type=directory)
2.2.1. Property File System Object
Title: File System Object
| Type | combining |
| Required | No |
| Additional properties | Any type allowed |
| Same definition as | File System Object |
Description: This schema describes the JSON representation of Nix's File System Object.
The schema is recursive because file system objects contain other file system objects.
3. Property Symbolic Link
Title: Symbolic Link
| Type | object |
| Required | No |
| Additional properties | Not allowed |
| Defined in | In this schema |
Description: See Symbolic Link in the manual for details.
3.1. Property type
| Type | const |
| Required | No |
Specific value: "symlink"
3.2. Property target
| Type | string |
| Required | Yes |
Description: Target path of the symlink.
4. Property type
| Type | enum (of string) |
| Required | Yes |
Must be one of:
- "regular"
- "symlink"
- "directory"
Examples
Simple
{
"contents": "asdf",
"executable": false,
"type": "regular"
}
Complex
{
"entries": {
"bar": {
"entries": {
"baz": {
"contents": "good day,\n\u0000\n\tworld!",
"executable": true,
"type": "regular"
},
"quux": {
"target": "/over/there",
"type": "symlink"
}
},
"type": "directory"
},
"foo": {
"contents": "hello\n\u0000\n\tworld!",
"executable": false,
"type": "regular"
}
},
"type": "directory"
}