1
0
Fork 0
mirror of https://github.com/samueldr/wip-pinebook-pro.git synced 2024-11-14 06:59:43 +01:00
wip-pinebook-pro/flake.nix
Jake Waksbaum a217594cf3 Use flakes
This should let users build an SD image simply with `nix build` run from
the root of the repo, or even `nix build
github:samudeldr/wip-pinebook-pro'.
2020-08-23 21:57:54 -04:00

55 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;
} // flake-utils.lib.eachDefaultSystem (
system:
let
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;
nixosConfigurations = nixpkgs.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; }
(if system == "aarch64-linux" then "${self}/configuration.nix" else "${self}/with-cross.nix")
];
};
nixosModule = import "${self}/pinebook_pro.nix";
}
);
}