1
0
Fork 0
mirror of https://github.com/hercules-ci/flake-parts.git synced 2025-03-31 04:04:55 +00:00

add darwinModules

This commit is contained in:
Colton Donnelly 2024-04-25 20:38:37 -07:00
parent 9126214d0a
commit 98d8d6e206
2 changed files with 28 additions and 0 deletions

View file

@ -2,6 +2,7 @@
imports = [
./modules/apps.nix
./modules/checks.nix
./modules/darwinModules.nix
./modules/debug.nix
./modules/devShells.nix
./modules/flake.nix

27
modules/darwinModules.nix Normal file
View file

@ -0,0 +1,27 @@
{self, lib, flake-parts-lib, moduleLocation, ...}:
let
inherit (lib)
mapAttrs
mkOption
types
;
inherit (flake-parts-lib)
mkSubmoduleOptions
;
in
{
options.flake = mkSubmoduleOptions {
darwinModules = mkOption {
type = types.lazyAttrsOf types.unspecified;
default = {};
apply = mapAttrs (k: v: { _file = "${toString moduleLocation}#darwinModules.${k}"; imports = [ v ]; });
description = ''
Darwin modules.
You may use this for reusable pieces of configuration, service modules, etc for [nix-darwin](https://github.com/LnL7/nix-darwin).
'';
};
};
}