Skip to content

Commit

Permalink
fonts: remove fonts.fontDir.enable
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
emilazy committed Aug 4, 2023
1 parent 1d8b4d1 commit 0c769c8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
15 changes: 4 additions & 11 deletions modules/fonts/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,21 @@ 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.
Note that the implementation now keeps fonts in `/Library/Fonts/Nix Fonts' to allow them to coexist with fonts not managed by nix-darwin; existing fonts will be left directly in `/Library/Fonts' without getting updates and should be manually removed.'')
];

options = {
fonts.fontDir.enable = lib.mkOption {
default = false;
description = lib.mdDoc ''
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 = lib.mdDoc ''
List of fonts to install.
List of fonts to install into {file}`/Library/Fonts/Nix Fonts`.
'';
};
};
Expand All @@ -51,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
Expand Down
1 change: 0 additions & 1 deletion tests/fonts.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ let
in

{
fonts.fontDir.enable = true;
fonts.packages = [ font ];

test = ''
Expand Down

0 comments on commit 0c769c8

Please sign in to comment.