From 7d4f8672101536674ca5d75d91161474739a83e2 Mon Sep 17 00:00:00 2001 From: Emily Date: Thu, 3 Aug 2023 02:11:40 +0100 Subject: [PATCH] fonts: remove `fonts.fontDir.enable` As far as I can tell, this isn't required to get fonts to work on NixOS, so we shouldn't require it on nix-darwin either, even if the implementations are superficially similar. --- modules/fonts/default.nix | 16 ++++------------ tests/fonts.nix | 1 - 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/modules/fonts/default.nix b/modules/fonts/default.nix index 9ecb6eb..b0bd63f 100644 --- a/modules/fonts/default.nix +++ b/modules/fonts/default.nix @@ -6,7 +6,8 @@ in { imports = [ - (lib.mkRenamedOptionModule [ "fonts" "enableFontDir" ] [ "fonts" "fontDir" "enable" ]) + (lib.mkRemovedOptionModule [ "fonts" "enableFontDir" ] "No nix-darwin equivalent to this NixOS option. This is not required to install fonts.") + (lib.mkRemovedOptionModule [ "fonts" "fontDir" "enable" ] "No nix-darwin equivalent to this NixOS option. This is not required to install fonts.") (lib.mkRemovedOptionModule [ "fonts" "fonts" ] '' This option has been renamed to `fonts.packages' for consistency with NixOS. @@ -14,21 +15,12 @@ in ]; options = { - fonts.fontDir.enable = lib.mkOption { - type = lib.types.bool; - default = false; - description = '' - Whether to enable font management and install configured fonts to - {file}`/Library/Fonts/Nix Fonts`. - ''; - }; - fonts.packages = lib.mkOption { type = lib.types.listOf lib.types.path; default = [ ]; example = lib.literalExpression "[ pkgs.dejavu_fonts ]"; description = '' - List of fonts to install. + List of fonts to install into {file}`/Library/Fonts/Nix Fonts`. ''; }; }; @@ -52,7 +44,7 @@ in ) ''; - system.activationScripts.fonts.text = lib.optionalString cfg.fontDir.enable '' + system.activationScripts.fonts.text = '' printf >&2 'setting up /Library/Fonts/Nix Fonts...\n' # rsync uses the mtime + size of files to determine whether they diff --git a/tests/fonts.nix b/tests/fonts.nix index 57d61dc..d60979c 100644 --- a/tests/fonts.nix +++ b/tests/fonts.nix @@ -8,7 +8,6 @@ let in { - fonts.fontDir.enable = true; fonts.packages = [ font ]; test = ''