summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--flake.nix9
-rw-r--r--pkgs/default.nix46
2 files changed, 37 insertions, 18 deletions
diff --git a/flake.nix b/flake.nix
index 2c87557..53acf63 100644
--- a/flake.nix
+++ b/flake.nix
@@ -50,14 +50,13 @@
let
system = "x86_64-linux";
- pkgs = pkgsNoLocal.extend self.overlays.default;
- pkgsNoLocal = importPkgs nixpkgs;
+ pkgs = importPkgs nixpkgs;
importPkgs = flake: import flake {
inherit system;
config = import ./pkgs/config nixpkgs.lib;
- overlays = [ nur.overlay ];
+ overlays = [ nur.overlay self.overlays.default ];
};
util = import ./util;
@@ -67,7 +66,7 @@
in
with pkgs.lib; {
formatter.${system} = pkgs.nixpkgs-fmt;
- packages.${system} = local pkgs pkgsNoLocal;
+ packages.${system} = pkgs.local;
overlays.default = final: prev:
let
@@ -75,7 +74,7 @@
in
{
local = locals;
- unstable = (importPkgs unstable).extend self.overlays.default;
+ unstable = importPkgs unstable;
} // locals.override;
nixosConfigurations =
diff --git a/pkgs/default.nix b/pkgs/default.nix
index 9fd6fd9..a299b8b 100644
--- a/pkgs/default.nix
+++ b/pkgs/default.nix
@@ -1,5 +1,5 @@
final: prev:
-let
+with prev.lib; let
inherit (final) callPackage fetchpatch;
in
{
@@ -27,16 +27,36 @@ in
];
};
- override = {
- python3 = prev.python3.override {
- packageOverrides = nextPy: prevPy: {
- cocotb = nextPy.callPackage ./cocotb { inherit (prevPy) cocotb; };
- cocotbext-wishbone = nextPy.callPackage ./cocotb/exts/wishbone.nix { };
- find-libpython = nextPy.callPackage ./find-libpython.nix { };
- hdl-convertor = nextPy.callPackage ./hdl-convertor { };
- hdl-convertor-ast = nextPy.callPackage ./hdl-convertor/ast.nix { };
- iced-x86 = nextPy.callPackage ./iced-x86 { };
- };
- };
- };
+ override =
+ let
+ makePyOverrides = version:
+ let
+ name = "python3${toString version}";
+ in
+ {
+ inherit name;
+
+ value = prev.${name}.override {
+ packageOverrides = nextPy: prevPy: {
+ cocotb = nextPy.callPackage ./cocotb { inherit (prevPy) cocotb; };
+ cocotbext-wishbone = nextPy.callPackage ./cocotb/exts/wishbone.nix { };
+ find-libpython = nextPy.callPackage ./find-libpython.nix { };
+ hdl-convertor = nextPy.callPackage ./hdl-convertor { };
+ hdl-convertor-ast = nextPy.callPackage ./hdl-convertor/ast.nix { };
+ iced-x86 = nextPy.callPackage ./iced-x86 { };
+ };
+ };
+ };
+
+ pyVersionRange' = start: end:
+ let
+ next = end + 1;
+ in
+ if prev ? "python3${toString next}"
+ then pyVersionRange' start next
+ else range start end;
+
+ pyVersionRange = start: pyVersionRange' start start;
+ in
+ listToAttrs (map makePyOverrides (pyVersionRange 9));
}