aboutsummaryrefslogtreecommitdiff
path: root/pkgs/default.nix
blob: 082cca15bf89b608d80318dd02733bf1e89a1659 (plain)
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
{ nixpkgs ? <nixpkgs>, nixlib ? nixpkgs.lib }:

with builtins;
with nixlib;

let
  pkgs = nixpkgs // turrispkgs;
  callPackage = callPackageWith pkgs;

  turrispkgs = with pkgs; {

    # Crypto and certificates
    libatsha204 = callPackage ./libatsha204 { };
    mox-otp = python3Packages.callPackage ./mox-otp { };
    crypto-wrapper = callPackage ./crypto-wrapper { };

    # Turris kernels with patches
    linux_turris_5_15 = callPackage
      "${nixpkgs.path}/pkgs/os-specific/linux/kernel/linux-5.15.nix" {
        kernelPatches = map (p: { name = toString p; patch = ./patches-linux-5.15 + "/${p}"; }) (
          attrNames (filterAttrs (n: v: v == "regular") (
            readDir ./patches-linux-5.15)));
      };

    # NOR Firmwares
    armTrustedFirmwareTurrisMox = buildArmTrustedFirmware rec {
      platform = "a3700";
      extraMeta.platforms = ["aarch64-linux"];
      extraMakeFlags = ["USE_COHERENT_MEM=0" "CM3_SYSTEM_RESET=1" "FIP_ALIGN=0x100"];
      filesToInstall = ["build/${platform}/release/bl31.bin"];
    };
    ubootTurrisMox = buildUBoot {
      defconfig = "turris_mox_defconfig";
      extraMeta.platforms = ["aarch64-linux"];
      filesToInstall = ["u-boot.bin"];
      extraPatches = [ ./patches/include-configs-turris_mox-increase-space-for-the-ke.patch ];
      BL31 = "${armTrustedFirmwareTurrisMox}/bl31.bin";
    };
    ubootTurrisOmnia = buildUBoot {
      defconfig = "turris_omnia_defconfig";
      extraMeta.platforms = ["armv7l-linux"];
      filesToInstall = ["u-boot-spl.kwb"];
    };

  };

in turrispkgs