Skip to content

Commit

Permalink
nix-darwin: add extraModules and extraSpecialArgs option
Browse files Browse the repository at this point in the history
Co-authored-by: Nicolas Berbiche <[email protected]>
  • Loading branch information
Pacman99 and berbiche committed Feb 15, 2021
1 parent 96769f8 commit ca01e72
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions nix-darwin/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ let
specialArgs = {
lib = extendedLib;
darwinConfig = config;
};
} // cfg.extraSpecialArgs;
modules = [
({ name, ... }: {
Expand All @@ -30,7 +29,7 @@ let
home.homeDirectory = config.users.users.${name}.home;
};
})
];
] ++ cfg.extraModules;
};

in
Expand Down Expand Up @@ -59,6 +58,24 @@ in
'';
};

extraSpecialArgs = mkOption {
type = types.attrs;
default = { };
example = literalExample "{ modulesPath = ../modules; }";
description = ''
Extra <literal>specialArgs</literal> passed to Home Manager.
'';
};

extraModules = 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 {
Expand Down

0 comments on commit ca01e72

Please sign in to comment.