1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-12-14 11:57:34 +00:00
nix-darwin/modules/nix/nix-darwin.nix

48 lines
1.2 KiB
Nix
Raw Normal View History

{ config, pkgs, lib, ... }:
2016-12-12 16:34:43 +00:00
let
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
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 {
type = lib.types.bool;
internal = true;
default = true;
};
};
2016-12-12 16:34:43 +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
] ++ lib.optional config.system.includeUninstaller darwin-uninstaller;
2016-12-12 16:34:43 +00:00
system.build = {
2023-07-01 15:11:16 +00:00
inherit darwin-option darwin-rebuild darwin-version;
};
2016-12-12 16:34:43 +00:00
};
}