-
Notifications
You must be signed in to change notification settings - Fork 6
/
zb_defs.lua
63 lines (53 loc) · 1.9 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
-- Copyright 2024 The zb Authors
-- SPDX-License-Identifier: MIT
---@meta
---@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
---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
---Store a plain file in the store.
---@param name string
---@param s string File contents
---@return string # store path
function toFile(name, s) end
--- baseNameOf returns the last element of path.
--- Trailing slashes are removed before extracting the last element.
--- If the path is empty, baseNameOf returns "".
--- If the path consists entirely of slashes, baseNameOf returns "/".
---@param path string slash-separated path
---@return string
function baseNameOf(path) end
---Create a derivation that downloads a URL.
---@param args {url: string, hash: string, name: string?, executable: boolean?}
---@return derivation
function fetchurl(args) end
---Apply the function f to each element in list.
---@generic T, U
---@param f fun(T): U
---@param list T[]
---@return U[]
function table.map(f, list) end
---Reports whether a value equal to x occurs in list xs.
---@generic T
---@param x T
---@param xs T[]
---@return boolean
function table.elem(x, xs) end
---Concatenate lists into a single list.
---@generic T
---@param ... T[]
---@return T[]
function table.concatLists(...) end