-
Notifications
You must be signed in to change notification settings - Fork 47
/
Copy pathnixpkgs.nix
32 lines (28 loc) · 901 Bytes
/
nixpkgs.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Nixpkgs module. The only exception to the rule.
# Provides a `pkgs` argument in `perSystem`.
topLevel@{ config, options, inputs, lib, flake-parts-lib, ... }:
let
inherit (flake-parts-lib) mkPerSystemOption;
in
{
imports = [ inputs.nixpkgs.flakeModules.default ];
options = {
perSystem = mkPerSystemOption ({ config, system, ... }:
let
finalOverlay = lib.composeManyExtensions
# Last element has priority, so `perSystem` overlays rule
(topLevel.config.nixpkgs.overlays ++ config.nixpkgs.overlays);
finalPkgs = config.nixpkgs.mkPkgsFromArgs {
localSystem = { inherit system; };
overlays = [ finalOverlay ];
};
in
{
imports = [ inputs.nixpkgs.flakeModules.default ];
_file = ./nixpkgs.nix;
config = {
_module.args.pkgs = lib.mkForce finalPkgs;
};
});
};
}