diff --git a/all-modules.nix b/all-modules.nix index b1508be..c9049f6 100644 --- a/all-modules.nix +++ b/all-modules.nix @@ -6,6 +6,7 @@ ./modules/devShell.nix ./modules/flake.nix ./modules/legacyPackages.nix + ./modules/nixosModules.nix ./modules/packages.nix ./modules/perSystem.nix ]; diff --git a/modules/nixosModules.nix b/modules/nixosModules.nix new file mode 100644 index 0000000..e26d040 --- /dev/null +++ b/modules/nixosModules.nix @@ -0,0 +1,27 @@ +{ config, self, lib, flake-modules-core-lib, ... }: +let + inherit (lib) + filterAttrs + mapAttrs + mkOption + optionalAttrs + types + ; + inherit (flake-modules-core-lib) + mkSubmoduleOptions + ; +in +{ + options = { + flake = mkSubmoduleOptions { + nixosModules = mkOption { + type = types.lazyAttrsOf types.unspecified; + default = { }; + apply = mapAttrs (k: v: { _file = "${toString self.outPath}/flake.nix#nixosModules.${k}"; imports = [ v ]; }); + description = '' + NixOS modules. + ''; + }; + }; + }; +}