mirror of
https://github.com/ryantm/agenix.git
synced 2024-11-22 17:50:48 +03:00
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
This commit is contained in:
parent
8af97149b2
commit
c1cbfe75b0
1 changed files with 7 additions and 3 deletions
|
@ -4,10 +4,14 @@
|
||||||
inputs.flake-utils.url = "github:numtide/flake-utils";
|
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||||
|
|
||||||
outputs = { self, nixpkgs, flake-utils }:
|
outputs = { self, nixpkgs, flake-utils }:
|
||||||
flake-utils.lib.eachDefaultSystem (system:
|
let
|
||||||
{
|
exports = {
|
||||||
nixosModules.age = import ./modules/age.nix;
|
nixosModules.age = import ./modules/age.nix;
|
||||||
|
};
|
||||||
|
outputs = flake-utils.lib.eachDefaultSystem (system: {
|
||||||
packages = nixpkgs.legacyPackages.${system}.callPackage ./default.nix { };
|
packages = nixpkgs.legacyPackages.${system}.callPackage ./default.nix { };
|
||||||
defaultPackage = self.packages.${system}.agenix;
|
defaultPackage = self.packages.${system}.agenix;
|
||||||
});
|
});
|
||||||
|
in
|
||||||
|
exports // outputs;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue