2020-08-24 03:57:52 +02:00
|
|
|
{
|
|
|
|
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;
|
|
|
|
} // flake-utils.lib.eachDefaultSystem (
|
|
|
|
system:
|
|
|
|
let
|
2020-08-24 06:35:14 +02:00
|
|
|
inherit (nixpkgs) lib;
|
2020-08-24 03:57:52 +02:00
|
|
|
darwin_network_cmds_openssl_overlay = final: prev: {
|
|
|
|
darwin = prev.darwin // {
|
|
|
|
network_cmds = prev.darwin.network_cmds.override { openssl_1_0_2 = prev.openssl; };
|
|
|
|
};
|
|
|
|
};
|
|
|
|
pkgsNative = import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
config.allowUnfree = true;
|
|
|
|
overlays = [ darwin_network_cmds_openssl_overlay 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;
|
|
|
|
|
2020-08-24 06:35:14 +02:00
|
|
|
nixosConfigurations = lib.nixosSystem {
|
2020-08-24 03:57:52 +02:00
|
|
|
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; }
|
2020-08-24 06:35:14 +02:00
|
|
|
"${self}/configuration.nix"
|
|
|
|
(
|
|
|
|
lib.optionalAttrs (system != "aarch64-linux") {
|
|
|
|
imports = [ "${self}/cross-hacks.nix" ];
|
|
|
|
nixpkgs.crossSystem.system = "aarch64-linux";
|
|
|
|
}
|
|
|
|
)
|
2020-08-24 03:57:52 +02:00
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
nixosModule = import "${self}/pinebook_pro.nix";
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|