summaryrefslogtreecommitdiff
path: root/modules/darwin/base/nix.nix
blob: c8536500d726ed6cb911968eeee65033a2f90434 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
  config,
  lib,
  inputs,
  ...
}: let
  inherit (builtins) attrNames map;
  inherit (lib) mkIf;
  cfg = config.base.nix-settings;

  channelPath = i: "${inputs.${i}.outPath}";

  mapInputs = fn: map fn (attrNames inputs);
in {
  config = mkIf cfg.enable {
    nix.nixPath = mapInputs (i: "${i}=${channelPath i}");
  };
}