New error while trying to install flake! Yay!

I dont even know how to describe this error. Heres an image:

Add a / to the beginning of your home.homeDirectory setting, whether you set that in the NixOS or home-manager module.

If you can’t figure it out, share your code (in text format, use a pastebin you can submit to with curl).

1 Like

It seems like it worked, hold on.

Yep, no more errors. Thank you so much! Its my first time installing an OS from liveISO

Now it shows this:

What do i do?

(Idk how to use curl, my bad)

faceslap

I mounted the boot partition on mtn/boot…

As you are using HM as a system module, you don’t need to or are even supposed to set home.username and home.homeDirectory. The integration module takes care of this for you.

Maybe this is getting off track, but I also set home.username and home.homeDirectory
So it’s probably in a very public-facing tutorial/sample-file somewhere (or most likely multiple)
For example hte “NixOS and Flakes Book” sets it manually even though it is set-up as a nixos module:

A more general way of solving this would be to make a tool (or if it exists make it better known) that shows you all your redundant settings, everywhere you set something explicitly to its default value

There is man configuration.nix, NixOS Search and nixos-option. These are different ways of surfacing the documentation for NixOS options, and all three show the default value. Home manager has analogues like man home-configuration.nix and others.

I was thinking something more automated:

> my-redundancy-tool
warning: home.username is set to `"my-user"`, but its default expression evaluates to the same: `<potentially complex logic>`

@NobbZ
How do you know that ? (literal question, not doubting you)
I was not able to find any documentation on it, for example here is what man home-configuration.nix prints:

     home.username
         The user’s username.

         Type: string

         Default:

             "$USER"   for state version < 20.09,
             undefined for state version ≥ 20.09

         Example:

             "jane.doe"

         Declared by:
             <home-manager/modules/home-environment.nix>

Notice in particular the default value of undefined, which would make me assume I should set this explicitly !

Home Manager Manual has only 3 mentions of home.username, and doesn’t talk about it being set by default
It’s even worse because those mentions are from examples, such as “Configuration Example”, so it would be reasonable to assume it is an example of what should be done, regardless of setup

It is undocumented, though looking at how the integration is implemented, and the errors that appear if you try to set the value to something that is different then the infered default, then you realize it is “not supposed to be touched”.

Its one of these, you won’t notice until you run into it problems, and I have seen hundreds running into it over the last 6 years of using NixOS.

Oh, I see, do you think you could contribute some documentation ?
It feels particularly worthwhile since it’s something a big portion of the ecosystem will interact with

No. I am using HM, and happy to help poeple in the forum or chat, though I am not in the mood to contribute to HM itself. My first and second hand experience with the team was not smooth and I came to the conclusion to just avoid direct interaction with the repo for the time being.