Gerschtli / nix-config

A collection of my system configs and dotfiles
MIT License
71 stars 2 forks source link

[Question] Using overlay with two hosts how is rootPath used ? #9

Closed 573 closed 1 year ago

573 commented 1 year ago

I wonder how I would define an emacs derviation in the overlay with another derivation that provides the emacs config.

The emacs config derivation would read a file from rootPath/home/misc/emacs.el.

This same emacs derivation is used in both two hosts, this one and this one and it seems that is building successfully on the first one but not on the second one.

573 commented 1 year ago

I think changing this line(https://github.com/573/nix-config-1/blob/3e26831000a4ca1072922dd46b80c04d23a31c2a/flake/nixpkgs.nix#L229) to read my-default-el = final.runCommand "default.el" { inherit rootPath; }'' would surpass the issue but I still wonder how the first build above linked in OP could succeed then ?

Gerschtli commented 1 year ago

TBH it is really hard to help you because I don't know your setup and this big commit where you do a lot of stuff to my current master is not really easy to parse.

I also don't really understand the question. rootPath is just a variable pointing to the root directory of the flake, it is independent of host-specfic setups.

573 commented 1 year ago

IC my commit as monolithic as it is doesn't help here either (just wanted to prepare a setup close to your original fork bf I do a clean fork with real commits).

My question relates to my lack of understanding why the variable seems to be resolved correctly when using the mkNixondroid builder vs. not correctly when using the mkNixos builder as both are using the same overlay defined in flake/nixpkgs.nix. Anyway what complicates finding a possible answer is that an additional wsl2 module is involved here.

Closing this for now in case I find an answer I will add it.

Thanks for sharing your awesome config.

Gerschtli commented 1 year ago

the overlay is applied before calling any flake output builders. one gotcha may be that i apply the nix-on-droid overlay only for the pkgs for nix-on-droid (there is an arg in flake/nixpkgs.nix for it).

I am glad my config helps :) Had a lot of fun building it :D