Error: attribute 'helix' missing

Following the NixOS & Flakes Book I am trying to add Helix as a system package in my Flake.

It looks quite simple. In flake.nix I firstly added the following line under inputs:
helix.url = "github:helix-editor/helix/master";

I have the following specialArgs value set:
specialArgs = { inherit inputs; };

Then, in configuration.nix I have added the helix parameter:
{ config, pkgs, helix, lib, inputs, ... }:

And, to install it / add it as system package:
helix.packages."${pkgs.system}".helix

When I try building I get:
error: attribute 'helix' missing

(For the record, here is my flake.nix, and here is my configuration.nix.)

Any ideas?

The things you put in specialArgs are provided as extra arguments when calling your nixos modules (like your configuration.nix).

Since you’re only passing inputs through, you’d need to do inputs.helix.packages.${pkgs.stdenv.hostPlatform.system}.helix. (pkgs.system is an alias to the longer string and I have aliases disabled, just fyi).

I’d recommend cleaning up the configuration.nix and removing the extra helix input, as you’re not passing that and it will be an error too (or is likely in fact the cause of the exact error you’re seeing now).

Also, please provide the full error with context next time, so we have a better idea exactly which helix it’s complaining about. :slight_smile: good luck!

1 Like

Thanks, @colemickens! I am trying to build now, and I will report back when I know if it works or not.

Regarding the outputting the full error, I am not managing to pipe error to a file that I can easily share. I will open a separate issue for that, to hopefully figure out how to do it.

It worked!

Regarding the error log:
Digging a bit, I found this Reddit post, and I realised I missed outputting stderr, so I have to do:
nixos-rebuild swtich &> logfile.txt
(instead of just nixos-rebuild swtich > logfile.txt)

So, next time I will provide a the full error!

1 Like