-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathzb_defs.lua
82 lines (68 loc) · 2.41 KB
/
zb_defs.lua
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
-- Copyright 2024 The zb Authors
-- SPDX-License-Identifier: MIT
---@meta
loadfile = nil
dofile = nil
---@class derivation: userdata
---@field name string
---@field system string
---@field builder string
---@field args string[]
---@field drvPath string
---@field out string
---@field [string] string|number|boolean|derivation|(string|number|boolean|derivation)[]
---@operator concat:string
---Create a derivation (a buildable target).
---@param args { name: string, system: string, builder: string, args: string[], [string]: string|number|boolean|(string|number|boolean)[] }
---@return derivation
function derivation(args) end
--- Force a module to load.
--- @param x (any)
--- @return any
function await(x) end
--- Import a Lua file.
--- @param path (string)
--- @return any
function import(path) end
---Make a file or directory available to a derivation.
---@param p (string|{path: string, name: string?}) path to import, relative to the source file that called `path`
---@return string # store path of the copied file or directory
function path(p) end
---Adds a dependency on an existing store path.
---If the store object named by the path does not exist in the store,
---storePath raises an error.
---@param path string
---@return string
function storePath(path) end
---Store a plain file in the store.
---@param name string
---@param s string File contents
---@return string # store path
function toFile(name, s) end
---Create a derivation that downloads a URL.
---@param args {url: string, hash: string, name: string?, executable: boolean?}
---@return derivation
function fetchurl(args) end
---Create a derivation that extracts an archive.
---The source must be one of the following formats:
--- - .tar
--- - .tar.gz
--- - .tar.bz2
--- - .zip
---
---If stripFirstComponent is true (the default),
---then the root directory is stripped during extraction.
---@param args string|{src: string, name: string?, stripFirstComponent: boolean?}
---@return derivation
function extract(args) end
---Create a derivation that extracts an archive from a URL.
---This is a convenience wrapper around fetchurl and extract.
---@param args {url: string, hash: string, name: string?, stripFirstComponent: boolean?}
---@return derivation
function fetchArchive(args) end
os = {}
---Returns the value of the process environment variable `varname`
---or `nil` if the variable is not defined.
---@param varname string
---@return string|nil
function os.getenv(varname) end