File System Object

Title: File System Object

Typecombining
RequiredNo
Additional propertiesAny 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.

PropertyTypePatternTitle/Description
+ typeenum (of string)No-

1. Property Regular File

Title: Regular File

Typeobject
RequiredNo
Additional propertiesNot allowed
Defined inIn this schema

Description: See Regular File in the manual for details.

PropertyTypePatternTitle/Description
- typeconstNo-
+ contentsstringNoFile contents
- executablebooleanNoWhether the file is executable.

1.1. Property type

Typeconst
RequiredNo

Specific value: "regular"

1.2. Property contents

Typestring
RequiredYes

Description: File contents

1.3. Property executable

Typeboolean
RequiredNo
Defaultfalse

Description: Whether the file is executable.

2. Property Directory

Title: Directory

Typeobject
RequiredNo
Additional propertiesNot allowed
Defined inIn this schema

Description: See Directory in the manual for details.

PropertyTypePatternTitle/Description
- typeconstNo-
+ entriesobjectNoMap of names to nested file system objects (for type=directory)

2.1. Property type

Typeconst
RequiredNo

Specific value: "directory"

2.2. Property entries

Typeobject
RequiredYes
Additional propertiesEach additional property must conform to the schema

Description: Map of names to nested file system objects (for type=directory)

PropertyTypePatternTitle/Description
- objectNoFile System Object

2.2.1. Property File System Object

Title: File System Object

Typecombining
RequiredNo
Additional propertiesAny type allowed
Same definition asFile 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.

Title: Symbolic Link

Typeobject
RequiredNo
Additional propertiesNot allowed
Defined inIn this schema

Description: See Symbolic Link in the manual for details.

PropertyTypePatternTitle/Description
- typeconstNo-
+ targetstringNoTarget path of the symlink.

3.1. Property type

Typeconst
RequiredNo

Specific value: "symlink"

3.2. Property target

Typestring
RequiredYes

Description: Target path of the symlink.

4. Property type

Typeenum (of string)
RequiredYes

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"
}