fix: nixpkgs' are paths

This commit is contained in:
catvayor 2024-12-14 14:48:58 +01:00
parent 237f5efb85
commit cd2ef49dd9
Signed by: lbailly
GPG key ID: CE3E645251AC63F3

View file

@ -5,22 +5,22 @@ let
inherit (import sources.nix-patches { patchFile = ./patches; }) mkNixpkgsSrc; inherit (import sources.nix-patches { patchFile = ./patches; }) mkNixpkgsSrc;
unstable = { unstable = {
nixpkgs = import (mkNixpkgsSrc { nixpkgs = mkNixpkgsSrc {
src = sources.nixpkgs-unstable; src = sources.nixpkgs-unstable;
version = "unstable"; version = "unstable";
}) { }; };
home-manager = "${sources.home-manager-unstable}/nixos"; home-manager = "${sources.home-manager-unstable}/nixos";
nixvim = import sources.nixvim-unstable; nixvim = import sources.nixvim-unstable;
}; };
stable = { stable = {
nixpkgs = import (mkNixpkgsSrc { nixpkgs = mkNixpkgsSrc {
src = sources.nixpkgs-stable; src = sources.nixpkgs-stable;
version = "stable"; version = "stable";
}) { }; };
home-manager = "${sources.home-manager-stable}/nixos"; home-manager = "${sources.home-manager-stable}/nixos";
nixvim = import sources.nixvim-stable; nixvim = import sources.nixvim-stable;
}; };
inherit (unstable.nixpkgs) lib; inherit (import unstable.nixpkgs { }) lib;
nodes = lib.mapAttrs' (name: _: { nodes = lib.mapAttrs' (name: _: {
name = lib.removeSuffix ".nix" name; name = lib.removeSuffix ".nix" name;
@ -43,16 +43,16 @@ in
_: node: _: node:
lib.foldl ( lib.foldl (
pkgs: patch: pkgs: patch:
import (mkNixpkgsSrc { mkNixpkgsSrc {
src = pkgs; src = pkgs;
version = patch; version = patch;
}) { } }
) (if node.unstable then unstable else stable).nixpkgs (node.nixPatches or []) ) (if node.unstable then unstable else stable).nixpkgs (node.nixPatches or [ ])
) nodes-meta; ) nodes-meta;
nodeSpecialArgs = lib.mapAttrs (name: node: { nodeSpecialArgs = lib.mapAttrs (name: node: {
inherit (node) unstable; inherit (node) unstable;
self-version = (if node.unstable then unstable else stable) // { self-version = (if node.unstable then unstable else stable) // {
nixpkgs = nodeNixpkgs."${name}"; nixpkgs = nodeNixpkgs.${name};
}; };
}) nodes-meta; }) nodes-meta;
}; };