As in the title; when I use attrValues overlays
, such as in the following example:
{
description = "Shared settings for our packages!";
inputs = {
nixpkgs.url = github:NixOS/nixpkgs/nixos-22.05;
flake-utils.url = github:numtide/flake-utils;
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};
outputs = inputs@{ self, nixpkgs, flake-utils, ... }: with builtins; with flake-utils.lib; let
lib = import ./package.nix nixpkgs;
overlays = with lib; rec {
overlays = let
lib-overlay = import ./overlay.nix nixpkgs;
in j.foldToSet' [
{
lib = lib-overlay;
default = lib-overlay;
}
(j.imports.overlaySet {
dir = ./callPackages/python2;
func = file: final: prev: j.update.python.callPython.two final prev file;
})
(j.imports.overlaySet {
dir = ./callPackages/python3;
func = file: final: prev: j.update.python.callPython.three final prev file;
})
(j.imports.set { dir = ./overlays; recursive = true; ignores.dirs = true; })
(j.imports.overlaySet { dir = ./callPackages; call = 1; })
];
overlay = overlays.default;
defaultOverlay = overlay;
};
make = system: with lib; rec {
# This does not work
legacyPackages = import nixpkgs { inherit system; overlays = attrValues overlays.overlays; };
# This works
legacyPackages = import nixpkgs { inherit system; overlays = with overlays.overlays; [ overlays.overlays.lib Python autoslot ]; };
# Traced here
packages = flattenTree (let _ = j.filters.has.attrs legacyPackages (unique (flatten [
(subtractLists (attrNames nixpkgs.legacyPackages.${system}) (attrNames legacyPackages))
(attrNames overlays.overlays)
])); in trace (attrNames legacyPackages.Python.pkgs.autoslot) _);
package = packages.default;
defaultPackage = package;
apps.default = settings.make.app package;
app = apps.default;
defaultApp = app;
devShells.default = import ./devShell.nix system self;
devShell = devShells.default;
defaultdevShell = devShell;
};
in (eachSystem allSystems make) // overlays // { inherit lib; };
}
Specifying overlays manually works, while attrValues overlays.overlays
does not, giving me the error error: attribute 'autoslot' missing
.
The reason for this were the Python Packages not updating with each new overlay; solved by Jan Tojnar's reply here:
overlays =
let
emptyOverlay = final: prev: {};
in
{
autoslot = final: prev: {
python310 = prev.python310.override (prevArgs: {
packageOverrides =
let
ourOverlay = new: old: {
autoslot = new.callPackage ./autoslot.nix {};
};
in
prev.lib.composeExtensions
prevArgs.packageOverrides or emptyOverlay
ourOverlay;
});
};
backtrace = final: prev: {
python310 = prev.python310.override (prevArgs: {
packageOverrides =
let
ourOverlay = new: old: {
backtrace = new.callPackage ./backtrace.nix {};
};
in
prev.lib.composeExtensions
prevArgs.packageOverrides or emptyOverlay
ourOverlay;
});
};
}