pinpox / lollypops

Lollypop Operations - NixOS Deployment Tool
https://pinpox.github.io/lollypops/
GNU General Public License v3.0
118 stars 17 forks source link

Fails to evaluate with `documentation.nixos.includeAllModules = true` #2

Closed somasis closed 2 years ago

somasis commented 2 years ago

When rebuilding my local machine with nixos-rebuild and the lollypops module loaded, if the machine has documentation.nixos.includeAllModules = true in the configuration, it fails with this error:

error: attribute 'hostName' missing

       at /nix/store/gp7am0g169z5hfv1jcgyzv2x9hpdsaps-source/module.nix:96:22:

           95|         type = types.str;
           96|         default = "${config.networking.hostName}";
             |                      ^
           97|         description = "Host to deploy to";
(use '--show-trace' to show detailed location information)

Disabling it solves the error.

(nice job on being probably the easiest to configure flake-compatible deployment framework I've seen, by the way!)

pinpox commented 2 years ago

Do you have networking.hostName set on all hosts/configurations in your nixosConfigurations flake output? I'm getting an error when enabling documentation.nixos.includeAllModules, but different one.

[ahorn:rebuild] building the system configuration...
[ahorn:rebuild] error: infinite recursion encountered
[ahorn:rebuild]
[ahorn:rebuild]        at /nix/store/k15pfq5hmrpxyyg9cni3az7a8z11vmaa-source/lib/modules.nix:491:28:
[ahorn:rebuild]
[ahorn:rebuild]           490|         builtins.addErrorContext (context name)
[ahorn:rebuild]           491|           (args.${name} or config._module.args.${name})
[ahorn:rebuild]              |                            ^
[ahorn:rebuild]           492|       ) (lib.functionArgs f);
[ahorn:rebuild] (use '--show-trace' to show detailed location information)
task: Failed to run task "ahorn": task: Failed to run task "ahorn:rebuild": exit status 1

Not sure if it's the same bug, but I'll continue investigating and see how I can fix this.

EDIT: Full trace for reference: https://gist.github.com/pinpox/edb874416067048a044eae1656207cca Still not sure why this happens

pinpox commented 2 years ago

Upon further investigation this seems to be caused by a problem in the nixos module for the documentation. I've opened an issue here https://github.com/NixOS/nixpkgs/issues/181009 with more information.

pinpox commented 2 years ago

@somasis Could you try setting

documentation.nixos.options.splitBuild = false;

and reporting if the error persists for you?

somasis commented 2 years ago

As of the latest nixpkgs master, it seems it works fine with and without options.splitBuild = false (sorry for the long delay in response, I was without a computer for some time).

pinpox commented 2 years ago

As https://github.com/NixOS/nixpkgs/issues/181009#event-7145583416 is now also fixed/merged, I'll close this issue aswell.