-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathflake.nix
86 lines (80 loc) · 2.66 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
{
description = "OpenCore bootloader manager with Nix";
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
inputs.utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, utils, ... }: with utils.lib;
rec {
lib = {
oc = (import ./lib/stdlib-extended.nix nixpkgs.lib).oc;
OpenCoreConfig =
{ modules ? [ ]
, pkgs
, lib ? pkgs.lib
, extraSpecialArgs ? { }
, check ? true
}@args:
(import ./modules {
inherit pkgs lib check extraSpecialArgs;
configuration = { ... }: { imports = modules; };
});
};
overlays.default = final: prev:
(import ./pkgs {
inherit (prev) lib;
pkgs = prev;
});
checks.x86_64-linux.buildExampleEfi = (self.lib.OpenCoreConfig {
pkgs = import nixpkgs {
system = "x86_64-linux";
overlays = [ self.overlays.default ];
};
modules = [
({ lib, pkgs, ... }: {
oceanix.opencore = {
resources.packages = [
pkgs.airportitlwm-latest-ventura
pkgs.itlwm-latest
pkgs.applealc-latest-release
pkgs.brightnesskeys-latest-release
pkgs.ecenabler-latest-release
pkgs.intel-bluetooth-firmware-latest
pkgs.nvmefix-latest-release
pkgs.virtualsmc-latest-release
pkgs.whatevergreen-latest-release
pkgs.lilu-latest-release
pkgs.voodooi2c-latest
pkgs.voodoops2controller-latest-release
pkgs.intel-mausi-latest-release
];
};
})
];
}).efiPackage;
} // eachSystem [ system.i686-linux system.x86_64-linux system.x86_64-darwin ] (system:
let
pkgs = nixpkgs.legacyPackages.${system};
lib = nixpkgs.lib;
in
{
packages = (import ./pkgs { inherit lib pkgs; });
apps = rec {
fmt = utils.lib.mkApp {
drv = with import nixpkgs { inherit system; };
pkgs.writeShellScriptBin "oceanix-fmt" ''
export PATH=${
pkgs.lib.strings.makeBinPath [
findutils
nixpkgs-fmt
shfmt
shellcheck
]
}
find . -type f -name '*.sh' -exec shellcheck {} +
find . -type f -name '*.sh' -exec shfmt -w {} +
find . -type f -name '*.nix' -exec nixpkgs-fmt {} +
'';
};
default = fmt;
};
});
}