DavHau / mach-nix

Create highly reproducible python environments
MIT License
863 stars 106 forks source link

How to add overlays to nixpkgs when using as flake? #408

Open yajo opened 2 years ago

yajo commented 2 years ago

Hello. I have a simple overlay in my flake:

overlayPython36 = final: prev: {python36 = (import inputs.nixpkgs-21_05 {system = prev.system;}).python36;};

How am I supposed to pass that overlay to the nixpkgs input of mach-nix's flake?

@moduon MT-83

yajo commented 2 years ago

I finally found the workaround after several hours: not using the flake. Example:

  inputs = {
    mach-nix = {url="github:DavHau/mach-nix";flake=false;};
    ...
  };

  outputs = {self, nixpkgs, ... } @ inputs:
    let mach-nix = import inputs.mach-nix {inherit pkgs;};
        pkgs = import nixpkgs {
          inherit system;
          overlays = [ overlayPython36 ];
        };
        overlayPython36 = ...; # overlay from above
    ...
}

I still think there should be a simple way to pass overlays when using the flake as normal. 😕