From 551122e5da0f8ca51ffc7da0cb063c627f34ebf7 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Tue, 8 Jul 2025 22:21:38 +0900 Subject: home-manager: manage font files by Nix --- README | 10 ++++------ flake.lock | 6 +++--- home-manager/modules/common.nix | 4 ++++ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/README b/README index 481cef5..16237b8 100644 --- a/README +++ b/README @@ -26,12 +26,11 @@ $ sudo apt upgrade $ ./bootstrap akashi +$ fc-cache -fv + $ sudo adduser $(whoami) docker $ cargo install alacritty - -$ curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share/fonts}"/SourceHanCodeJP.ttc --create-dirs https://github.com/adobe-fonts/source-han-code-jp/releases/latest/download/SourceHanCodeJP.ttc -$ fc-cache -fv ``` ## PC 168 @@ -44,11 +43,10 @@ $ brew install libiconv $ ./bootstrap pc168 -$ brew install --cask alacritty - -$ curl -fLo ~/Library/Fonts/SourceHanCodeJP.ttc --create-dirs https://github.com/adobe-fonts/source-han-code-jp/releases/latest/download/SourceHanCodeJP.ttc $ sudo atsutil databases -remove +$ brew install --cask alacritty + $ /usr/local/opt/ncurses/bin/infocmp tmux-256color > /var/tmp/tmux-256color.info $ tic -xe tmux-256color /var/tmp/tmux-256color.info diff --git a/flake.lock b/flake.lock index 6a8eee7..30d5bad 100644 --- a/flake.lock +++ b/flake.lock @@ -63,11 +63,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1751970608, - "narHash": "sha256-VqJN+Gl4Iqm+HTjboUf0sNUGQ32Y23358qAsTluf5lI=", + "lastModified": 1751980497, + "narHash": "sha256-LEJBKo9VwSLPWwKeXleeSQKZXBAAbESPX5iN2eWXwfs=", "owner": "nsfisis", "repo": "nur-packages", - "rev": "3676d489fbf39380e9f59d6abd4c20725180c4cc", + "rev": "7b625b804f580968d5836d01db262401eb38e321", "type": "github" }, "original": { diff --git a/home-manager/modules/common.nix b/home-manager/modules/common.nix index 140550b..231555e 100644 --- a/home-manager/modules/common.nix +++ b/home-manager/modules/common.nix @@ -102,6 +102,10 @@ in ".zshrc".source = ../config/zsh/.zshrc; "bin/__claude-code-notify".source = ../../bin/__claude-code-notify; "bin/tmux-pane-idx".source = ../../bin/tmux-pane-idx; + + "${if env.os == "macos" then "Library/Fonts/" else ".local/share/fonts/"}/SourceHanCodeJP.ttc" = { + source = "${nurpkgs.source-han-code-jp}/share/fonts/SourceHanCodeJP.ttc"; + }; }; home.sessionVariables = rec { -- cgit v1.2.3-70-g09d2