Created
August 25, 2023 17:55
-
-
Save punnie/272b352f0393bb1735e04c2171de130c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-22.11"; | |
outputs = inputs@{ self, nixpkgs, ... }: | |
let | |
lib = nixpkgs.lib; | |
darwin = [ "x86_64-darwin" "aarch64-darwin" ]; | |
linux = [ "x86_64-linux" "aarch64-linux" ]; | |
allSystems = darwin ++ linux; | |
forEachSystem = systems: f: lib.genAttrs systems (system: f system); | |
forAllSystems = forEachSystem allSystems; | |
in | |
{ | |
packages = forAllSystems (system: | |
let | |
pkgs = import nixpkgs { inherit system; }; | |
in | |
{ | |
inherit (pkgs) hello; | |
cross = forEachSystem (lib.filter (sys: sys != system) allSystems) (targetSystem: | |
let | |
crossPkgs = import nixpkgs { localSystem = system; crossSystem = targetSystem; }; | |
in | |
{ | |
inherit (crossPkgs) hello; | |
} | |
); | |
} | |
); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment