-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflake.nix
31 lines (31 loc) · 1.2 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
{
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};
outputs = { self, nixpkgs, flake-compat }@inputs:
let
systems = nixpkgs.lib.platforms.linux;
lib = nixpkgs.lib;
packagePaths = rec {
rpi4_rt_5_15 = ./packages/linux_rpi4_rt_5_15;
rpi4_rt = rpi4_rt_5_15;
};
in rec {
packages = lib.genAttrs systems (system:
let
pkgs = (lib.mapAttrs (n: v:
lib.callPackageWith ((lib.recursiveUpdate packages.${system}
nixpkgs.legacyPackages.${system}) // { inherit inputs; }) v { }) packagePaths);
in (lib.mapAttrs' (n: v: lib.nameValuePair "linux_${n}" v) pkgs)
// (lib.mapAttrs' (n: v: lib.nameValuePair "linuxPackages_${n}" v.linuxPackages) pkgs));
legacyPackages = packages;
overlay = final: prev:
(lib.mapAttrs' (n: v: lib.nameValuePair "linux_${n}" (prev.callPackage v { raspberrypifw = prev.raspberrypifw; })) packagePaths)
// (lib.mapAttrs' (n: v: lib.nameValuePair "linuxPackages_${n}" final."linux_${n}") packagePaths)
// { raspberrypifw = final.linux_rpi4_rt.firmware; };
};
}