Font progress

This commit is contained in:
Jan Bulthuis 2024-07-18 23:36:50 +02:00
parent 4f49ea8383
commit f40ae42933
14 changed files with 142 additions and 70 deletions

View File

@ -15,69 +15,69 @@ let
# sha256 = "0dz8h1ga8lnfvvmvsf6iqvnbvxrvx3qxi0y8s8b72066mqgvy8y5";
# });
fontInstallPhase = ''
runHook preInstall
# fontInstallPhase = ''
# runHook preInstall
install -Dm644 *.ttc -t $out/share/fonts/
# install -Dm644 *.ttc -t $out/share/fonts/
runHook postInstall
'';
# runHook postInstall
# '';
my-wqy-zenhei = pkgs.stdenv.mkDerivation rec {
pname = "wqy-zenhei";
version = "0.9.45";
# my-wqy-zenhei = pkgs.stdenv.mkDerivation rec {
# pname = "wqy-zenhei";
# version = "0.9.45";
src = pkgs.fetchurl {
url = "mirror://sourceforge/wqy/${pname}-${version}.tar.gz";
hash = "sha256-5LfjBkdb+UJ9F1dXjw5FKJMMhMROqj8WfUxC8RDuddY=";
};
# src = pkgs.fetchurl {
# url = "mirror://sourceforge/wqy/${pname}-${version}.tar.gz";
# hash = "sha256-5LfjBkdb+UJ9F1dXjw5FKJMMhMROqj8WfUxC8RDuddY=";
# };
installPhase = fontInstallPhase;
};
# installPhase = fontInstallPhase;
# };
my-wqy-microhei = pkgs.stdenv.mkDerivation rec {
pname = "wqy-microhei";
version = "0.2.0-beta";
# my-wqy-microhei = pkgs.stdenv.mkDerivation rec {
# pname = "wqy-microhei";
# version = "0.2.0-beta";
src = pkgs.fetchurl {
url = "mirror://sourceforge/wqy/${pname}-${version}.tar.gz";
hash = "sha256-KAKsgCOqNqZupudEWFTjoHjTd///QhaTQb0jeHH3IT4=";
};
# src = pkgs.fetchurl {
# url = "mirror://sourceforge/wqy/${pname}-${version}.tar.gz";
# hash = "sha256-KAKsgCOqNqZupudEWFTjoHjTd///QhaTQb0jeHH3IT4=";
# };
installPhase = fontInstallPhase;
};
# installPhase = fontInstallPhase;
# };
my-wqy-bitmapsong = pkgs.stdenv.mkDerivation rec {
pname = "wqy-bitmapsong-pcf";
version = "1.0.0-RC1";
# my-wqy-bitmapsong = pkgs.stdenv.mkDerivation rec {
# pname = "wqy-bitmapsong-pcf";
# version = "1.0.0-RC1";
src = pkgs.fetchurl {
url = "mirror://sourceforge/wqy/${pname}-${version}.tar.gz";
#hash = "sha256-r2Vf7ftJCqu7jOc2AqCKaoR/r8eNw2P/OQGqbDOEyl0=";
hash = "sha256-0uvwkRUbvJ0remTnlP8dElRjaBVd6iukNYBTE/CTO7s=";
};
# src = pkgs.fetchurl {
# url = "mirror://sourceforge/wqy/${pname}-${version}.tar.gz";
# #hash = "sha256-r2Vf7ftJCqu7jOc2AqCKaoR/r8eNw2P/OQGqbDOEyl0=";
# hash = "sha256-0uvwkRUbvJ0remTnlP8dElRjaBVd6iukNYBTE/CTO7s=";
# };
buildInputs = [ pkgs.fontforge ];
buildPhase = ''
newName() {
test "''${1:5:1}" = i && _it=Italic || _it=
case ''${1:6:3} in
400) test -z $it && _weight=Medium ;;
700) _weight=Bold ;;
esac
_pt=''${1%.pcf}
_pt=''${_pt#*-}
echo "WenQuanYi_Bitmap_Song$_weight$_it$_pt"
}
# buildInputs = [ pkgs.fontforge ];
# buildPhase = ''
# newName() {
# test "''${1:5:1}" = i && _it=Italic || _it=
# case ''${1:6:3} in
# 400) test -z $it && _weight=Medium ;;
# 700) _weight=Bold ;;
# esac
# _pt=''${1%.pcf}
# _pt=''${_pt#*-}
# echo "WenQuanYi_Bitmap_Song$_weight$_it$_pt"
# }
for i in *.pcf; do
fontforge -lang=ff -c "Open(\"$i\"); Generate(\"$(newName $i).otb\")"
done
'';
installPhase = ''
install -Dm644 *.otb -t $out/share/fonts/
'';
};
# for i in *.pcf; do
# fontforge -lang=ff -c "Open(\"$i\"); Generate(\"$(newName $i).otb\")"
# done
# '';
# installPhase = ''
# install -Dm644 *.otb -t $out/share/fonts/
# '';
# };
in {
# imports =
# [
@ -229,9 +229,9 @@ in {
# Fonts
fonts.packages = with pkgs; [
my-wqy-zenhei
my-wqy-microhei
my-wqy-bitmapsong
# my-wqy-zenhei
# my-wqy-microhei
# my-wqy-bitmapsong
# cozette
#uw-ttyp0
#ucs-fonts
@ -275,10 +275,8 @@ in {
environment.systemPackages = with pkgs; [
git
vim
neovim
wget
curl
brightnessctl
];
# Some programs need SUID wrappers, can be configured further or are

0
modules/base/default.nix Normal file
View File

View File

@ -0,0 +1,16 @@
{config, lib, pkgs, ... }:
with lib;
let
cfg = config.modules.brightnessctl;
in {
options.modules.brightnessctl = {
enable = mkEnableOption "brightnessctl";
};
config = mkIf cfg.enable {
environment.systemPackages = [
pkgs.brightnessctl
];
};
}

View File

@ -64,6 +64,9 @@ in {
# Modules
./modules/default.nix
# Custom packages
../../pkgs/default.nix
];
# Create users

View File

@ -46,6 +46,12 @@ let
./fonts/fira-code.nix
./fonts/nerd-fonts-symbols.nix
./fonts/noto-color-emoji.nix
./fonts/wqy-bitmapsong.nix
./fonts/wqy-microhei-mono.nix
./fonts/wqy-microhei.nix
./fonts/wqy-zenhei-mono.nix
./fonts/wqy-zenhei-sharp.nix
./fonts/wqy-zenhei.nix
];
# Gather enabled fonts.

View File

@ -6,6 +6,7 @@
recommendedSize = 9;
fallbackFonts = [
"Cozette"
"wenquanyi bitmap song"
"Symbols Nerd Font Mono"
];
}

View File

@ -0,0 +1,8 @@
{ pkgs, ... }:
{
name = "wenquanyi bitmap song";
package = pkgs.wqy-bitmapsong;
recommendedSize = 12;
fallbackFonts = [];
}

View File

@ -0,0 +1,8 @@
{ pkgs, ... }:
{
name = "WenQuanYi Micro Hei Mono";
package = pkgs.wqy-microhei;
recommendedSize = 12;
fallbackFonts = [];
}

View File

@ -0,0 +1,8 @@
{ pkgs, ... }:
{
name = "WenQuanYi Micro Hei";
package = pkgs.wqy-microhei;
recommendedSize = 12;
fallbackFonts = [];
}

View File

@ -0,0 +1,8 @@
{ pkgs, ... }:
{
name = "WenQuanYi Zen Hei Mono";
package = pkgs.wqy-zenhei;
recommendedSize = 12;
fallbackFonts = [];
}

View File

@ -0,0 +1,8 @@
{ pkgs, ... }:
{
name = "WenQuanYi Zen Hei Sharp";
package = pkgs.wqy-zenhei;
recommendedSize = 12;
fallbackFonts = [];
}

View File

@ -2,6 +2,7 @@
{
name = "WenQuanYi Zen Hei";
package = pkgs.wqy-zenhei;
recommendedSize = 12;
fallbackFonts = [];
}

View File

@ -1,17 +1,24 @@
{ lib, config, pkgs, ... }:
with lib;
let
mkPackage = path: (mkOption {
type = types.package;
default = (pkgs.callPackage path) {};
description = (mkPackage path).default.name;
});
in {
options.pkgs = {
# Add all custom packages
wqy-zenhei = mkPackage ./fonts/wqy-zenhei.nix;
wqy-microhei = mkPackage ./fonts/wqy-microhei.nix;
wqy-bitmapsong = mkPackage ./fonts/wqy-bitmapsong.nix;
# let
# mkPackage = path: (mkOption {
# type = types.package;
# default = (pkgs.callPackage path) {};
# description = (mkPackage path).default.name;
# });
# in {
# options.pkgs = {
# # Add all custom packages
# wqy-zenhei = mkPackage ./fonts/wqy-zenhei.nix;
# wqy-microhei = mkPackage ./fonts/wqy-microhei.nix;
# wqy-bitmapsong = mkPackage ./fonts/wqy-bitmapsong.nix;
# };
# }
{
nixpkgs.config.packageOverrides = pkgs: rec {
wqy-zenhei = pkgs.callPackage ./fonts/wqy-zenhei.nix {};
wqy-microhei = pkgs.callPackage ./fonts/wqy-microhei.nix {};
wqy-bitmapsong = pkgs.callPackage ./fonts/wqy-bitmapsong.nix {};
};
}

View File

@ -1,6 +1,6 @@
# How Jan likes his linux to be configured
{ config, ... }:
{ config, pkgs, ... }:
{
# TODO: Remove later