flake-utils
最終的な attributes がどのような構造になるのかわかりにくい。
多分これが
code:flake.nix
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
in
{
packages = {
default = pkgs.hello;
hello = pkgs.hello;
};
apps.default = {
type = "app";
program = "${pkgs.hello}/bin/hello";
};
}
);
}
こうなる???
code:output.nix
{
outputs = {
packages = {
x86_64-linux = {
default = <hello for x86_64-linux>;
hello = <hello for x86_64-linux>;
};
aarch64-linux = {
default = <hello for aarch64-linux>;
hello = <hello for aarch64-linux>;
};
x86_64-darwin = {
default = <hello for x86_64-darwin>;
hello = <hello for x86_64-darwin>;
};
aarch64-darwin = {
default = <hello for aarch64-darwin>;
hello = <hello for aarch64-darwin>;
};
};
apps = {
x86_64-linux = {
default = {
type = "app";
program = "/nix/store/...-hello/bin/hello";
};
};
aarch64-linux = {
default = {
type = "app";
program = "/nix/store/...-hello/bin/hello";
};
};
x86_64-darwin = {
default = {
type = "app";
program = "/nix/store/...-hello/bin/hello";
};
};
aarch64-darwin = {
default = {
type = "app";
program = "/nix/store/...-hello/bin/hello";
};
};
};
};
}