Skip to content

Commit

Permalink
fonts: remove with lib
Browse files Browse the repository at this point in the history
  • Loading branch information
emilazy authored and kamushadenes committed Jul 8, 2024
1 parent 6c9df2f commit e8dcea5
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions modules/fonts/default.nix
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
{ config, lib, pkgs, ... }:

with lib;

let
cfg = config.fonts;
in

{
imports = [
(mkRenamedOptionModule [ "fonts" "enableFontDir" ] [ "fonts" "fontDir" "enable" ])
(lib.mkRenamedOptionModule [ "fonts" "enableFontDir" ] [ "fonts" "fontDir" "enable" ])
];

options = {
fonts.fontDir.enable = mkOption {
type = types.bool;
fonts.fontDir.enable = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Whether to enable font management and install configured fonts to
Expand All @@ -23,10 +21,10 @@ in
'';
};

fonts.fonts = mkOption {
type = types.listOf types.path;
fonts.fonts = lib.mkOption {
type = lib.types.listOf lib.types.path;
default = [ ];
example = literalExpression "[ pkgs.dejavu_fonts ]";
example = lib.literalExpression "[ pkgs.dejavu_fonts ]";
description = ''
List of fonts to install.
Expand All @@ -48,7 +46,7 @@ in
done
'';

system.activationScripts.fonts.text = optionalString cfg.fontDir.enable ''
system.activationScripts.fonts.text = lib.optionalString cfg.fontDir.enable ''
# Set up fonts.
echo "configuring fonts..." >&2
find -L "$systemConfig/Library/Fonts" -type f -print0 | while IFS= read -rd "" l; do
Expand Down

0 comments on commit e8dcea5

Please sign in to comment.