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

Inconsistent behaviour when accessing self.lib in different places #482

Open
danielphan2003 opened this issue Jul 27, 2022 · 0 comments
Open
Labels
bug Something isn't working

Comments

@danielphan2003
Copy link

danielphan2003 commented Jul 27, 2022

Expected Behavior

Accessing self.lib should not throw infinite recursion.

Current Behavior

In flake.nix, with

lib = import ./lib.nix {lib = digga.lib // nixpkgs.lib;};
home = ./home.nix
nixos = ./nixos.nix

and nixos.nix refer to a function made in lib.nix via self.lib, it throws infinite recursion.

This is not the case for home.nix through, and I created a repo to reproduce.

Possible Solution

As a workaround, specify self explicitly when importing nixos.nix, e.g

nixos = import ./nixos.nix {inherit self;}

Steps to Reproduce

  1. Clone https://github.com/danielphan2003/digga-errors
  2. Run nixos-rebuild switch --flake .#NixOS
    Try comment out line 9 of nixos.nix and see the difference.
@danielphan2003 danielphan2003 added the bug Something isn't working label Jul 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant