Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaks documentation.nixos.includeAllModules #98

Open
lovesegfault opened this issue May 4, 2023 · 0 comments
Open

Breaks documentation.nixos.includeAllModules #98

lovesegfault opened this issue May 4, 2023 · 0 comments
Labels
bug Something isn't working properly

Comments

@lovesegfault
Copy link
Contributor

If you try to evaluate a config with both stylix and documentation.nixos.includeAllModules = true it fails with the following error:

error:
       … while evaluating a branch condition

         at /nix/store/ycwxxfi2yv4nd8y66bxdc8pww9mhjwgj-source/lib/attrsets.nix:596:13:

          595|             name: value:
          596|             if isAttrs value && cond value
             |             ^
          597|               then recurse (path ++ [name]) value

       … in the right operand of the AND (&&) operator

         at /nix/store/ycwxxfi2yv4nd8y66bxdc8pww9mhjwgj-source/lib/attrsets.nix:596:30:

          595|             name: value:
          596|             if isAttrs value && cond value
             |                              ^
          597|               then recurse (path ++ [name]) value

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: attribute 'lib' missing

       at /nix/store/j5w5w667z1lgkh37vi3sydm9hnbah9rx-modules/chromium/nixos.nix:5:5:

            4|   options.stylix.targets.chromium.enable =
            5|     config.lib.stylix.mkEnableTarget "Chromium, Google Chrome and Brave" true;
             |     ^
            6|

You can reproduce by building this flake:

{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    stylix.url = "github:danth/stylix";
    home-manager.url = "github:nix-community/home-manager";
  };

  outputs = { nixpkgs, home-manager, stylix, ... }: {
    nixosConfigurations.repro = nixpkgs.lib.nixosSystem {
      system = "x86_64-linux";
      modules = [
        home-manager.nixosModules.home-manager
        stylix.nixosModules.stylix
        ({ pkgs, ... }: {
          # Unimportant things to make the config eval
          boot.loader.grub.device = "/dev/sda1";
          fileSystems."/".device = "tmpfs";
          system.stateVersion = "23.05";

          # Relevant bits
          documentation = {
            enable = true;
            nixos.includeAllModules = true;
          };

          stylix.image = pkgs.fetchurl {
            url = "https://media.githubusercontent.com/media/lovesegfault/nix-config/bda48ceaf8112a8b3a50da782bf2e65a2b5c4708/users/bemeurer/assets/walls/plants-00.jpg";
            hash = "sha256-n8EQgzKEOIG6Qq7og7CNqMMFliWM5vfi2zNILdpmUfI=";
          };
        })
      ];
    };
  };
}
$ nix build .#nixosConfigurations.repro.config.system.build.toplevel
@danth danth added the bug Something isn't working properly label May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working properly
Projects
None yet
Development

No branches or pull requests

2 participants