From 3fa96d61b0f5fe58b00341f63a5987aee07af6d2 Mon Sep 17 00:00:00 2001 From: catvayor Date: Fri, 25 Oct 2024 18:09:45 +0200 Subject: [PATCH] feat(overlay): with overlay --- default.nix | 9 ++++----- overlay.nix | 6 ++++++ python_overlay.nix | 6 ++++++ 3 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 overlay.nix create mode 100644 python_overlay.nix diff --git a/default.nix b/default.nix index 12bc932..9cb4d12 100644 --- a/default.nix +++ b/default.nix @@ -1,5 +1,4 @@ -{ pkgs, lib ? pkgs.lib }: with lib; -mapAttrs' (name: _: { - value = pkgs.python3.pkgs.callPackage (./python-pkgs/${name}) { }; - name = removeSuffix ".nix" name; -}) (builtins.readDir ./python-pkgs) +{ + pkgs ? (import { }), +}: +import pkgs.path { overlays = pkgs.overlays ++ [ (import ./overlay.nix) ]; } diff --git a/overlay.nix b/overlay.nix new file mode 100644 index 0000000..a91af86 --- /dev/null +++ b/overlay.nix @@ -0,0 +1,6 @@ +final: prev: with prev.lib; { + python3 = prev.python3.override { + packageOverrides = import ./python_overlay.nix; + }; + python3Packages = final.python3.pkgs; +} diff --git a/python_overlay.nix b/python_overlay.nix new file mode 100644 index 0000000..3dc4b4f --- /dev/null +++ b/python_overlay.nix @@ -0,0 +1,6 @@ +final: prev: +with prev.lib; +mapAttrs' (name: _: { + value = final.callPackage (./python-pkgs/${name}) { }; + name = removeSuffix ".nix" name; +}) (builtins.readDir ./python-pkgs)