2023-11-10 12:53:56 -05:00
|
|
|
{ config, pkgs, lib, ... }:
|
2016-12-12 17:34:43 +01:00
|
|
|
|
2020-11-15 15:42:39 +01:00
|
|
|
let
|
2023-06-20 22:54:31 +10:00
|
|
|
nix-tools = pkgs.callPackage ../../pkgs/nix-tools {
|
|
|
|
inherit (config.system) profile;
|
|
|
|
inherit (config.environment) systemPath;
|
|
|
|
};
|
2016-12-12 17:34:43 +01:00
|
|
|
|
2023-11-10 12:53:56 -05:00
|
|
|
darwin-uninstaller = pkgs.callPackage ../../pkgs/darwin-uninstaller { };
|
|
|
|
|
2023-07-02 01:11:16 +10:00
|
|
|
inherit (nix-tools) darwin-option darwin-rebuild darwin-version;
|
2016-12-12 17:34:43 +01:00
|
|
|
in
|
|
|
|
|
|
|
|
{
|
2024-08-20 15:18:57 +01: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 12:53:56 -05:00
|
|
|
type = lib.types.bool;
|
|
|
|
internal = true;
|
|
|
|
default = true;
|
|
|
|
};
|
|
|
|
};
|
2016-12-12 17:34:43 +01:00
|
|
|
|
2023-11-10 12:53:56 -05:00
|
|
|
config = {
|
2016-12-12 17:34:43 +01:00
|
|
|
environment.systemPackages =
|
2024-08-20 15:18:57 +01:00
|
|
|
[ darwin-version ]
|
|
|
|
++ lib.optionals (!config.system.disableInstallerTools) [
|
2016-12-12 17:34:43 +01:00
|
|
|
darwin-option
|
|
|
|
darwin-rebuild
|
2023-11-10 12:53:56 -05:00
|
|
|
] ++ lib.optional config.system.includeUninstaller darwin-uninstaller;
|
2016-12-12 17:34:43 +01:00
|
|
|
|
2023-06-10 00:23:02 +10:00
|
|
|
system.build = {
|
2023-07-02 01:11:16 +10:00
|
|
|
inherit darwin-option darwin-rebuild darwin-version;
|
2023-06-10 00:23:02 +10:00
|
|
|
};
|
2016-12-12 17:34:43 +01:00
|
|
|
};
|
|
|
|
}
|