forked from gytis-ivaskevicius/flake-utils-plus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
49 lines (38 loc) · 1.24 KB
/
flake.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{
description = "FUP exporters demo";
inputs = {
nixpkgs.url = github:nixos/nixpkgs/release-21.05;
unstable.url = github:nixos/nixpkgs/nixos-unstable-small;
utils.url = path:../../;
};
outputs = inputs@{ self, nixpkgs, utils, ... }:
let
inherit (utils.lib) exportOverlays exportPackages exportModules;
in
utils.lib.mkFlake {
inherit self inputs;
# Channel specific overlays. Overlays `coreutils` from `unstable` channel.
channels.nixpkgs.overlaysBuilder = channels: [
(final: prev: { inherit (channels.unstable) ranger; })
];
# Propagates to channels.<name>.overlaysBuilder
sharedOverlays = [
self.overlay
];
hosts.Morty.modules = with self.nixosModules; [
Morty
];
nixosModules = exportModules [
./hosts/Morty.nix
];
# export overlays automatically for all packages defined in overlaysBuilder of each channel
overlays = exportOverlays {
inherit (self) pkgs inputs;
};
outputsBuilder = channels: {
# construct packagesBuilder to export all packages defined in overlays
packages = exportPackages self.overlays channels;
};
overlay = import ./overlays;
};
}