nix-samples/flake-multi-platform/flake.nix

25 lines
774 B
Nix
Raw Permalink Normal View History

2024-03-17 17:33:12 +01:00
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
# no need to define `system` anymore
name = "simple";
src = ./.;
pkgs = nixpkgs.legacyPackages.${system};
in
{
# `eachDefaultSystem` transforms the input, our output set
# now simply has `packages.default` which gets turned into
# `packages.${system}.default` (for each system)
packages.default = derivation {
inherit system name src;
builder = with pkgs; "${bash}/bin/bash";
args = [ "-c" "echo foo > $out" ];
};
}
);
}