Skip to content

Commit

Permalink
simplify flake dependenices
Browse files Browse the repository at this point in the history
  • Loading branch information
oati committed Jan 23, 2023
1 parent 32ebdd7 commit 1cb6a1b
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 112 deletions.
87 changes: 8 additions & 79 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

70 changes: 37 additions & 33 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,47 @@
description = "Apple M1 support for NixOS";

inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
flake-parts.url = "github:hercules-ci/flake-parts";
# https://hydra.nixos.org/jobset/mobile-nixos/unstable/evals
# these evals have a cross-compiled stdenv available
nixpkgs = {
url = "github:nixos/nixpkgs/6dccdc458512abce8d19f74195bb20fdb067df50";
};

rust-overlay = {
url = "github:oxalica/rust-overlay";
flake = false;
};
};

outputs = { self, flake-parts, ... }@inputs:
flake-parts.lib.mkFlake { inherit inputs; } (
{ withSystem, ... }: {
flake = {
overlays = rec {
asahi-overlay = import packages/overlay.nix;
default = asahi-overlay;
};
outputs = { self, ... }@inputs:
let
# build platforms supported for uboot in nixpkgs
systems = [ "aarch64-linux" "x86_64-linux" ];

nixosModules = rec {
m1-support = ./nixos-module;
default = m1-support;
};
forAllSystems = inputs.nixpkgs.lib.genAttrs systems;
in
{
overlays = rec {
asahi-overlay = import packages/overlay.nix;
default = asahi-overlay;
};

# build platforms supported for uboot in nixpkgs
systems = [ "aarch64-linux" "x86_64-linux" "i686-linux" ];

perSystem = { system, pkgs, ... }: {
# override the `pkgs` argument used by flake-parts modules
_module.args.pkgs = import inputs.nixpkgs {
crossSystem.system = "aarch64-linux";
localSystem.system = system;
overlays = [
inputs.rust-overlay.overlays.default
self.overlays.default
];
};
nixosModules = rec {
m1-support = ./nixos-module;
default = m1-support;
};

packages = {
packages = forAllSystems (system:
let
pkgs = import inputs.nixpkgs {
crossSystem.system = "aarch64-linux";
localSystem.system = system;
overlays = [
(import inputs.rust-overlay)
self.overlays.default
];
};
in {
inherit (pkgs) m1n1 uboot-asahi;

installer-bootstrap =
Expand All @@ -62,8 +68,6 @@
];
};
in installer-system.config.system.build.isoImage;
};
};
}
);
});
};
}

0 comments on commit 1cb6a1b

Please sign in to comment.