Skip to content

Commit

Permalink
Update channels selection filter logic
Browse files Browse the repository at this point in the history
  • Loading branch information
gytis-ivaskevicius authored and blaggacao committed Sep 5, 2021
1 parent 28ad5a2 commit e1eddbd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/mkFlake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ let
reverseList
;
inherit (builtins)
pathExists
attrNames
attrValues
concatMap
Expand Down Expand Up @@ -222,7 +223,9 @@ mergeAny otherArguments (
filterAttrs = pred: set:
listToAttrs (concatMap (name: let value = set.${name}; in if pred name value then [ ({ inherit name value; }) ] else [ ]) (attrNames set));

channelFlakes = filterAttrs (_: value: value ? legacyPackages) inputs;
# Little hack, we make sure that `legacyPackages` contains `nix` to make sure that we are dealing with nixpkgs.
# For some odd reason `devshell` contains `legacyPackages` out put as well
channelFlakes = filterAttrs (_: value: value.legacyPackages.x86_64-linux ? nix) inputs;
channelsFromFlakes = mapAttrs (name: input: { inherit input; }) channelFlakes;

importChannel = name: value: (import (patchChannel system value.input (value.patches or [ ])) {
Expand Down

0 comments on commit e1eddbd

Please sign in to comment.