diff --git a/modules/packages.nix b/modules/packages.nix
index 05fea46..a6a22c5 100644
--- a/modules/packages.nix
+++ b/modules/packages.nix
@@ -1,45 +1,22 @@
{ config, lib, flake-parts-lib, ... }:
let
inherit (lib)
- filterAttrs
- mapAttrs
mkOption
- optionalAttrs
types
;
inherit (flake-parts-lib)
- mkSubmoduleOptions
- mkPerSystemOption
+ mkTransposedPerSystemModule
;
in
-{
- options = {
- flake = mkSubmoduleOptions {
- packages = mkOption {
- type = types.lazyAttrsOf (types.lazyAttrsOf types.package);
- default = { };
- description = ''
- Per system an attribute set of packages.
- nix build .#<name> will build packages.<system>.<name>.
- '';
- };
- };
-
- perSystem = mkPerSystemOption ({ config, ... }: {
- _file = ./packages.nix;
- options = {
- packages = mkOption {
- type = types.lazyAttrsOf types.package;
- default = { };
- description = ''
- An attribute set of packages to be built by nix build .#<name>.
- nix build .#<name> will build packages.<name>.
- '';
- };
- };
- });
- };
- config = {
- transposition.packages = { };
+mkTransposedPerSystemModule {
+ name = "packages";
+ option = mkOption {
+ type = types.lazyAttrsOf types.package;
+ default = { };
+ description = ''
+ An attribute set of packages to be built by nix build .#<name>.
+ nix build .#<name> will build packages.<name>.
+ '';
};
+ file = ./packages.nix;
}