triviOS/flake.nix

110 lines
3.1 KiB
Nix
Raw Normal View History

2023-09-05 05:17:46 +02:00
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
};
outputs = { self, nixpkgs }:
let
system = "x86_64-linux";
crossSystem = "aarch64-linux";
pkgs = import nixpkgs {
inherit system;
2023-09-06 09:58:50 +02:00
overlays = [
(self: super: {
systemd = super.systemd.override {
pname = "systemd-minimal";
withAcl = false;
withAnalyze = false;
withApparmor = false;
withAudit = false;
withCompression = false;
withCoredump = false;
withCryptsetup = false;
withDocumentation = false;
withEfi = false;
withFido2 = false;
withHostnamed = false;
withHomed = false;
withImportd = false;
withLibBPF = false;
withLibidn2 = false;
withLocaled = false;
withMachined = false;
withNetworkd = false;
withNss = false;
withOomd = false;
withPCRE2 = false;
withPolkit = false;
withPortabled = false;
withRemote = false;
withResolved = false;
withShellCompletions = false;
withTimedated = false;
withTimesyncd = false;
withTpm2Tss = false;
withUserDb = false;
2023-09-06 10:15:23 +02:00
# This is necessary for any installation
# withPam = false;
# withHwdb = false;
# withLogind = false;
2023-09-06 09:58:50 +02:00
};
2023-09-11 09:59:10 +02:00
libaom = super.libaom.override {
enableButteraugli = false;
};
2023-09-12 23:51:16 +02:00
pin_control = self.callPackage ./pin_control { };
2023-09-06 09:58:50 +02:00
})
];
2023-09-05 05:17:46 +02:00
crossSystem = {
gcc.cpu = "cortex-a53";
config = "aarch64-unknown-linux-gnu";
linux-kernel = {
DTB = true;
autoModules = true;
baseConfig = "defconfig";
2023-09-11 07:20:47 +02:00
extraConfig = ''
# Raspberry Pi 3 stuff. Not needed for s >= 4.10.
ARCH_BCM2835 y
BCM2835_MBOX y
BCM2835_WDT y
RASPBERRYPI_FIRMWARE y
RASPBERRYPI_POWER y
SERIAL_8250_BCM2835AUX y
SERIAL_8250_EXTENDED y
SERIAL_8250_SHARE_IRQ y
# Cavium ThunderX stuff.
PCI_HOST_THUNDER_ECAM y
# Nvidia Tegra stuff.
PCI_TEGRA y
# The default (=y) forces us to have the XHCI firmware available in initrd,
# which our initrd builder can't currently do easily.
USB_XHCI_TEGRA m
'';
2023-09-05 05:17:46 +02:00
name = "aarch64-multiplatform";
preferBuiltin = true;
target = "Image";
};
};
};
in
{
packages.${crossSystem} = pkgs;
2023-09-05 05:17:46 +02:00
nixosConfigurations.triviOS = nixpkgs.lib.nixosSystem {
2023-09-05 08:36:33 +02:00
inherit pkgs;
2023-09-05 05:17:46 +02:00
system = crossSystem;
modules = [ ./triviOS ];
};
2023-09-05 05:17:46 +02:00
formatter.${system} = pkgs.pkgsBuildBuild.nixpkgs-fmt;
};
}