error: attempt to call something which is not a function but a set
at /home/haf/exobrain/shell.nix:4:15:
3| neuronSrc = builtins.fetchTarball "https://github.com/srid/neuron/archive/master.tar.gz";
4| neuronPkg = import neuronSrc {};
| ^
5| in
… while evaluating anonymous lambda
at /nix/store/8v8khi0pny77jn5fjypzzm1s5182ifip-nixos-21.05pre284548.1fe6ed37fd9/nixos/pkgs/stdenv/generic/make-derivation.nix:139:17:
138| (map (drv: drv.__spliced.buildBuild or drv) depsBuildBuild)
139| (map (drv: drv.nativeDrv or drv) nativeBuildInputs
| ^
140| ++ lib.optional separateDebugInfo' ../../build-support/setup-hooks/separate-debug-info.sh
… from call site
… while evaluating 'getOutput'
at /nix/store/8v8khi0pny77jn5fjypzzm1s5182ifip-nixos-21.05pre284548.1fe6ed37fd9/nixos/lib/attrsets.nix:482:23:
481| */
482| getOutput = output: pkg:
| ^
483| if pkg.outputUnspecified or false
… from call site
… while evaluating the attribute 'nativeBuildInputs' of the derivation 'nix-shell'
at /nix/store/8v8khi0pny77jn5fjypzzm1s5182ifip-nixos-21.05pre284548.1fe6ed37fd9/nixos/pkgs/stdenv/generic/make-derivation.nix:197:11:
196| // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
197| name =
| ^
198| let
I don’t know what I’m doing wrong since when I search for similar configurations they look like mine
This is a fairly simple syntax error. Your main issue is this: import neuronSrc { }, specifically the { }. If you take a look at the default.nix in the repository, it uses something called flake-compat and the important part of that is it outputs an attrset. And you can’t “call” attrsets like you can functions. So instead you can just do import neuronSrc.
To get the package that you want you can do something like this: neuronPkg.packages.${pkgs.system}.neuron. That is the place in the attribute set that the neuron package is stored. If your curious about the format, you can learn about nix flakes and the attrset “outputs” defined in the flake spec.
error: cannot coerce a set to a string
at /nix/store/8v8khi0pny77jn5fjypzzm1s5182ifip-nixos-21.05pre284548.1fe6ed37fd9/nixos/pkgs/stdenv/generic/make-derivation.nix:197:11:
196| // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
197| name =
| ^
198| let
… while evaluating the attribute 'nix' of the derivation 'nix-shell'
at /nix/store/8v8khi0pny77jn5fjypzzm1s5182ifip-nixos-21.05pre284548.1fe6ed37fd9/nixos/pkgs/stdenv/generic/make-derivation.nix:197:11:
196| // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
197| name =
| ^
198| let
Seems to be a problem with how I configured the binary cache, when I comment this part
nix.binaryCaches = [
"https://srid.cachix.org"
];
It works fine but spends too long compiling the packages. Any idea how I could use cachix declaratively in my shell.nix?
In your configuration.nix on lines 211 & 212, you have a } followed by a {. This is terminating the first attribute set and starting another. This happens again on lines 626 & 627.
Remove the { & } characters on those lines and that should fix the attempt to call something which is not a function but a set error.
There are other problems with your configuration, but start with this and see of the error messages are easier to understand for the other problems.
At the very bottom of your error message it says error: The option `boot.initrd.boot' does not exist.
In your config on lines 40 and 42, you’re setting the option boot.initrd.boot.
I recommend using a format tool on your configuration. I use nixpkgs-fmt. This would make it easier to see what options you’re using.
I also recommend using NixOS Search - Options for finding the options you’re looking for. (See here for a list of options that are valid in boot.initrd.)