forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflake.nix
71 lines (65 loc) · 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
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
{
description = "Enarx kernel";
inputs.flake-utils.url = github:numtide/flake-utils;
inputs.nixpkgs.url = github:profianinc/nixpkgs;
outputs = {
flake-utils,
nixpkgs,
...
}:
with flake-utils.lib.system;
flake-utils.lib.eachSystem [
aarch64-linux
x86_64-linux
] (system: let
pkgs = import nixpkgs {
inherit system;
};
expr = {
buildLinux,
fetchurl,
lib,
...
} @ args:
buildLinux (args
// rec {
version = "6.1.0";
modDirVersion = "6.1.0";
extraMeta.branch = lib.versions.majorMinor version;
src = lib.cleanSource ./.;
kernelPatches = [];
ignoreConfigErrors = true;
structuredExtraConfig = with lib.kernel; {
"64BIT" = yes;
ACPI = yes;
AMD_MEM_ENCRYPT = yes;
AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT = no;
CRYPTO = yes;
CRYPTO_DEV_CCP = yes;
CRYPTO_DEV_CCP_DD = module;
CRYPTO_DEV_SP_CCP = yes;
CRYPTO_DEV_SP_PSP = yes;
DMADEVICES = yes;
HIGH_RES_TIMERS = yes;
KVM = module;
KVM_AMD = module;
KVM_AMD_SEV = yes;
MEMORY_FAILURE = yes;
PCI = yes;
RETPOLINE = yes;
VIRTUALIZATION = yes;
X86_MCE = yes;
};
}
// (args.argsOverride or {}));
linux_enarx = pkgs.callPackage expr {};
linuxPackages_enarx = pkgs.linuxPackagesFor linux_enarx;
in {
packages.config = linuxPackages_enarx.kernel.configfile;
packages.default = linuxPackages_enarx.kernel;
packages.kernel = linuxPackages_enarx.kernel;
nixosModules.default = {...}: {
boot.kernelPackages = linuxPackages_enarx;
};
});
}