mirror of
https://github.com/hercules-ci/flake-parts.git
synced 2025-03-05 08:27:02 +00:00
This reflects the actual requirements of the core flake-parts functionality and removes any possible confusion about where lib comes from (always flake-parts's input) vs where pkgs comes from (always the flake's nixpkgs input). Flakes which use flake-parts should only ever have to override its input in the very unlikely event of a bug in lib. Hopefully lib will be separated into its own flake some day, which will also make this a much smaller footprint.
33 lines
1 KiB
Nix
33 lines
1 KiB
Nix
{
|
|
description = "Description for the project";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
};
|
|
|
|
outputs = { self, flake-parts, ... }:
|
|
flake-parts.lib.mkFlake { inherit self; } {
|
|
imports = [
|
|
# To import a flake module
|
|
# 1. Add foo to inputs
|
|
# 2. Add foo as a parameter to the outputs function
|
|
# 3. Add here: foo.flakeModule
|
|
|
|
];
|
|
systems = [ "x86_64-linux" "aarch64-darwin" ];
|
|
perSystem = { config, self', inputs', pkgs, system, ... }: {
|
|
# Per-system attributes can be defined here. The self' and inputs'
|
|
# module parameters provide easy access to attributes of the same
|
|
# system.
|
|
|
|
# Equivalent to inputs'.nixpkgs.legacyPackages.hello;
|
|
packages.default = pkgs.hello;
|
|
};
|
|
flake = {
|
|
# The usual flake attributes can be defined here, including system-
|
|
# agnostic ones like nixosModule and system-enumerating ones, although
|
|
# those are more easily expressed in perSystem.
|
|
|
|
};
|
|
};
|
|
}
|