nix-repl | REPL for Nix | Code Editor library
kandi X-RAY | nix-repl Summary
kandi X-RAY | nix-repl Summary
REPL for Nix
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of nix-repl
nix-repl Key Features
nix-repl Examples and Code Snippets
Community Discussions
Trending Discussions on nix-repl
QUESTION
Trying to understand callPackage
, so looked up its implementation where it uses lib.functionArgs
(source), but there is already a builtins.functionArgs
primop, an alias of __functionArgs
(implemented in C).
lib.functionArgs
is defined as
ANSWER
Answered 2021-Apr-16 at 14:44lib.functionArgs
wraps builtins.functionArgs
in order to provide reflective access to generic functions.
This supports reflection with builtins.functionArgs
:
QUESTION
While trying out nix & nix repl:
...ANSWER
Answered 2020-Oct-25 at 15:40The thing your write after ?
is not an expression: it is an attribute path. This allows you to do powerful things like pkgs ? hello.src
which probes to see whether pkgs
has an attribute named hello
which has an attribute named src
.
When Nix evaluates a ? b
, Nix just looks at the name "b", it does not consider whether "b" is a variable in the local context. So pkgs ? n
is true if an only if pkgs
is a set with a member that literally is named "n".
Here is an example repl session that explores the issue. The last line shows a possible solution for what I think you are trying to do.
QUESTION
I wrote a very simple default.nix file with which I should be able to build the gnu hello package (similiar to nix-pills).
But now i've come across an error:
[jane@nixos:~/graphviz]$ nix-build -A hello
error: undefined variable 'pkgs' at /home/jane/graphviz/default.nix:3:47
this is the source code :
...ANSWER
Answered 2020-Feb-09 at 02:10The { }
syntax only defines a value. It does not bring the attributes in it into scope. You can use the rec { }
syntax which does do both.
QUESTION
nix repl
nix-repl> test = {"a"=10;}
nix-repl> test.a
nix-repl> 10
nix-repl> test.a=20
error: syntax error, unexpected '=' , expecting $end, at (string):1:7
...ANSWER
Answered 2020-Jan-20 at 21:34Values in nix
are immutable; you can't change the value of test.a
, because that would require changing the set. You can only create a new set with a different a
value.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install nix-repl
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page