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
- Clone https://github.com/danielphan2003/digga-errors
- Run
nixos-rebuild switch --flake .#NixOS
Try comment out line 9 of nixos.nix and see the difference.
Expected Behavior
Accessing
self.libshould not throw infinite recursion.Current Behavior
In
flake.nix, withand
nixos.nixrefer to a function made inlib.nixviaself.lib, it throws infinite recursion.This is not the case for
home.nixthrough, and I created a repo to reproduce.Possible Solution
As a workaround, specify
selfexplicitly when importingnixos.nix, e.gSteps to Reproduce
nixos-rebuild switch --flake .#NixOSTry comment out line 9 of
nixos.nixand see the difference.