Nix Flashcards
Nix commands
Abort Nix expression evaluation and print the error message s.
abort s
abort s
Abort Nix expression evaluation and print the error message s.
add e1 e2
Return the sum of the numbers e1 and e2.
Return the sum of the numbers e1 and e2.
add e1 e2
all pred list
Return true if the function pred returns true for all elements of list, and false otherwise.
Return true if the function pred returns true for all elements of list, and false otherwise.
all pred list
any pred list
Return true if the function pred returns true for at least one element of list, and false otherwise.
Return true if the function pred returns true for at least one element of list, and false otherwise.
any pred list
attrNames set
Return the names of the attributes in the set set in an alphabetically sorted list. For instance, builtins.attrNames { y = 1; x = “foo”; } evaluates to [ “x” “y” ].
Return the names of the attributes in the set set in an alphabetically sorted list. For instance, builtins.attrNames { y = 1; x = “foo”; } evaluates to [ “x” “y” ].
attrNames set
attrValues set
Return the values of the attributes in the set set in the order corresponding to the sorted attribute names.
Return the values of the attributes in the set set in the order corresponding to the sorted attribute names.
attrValues set
baseNameOf s
Return the base name of the string s, that is, everything following the final slash in the string. This is similar to the GNU basename command.
Return the base name of the string s, that is, everything following the final slash in the string. This is similar to the GNU basename command.
baseNameOf s
bitAnd e1 e2
Return the bitwise AND of the integers e1 and e2.
Return the bitwise AND of the integers e1 and e2.
bitAnd e1 e2
bitOr e1 e2
Return the bitwise OR of the integers e1 and e2.
Return the bitwise OR of the integers e1 and e2.
bitOr e1 e2
bitXor e1 e2
Return the bitwise XOR of the integers e1 and e2.
Return the bitwise XOR of the integers e1 and e2.
bitXor e1 e2
break v
n debug mode (enabled using –debugger), pause Nix expression evaluation and enter the REPL. Otherwise, return the argument v.
n debug mode (enabled using –debugger), pause Nix expression evaluation and enter the REPL. Otherwise, return the argument v.
break v
catAttrs attr list
Collect each attribute named attr from a list of attribute sets. Attrsets that don’t contain the named attribute are ignored. For example,
builtins.catAttrs “a” [{a = 1;} {b = 0;} {a = 2;}]
evaluates to [1 2].
Collect each attribute named attr from a list of attribute sets. Attrsets that don’t contain the named attribute are ignored. For example,
builtins.catAttrs “a” [{a = 1;} {b = 0;} {a = 2;}]
evaluates to [1 2].
catAttrs attr list