mirror of
https://github.com/samueldr/wip-pinebook-pro.git
synced 2024-11-14 06:59:43 +01:00
89605b0f3e
The `nixosModule` attribute is not system specific, so it should itself be a module instead of `nixosModule.aarch64-linux`, etc. being modules.
56 lines
1.9 KiB
Nix
56 lines
1.9 KiB
Nix
{
|
|
description = "WIP stuff to get started on the pinebook pro.";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs-channels/nixos-unstable";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
};
|
|
|
|
outputs = { self, nixpkgs, flake-utils }:
|
|
{
|
|
overlay = final: prev: import "${self}/overlay.nix" final prev;
|
|
nixosModule = import "${self}/pinebook_pro.nix";
|
|
} // flake-utils.lib.eachSystem [ "x86_64-linux" "aarch64-linux" ] (
|
|
system:
|
|
let
|
|
inherit (nixpkgs) lib;
|
|
pkgsNative = import nixpkgs {
|
|
inherit system;
|
|
config.allowUnfree = true;
|
|
overlays = [ self.overlay ];
|
|
};
|
|
pkgs = if system == "aarch64-linux" then pkgsNative else pkgsNative.pkgsCross.aarch64-multiplatform;
|
|
in
|
|
rec {
|
|
packages = rec {
|
|
inherit (pkgs)
|
|
uBootPinebookPro uBootPinebookProExternalFirst
|
|
linux_pinebookpro_latest
|
|
linux_pinebookpro_lts
|
|
pinebookpro-firmware
|
|
pinebookpro-keyboard-updater
|
|
;
|
|
|
|
inherit (nixosConfigurations.config.system.build) sdImage;
|
|
};
|
|
|
|
defaultPackage = packages.sdImage;
|
|
|
|
nixosConfigurations = lib.nixosSystem {
|
|
system = "aarch64-linux";
|
|
# Pass nixpkgs as an argument to each module so that modules from nixpkgs can be imported purely
|
|
specialArgs = { inherit nixpkgs; };
|
|
modules = [
|
|
{ nixpkgs.config.allowUnfree = true; }
|
|
"${self}/configuration.nix"
|
|
(
|
|
lib.optionalAttrs (system != "aarch64-linux") {
|
|
imports = [ "${self}/cross-hacks.nix" ];
|
|
nixpkgs.crossSystem.system = "aarch64-linux";
|
|
}
|
|
)
|
|
];
|
|
};
|
|
}
|
|
);
|
|
}
|