1
0
Fork 0
mirror of https://github.com/hercules-ci/flake-parts.git synced 2024-12-14 11:47:31 +00:00
flake-parts/modules/nixosModules.nix

28 lines
618 B
Nix
Raw Normal View History

{ self, lib, flake-parts-lib, moduleLocation, ... }:
2021-11-22 21:43:05 +00:00
let
inherit (lib)
mapAttrs
mkOption
types
;
2022-05-25 14:36:33 +00:00
inherit (flake-parts-lib)
2021-11-22 21:43:05 +00:00
mkSubmoduleOptions
;
in
{
options = {
flake = mkSubmoduleOptions {
nixosModules = mkOption {
type = types.lazyAttrsOf types.deferredModule;
2021-11-22 21:43:05 +00:00
default = { };
apply = mapAttrs (k: v: { _file = "${toString moduleLocation}#nixosModules.${k}"; imports = [ v ]; });
2022-11-11 06:39:25 +00:00
description = ''
2021-11-22 21:43:05 +00:00
NixOS modules.
2022-11-11 05:40:37 +00:00
You may use this for reusable pieces of configuration, service modules, etc.
2021-11-22 21:43:05 +00:00
'';
};
};
};
}