diff --git a/nix-darwin/default.nix b/nix-darwin/default.nix index 9947ff855976..c529ca4a1020 100644 --- a/nix-darwin/default.nix +++ b/nix-darwin/default.nix @@ -12,7 +12,7 @@ let specialArgs = { lib = extendedLib; darwinConfig = config; - }; + } // cfg.extraSpecialArgs; modules = [ ({ name, ... }: { imports = import ../modules/modules.nix { @@ -29,7 +29,7 @@ let home.homeDirectory = config.users.users.${name}.home; }; }) - ]; + ] ++ cfg.sharedModules; }; in @@ -58,6 +58,24 @@ in ''; }; + extraSpecialArgs = mkOption { + type = types.attrs; + default = { }; + example = literalExample "{ modulesPath = ../modules; }"; + description = '' + Extra specialArgs passed to Home Manager. + ''; + }; + + sharedModules = mkOption { + type = with types; listOf (oneOf [ attrs (functionTo attrs) path ]); + default = [ ]; + example = literalExample "[ { home.packages = [ nixpkgs-fmt ]; } ]"; + description = '' + Extra modules added to all users. + ''; + }; + verbose = mkEnableOption "verbose output on activation"; users = mkOption {