agenix/flake.nix
Aluísio Augusto Silva Gonçalves c1cbfe75b0
export module as system-independent flake output
Flake outputs are a mixture of system-dependent and system-independent
sets, and flake-utils doesn't do much to distinguish one from the other.
Because of that, the `age` NixOS module currently has to be acessed as
`agenix.nixosModules.${system}.age`, rather than the documented
`agenix.nixosModules.age`.

To remedy that, (conceptually) split `outputs` in two, let flake-utils
handle the system-dependent half, and merge them to form the actual
outputs.  The names for the two halves were taken from [1].

[1]: https://github.com/NixOS/nix/issues/3843#issuecomment-661720562
2020-12-19 01:53:37 -03:00

18 lines
483 B
Nix

{
description = "Secret management with age";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils }:
let
exports = {
nixosModules.age = import ./modules/age.nix;
};
outputs = flake-utils.lib.eachDefaultSystem (system: {
packages = nixpkgs.legacyPackages.${system}.callPackage ./default.nix { };
defaultPackage = self.packages.${system}.agenix;
});
in
exports // outputs;
}