Skip to content

Commit

Permalink
add darwinModules
Browse files Browse the repository at this point in the history
  • Loading branch information
cdmistman committed Apr 26, 2024
1 parent 9126214 commit 98d8d6e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions all-modules.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
imports = [
./modules/apps.nix
./modules/checks.nix
./modules/darwinModules.nix
./modules/debug.nix
./modules/devShells.nix
./modules/flake.nix
Expand Down
27 changes: 27 additions & 0 deletions modules/darwinModules.nix
Original file line number Diff line number Diff line change
@@ -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).
'';
};
};
}

0 comments on commit 98d8d6e

Please sign in to comment.