From 9d519e1277d6938a0c35a7fc15a356839ba03c1e Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Sun, 1 Dec 2024 14:14:11 +0900 Subject: [PATCH] Attempt to use inconsolata-psf Since giveup GH-667, I don't have any reason to choose console fonts with the Japanese glyphs Update GH-721 --- flake.nix | 1 + nixos/console.nix | 8 +++++-- pkgs/default.nix | 1 + pkgs/inconsolata-psf/default.nix | 37 ++++++++++++++++++++++++++++++++ 4 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 pkgs/inconsolata-psf/default.nix diff --git a/flake.nix b/flake.nix index db545bbf..211adcfa 100644 --- a/flake.nix +++ b/flake.nix @@ -160,6 +160,7 @@ in { cozette = pkgs.my.cozette; + inconsolata-psf = pkgs.my.inconsolata-psf; micro-kdl = pkgs.my.micro-kdl; micro-nordcolors = pkgs.my.micro-nordcolors; micro-everforest = pkgs.my.micro-everforest; diff --git a/nixos/console.nix b/nixos/console.nix index 9ff1f8c4..9bb55d18 100644 --- a/nixos/console.nix +++ b/nixos/console.nix @@ -6,9 +6,13 @@ earlySetup = true; # The font should have PSF formats. Do not specify TTF and OTF # You can list current glyphs with `showconsolefont` - font = "${pkgs.my.cozette}/share/consolefonts/cozette_hidpi.psf"; + # + # Candidates: + # + # font = "${pkgs.my.cozette}/share/consolefonts/cozette_hidpi.psf"; + font = "${pkgs.my.inconsolata-psf}/share/consolefonts/Inconsolata-32r.psf"; - packages = with pkgs.my; [ cozette ]; + packages = with pkgs.my; [ inconsolata-psf ]; keyMap = "us"; # Applying iceberg for 16(0-15) console colors diff --git a/pkgs/default.nix b/pkgs/default.nix index 847d7dc3..ad92d349 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -49,6 +49,7 @@ beedii = pkgs.callPackage ./beedii { }; cozette = pkgs.callPackage ./cozette { }; + inconsolata-psf = pkgs.callPackage ./inconsolata-psf { }; posix_shared_functions = pkgs.callPackage ./posix_shared_functions { }; diff --git a/pkgs/inconsolata-psf/default.nix b/pkgs/inconsolata-psf/default.nix new file mode 100644 index 00000000..a4444b4b --- /dev/null +++ b/pkgs/inconsolata-psf/default.nix @@ -0,0 +1,37 @@ +{ + lib, + stdenvNoCC, + fetchFromGitHub, +}: + +# Patched because of nixpkgs does not include psf +# https://github.com/NixOS/nixpkgs/blob/41d21a82c38e226e234e16f4ff213b3fcf85e6e9/pkgs/data/fonts/cozette/default.nix#L1C1-L33C2 +stdenvNoCC.mkDerivation { + pname = "inconsolata-psf"; + version = "unstable-2016-05-02"; + + src = fetchFromGitHub { + owner = "xeechou"; + repo = "Inconsolata-psf"; + rev = "75778a3d5b0a05cb492d51120b055e91672b3bf8"; + sha256 = "sha256-kth0ExRdO3dhCd4AnIGh6MGLL3Msfq5+msk9ALs2yCk="; + }; + + installPhase = '' + runHook preInstall + + install -Dm644 *.psf -t $out/share/consolefonts + + runHook postInstall + ''; + + meta = with lib; { + description = "Transforming Inconsolata font to psf format for Linux console"; + homepage = "https://github.com/xeechou/Inconsolata-psf"; + license = licenses.ofl; + platforms = platforms.all; + maintainers = with maintainers; [ + kachick + ]; + }; +}