From 5ca82ffa08af81f36ec998e7f49f53af7496a93a Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Mon, 2 Nov 2026 19:53:17 +0100 Subject: pkgs/*: Use a `stable`/`unstable` marker in the filename --- pkgs/default.nix | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'pkgs/default.nix') diff --git a/pkgs/default.nix b/pkgs/default.nix index 4fdb94fe..bc7d70e7 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -6,16 +6,20 @@ inherit (unstable_pkgs) lib; mergePkgs = pkgs: lib.callPackageWith (extra_lib.warnMerge pkgs in_tree_pkgs "the ./pkgs/by-name set"); - callPackageStable = lib.callPackageWith (mergePkgs stable_pkgs); - callPackageUnstable = lib.callPackageWith (mergePkgs unstable_pkgs); + callPackageStable = mergePkgs stable_pkgs; + callPackageUnstable = mergePkgs unstable_pkgs; in_tree_pkgs = extra_lib.mkByName { baseDirectory = ./by-name; - fileName = "package.nix"; - finalizeFunction = name: value: - if value.stable - then callPackageStable value.pkg {} - else callPackageUnstable value.pkg {}; + fileRegex = "package.(stable|unstable).nix"; + finalizeFunction = name: pkgPathList: let + # When specifying a regex `mkByName` returns a list of candidates. + # But we know, that there can only be one. + pkgPath = builtins.head pkgPathList; + in + if (builtins.match "(stable)" (builtins.baseNameOf pkgPath)) == ["stable"] + then callPackageStable pkgPath {} + else callPackageUnstable pkgPath {}; }; in in_tree_pkgs -- cgit v1.3.1