2023-11-10 17:53:56 +00:00
|
|
|
{ config, pkgs, lib, ... }:
|
2016-12-12 16:34:43 +00:00
|
|
|
|
2020-11-15 14:42:39 +00:00
|
|
|
let
|
2023-06-20 12:54:31 +00:00
|
|
|
nix-tools = pkgs.callPackage ../../pkgs/nix-tools {
|
|
|
|
inherit (config.system) profile;
|
|
|
|
inherit (config.environment) systemPath;
|
|
|
|
nixPackage = config.nix.package;
|
|
|
|
};
|
2016-12-12 16:34:43 +00:00
|
|
|
|
2023-11-10 17:53:56 +00:00
|
|
|
darwin-uninstaller = pkgs.callPackage ../../pkgs/darwin-uninstaller { };
|
|
|
|
|
2023-07-01 15:11:16 +00:00
|
|
|
inherit (nix-tools) darwin-option darwin-rebuild darwin-version;
|
2016-12-12 16:34:43 +00:00
|
|
|
in
|
|
|
|
|
|
|
|
{
|
2024-08-20 14:18:57 +00:00
|
|
|
options.system = {
|
|
|
|
disableInstallerTools = lib.mkOption {
|
|
|
|
type = lib.types.bool;
|
|
|
|
internal = true;
|
|
|
|
default = false;
|
|
|
|
description = ''
|
|
|
|
Disable darwin-rebuild and darwin-option. This is useful to shrink
|
|
|
|
systems which are not expected to rebuild or reconfigure themselves.
|
|
|
|
Use at your own risk!
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
includeUninstaller = lib.mkOption {
|
2023-11-10 17:53:56 +00:00
|
|
|
type = lib.types.bool;
|
|
|
|
internal = true;
|
|
|
|
default = true;
|
|
|
|
};
|
|
|
|
};
|
2016-12-12 16:34:43 +00:00
|
|
|
|
2023-11-10 17:53:56 +00:00
|
|
|
config = {
|
2016-12-12 16:34:43 +00:00
|
|
|
environment.systemPackages =
|
2024-08-20 14:18:57 +00:00
|
|
|
[ darwin-version ]
|
|
|
|
++ lib.optionals (!config.system.disableInstallerTools) [
|
2016-12-12 16:34:43 +00:00
|
|
|
darwin-option
|
|
|
|
darwin-rebuild
|
2023-11-10 17:53:56 +00:00
|
|
|
] ++ lib.optional config.system.includeUninstaller darwin-uninstaller;
|
2016-12-12 16:34:43 +00:00
|
|
|
|
2023-06-09 14:23:02 +00:00
|
|
|
system.build = {
|
2023-07-01 15:11:16 +00:00
|
|
|
inherit darwin-option darwin-rebuild darwin-version;
|
2023-06-09 14:23:02 +00:00
|
|
|
};
|
2016-12-12 16:34:43 +00:00
|
|
|
};
|
|
|
|
}
|