triviOS/flake.nix

82 lines
2.7 KiB
Nix

{
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;
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;
# This is necessary for any installation
# withPam = false;
# withHwdb = false;
# withLogind = false;
};
})
];
crossSystem = {
gcc.cpu = "cortex-a53";
config = "aarch64-unknown-linux-gnu";
linux-kernel = {
DTB = true;
autoModules = true;
baseConfig = "defconfig";
extraConfig = "# Raspberry Pi 3 stuff. Not needed for s >= 4.10.\nARCH_BCM2835 y\nBCM2835_MBOX y\nBCM2835_WDT y\nRASPBERRYPI_FIRMWARE y\nRASPBERRYPI_POWER y\nSERIAL_8250_BCM2835AUX y\nSERIAL_8250_EXTENDED y\nSERIAL_8250_SHARE_IRQ y\n\n# Cavium ThunderX stuff.\nPCI_HOST_THUNDER_ECAM y\n\n# Nvidia Tegra stuff.\nPCI_TEGRA y\n\n# The default (=y) forces us to have the XHCI firmware available in initrd,\n# which our initrd builder can't currently do easily.\nUSB_XHCI_TEGRA m\n";
name = "aarch64-multiplatform";
preferBuiltin = true;
target = "Image";
};
};
};
in
{
packages.${crossSystem} = pkgs;
nixosConfigurations.triviOS = nixpkgs.lib.nixosSystem {
inherit pkgs;
system = crossSystem;
modules = [ ./triviOS ];
};
formatter.${system} = pkgs.pkgsBuildBuild.nixpkgs-fmt;
};
}