diff --git a/home/programs/study/default.nix b/home/programs/study/default.nix index 3c4461f..6fb6fae 100644 --- a/home/programs/study/default.nix +++ b/home/programs/study/default.nix @@ -3,6 +3,5 @@ home.packages = with pkgs; [ pspp zotero - fiz ]; } diff --git a/home/tweaks/stylix.nix b/home/tweaks/stylix.nix index f4ccf27..3d480ef 100644 --- a/home/tweaks/stylix.nix +++ b/home/tweaks/stylix.nix @@ -18,7 +18,7 @@ in }; fonts = { monospace.name = "Maple Mono"; - monospace.package = pkgs.maple-mono.variable; + monospace.package = pkgs.maple-mono-variable; sansSerif.name = "LXGW WenKai"; sansSerif.package = pkgs.lxgw-wenkai; serif.name = "LXGW WenKai"; diff --git a/os/system/fonts.nix b/os/system/fonts.nix index 9d52fe1..f468f65 100644 --- a/os/system/fonts.nix +++ b/os/system/fonts.nix @@ -10,8 +10,7 @@ nerd-fonts.hurmit nerd-fonts.monofur lxgw-wenkai - maple-mono.NF-CN - maple-mono.variable + maple-mono-variable ]; fonts.fontDir.enable = true; } diff --git a/pkgs/default.nix b/pkgs/default.nix index 28113e7..3055cfa 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -6,8 +6,8 @@ kose-font = pkgs.callPackage ./fonts/kose.nix { }; hugmetight-font = pkgs.callPackage ./fonts/hugmetight.nix { }; custom-colorschemes = pkgs.callPackage ./customColorSchemes { }; - fiz = pkgs.callPackage ./fiz.nix { }; hellwm = pkgs.callPackage ./hellwm.nix { }; wallpapers = pkgs.callPackage ./wallpapers.nix { }; wechat = pkgs.callPackage ./wechat.nix { }; + maple-mono-variable = pkgs.callPackage ./maple-mono-variable.nix { }; } diff --git a/pkgs/fiz.nix b/pkgs/fiz.nix deleted file mode 100644 index 3276eac..0000000 --- a/pkgs/fiz.nix +++ /dev/null @@ -1,78 +0,0 @@ -# copied from https://github.com/nix-community/nur-combined/blob/main/repos/hhr2020/pkgs/fiz/default.nix -{ - lib, - stdenv, - rustPlatform, - fetchNpmDeps, - cargo-tauri, - copyDesktopItems, - glib-networking, - nodejs, - npmHooks, - openssl, - pkg-config, - webkitgtk_4_1, - wrapGAppsHook4, - fetchFromGitHub, - jq, - moreutils, -}: - -rustPlatform.buildRustPackage rec { - pname = "fiz"; - version = "0.3.5"; - - src = fetchFromGitHub { - owner = "CrazySpottedDove"; - repo = "fiz"; - rev = "cae430f74ebaafe9167e7a8698540179162e5d87"; - hash = "sha256-8Fyvy52KQyG8+kf9BGUQ2zyM6+iUFKaOfL9h15QBKOk="; - }; - - useFetchCargoVendor = true; - cargoHash = "sha256-1ERKMENPMTn5CPK4d5uTZ18ONMrCEY2PIK1GqSGHnSg="; - - npmDeps = fetchNpmDeps { - name = "${pname}-npm-deps-${version}"; - inherit src; - hash = "sha256-jSgBrMPDmC98bcG44s0npA0Gu0mG8/qbJ3X3wNIHSY8="; - }; - - nativeBuildInputs = [ - cargo-tauri.hook - nodejs - npmHooks.npmConfigHook - - pkg-config - wrapGAppsHook4 - copyDesktopItems - - jq - moreutils - ]; - - buildInputs = - [ openssl ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - glib-networking - webkitgtk_4_1 - ]; - - cargoRoot = "src-tauri"; - buildAndTestSubdir = cargoRoot; - - postPatch = '' - jq \ - '.bundle.createUpdaterArtifacts = false' \ - src-tauri/tauri.conf.json \ - | sponge src-tauri/tauri.conf.json - ''; - - meta = { - homepage = "https://github.com/CrazySpottedDove/fiz"; - changelog = "https://github.com/CrazySpottedDove/fiz/releases/tag/app-v${version}"; - description = "Third-party app for Learning in ZJU"; - mainProgram = "fiz"; - license = lib.licenses.mit; - }; -} diff --git a/pkgs/maple-mono-variable.nix b/pkgs/maple-mono-variable.nix new file mode 100644 index 0000000..2c5ca6e --- /dev/null +++ b/pkgs/maple-mono-variable.nix @@ -0,0 +1,34 @@ +{ + lib, + stdenv, + unzip, + fetchurl, +}: +stdenv.mkDerivation rec { + pname = "MapleMono-Variable"; + version = "7.3"; + src = fetchurl { + url = "https://github.com/subframe7536/Maple-font/releases/download/v${version}/${pname}.zip"; + sha256 = "1wfgfginnrqk2ppiyxb6jbvflha9kx0yqj84mbw04c923mav56z0"; + }; + + # Work around the "unpacker appears to have produced no directories" + # case that happens when the archive doesn't have a subdirectory. + sourceRoot = "."; + nativeBuildInputs = [ unzip ]; + installPhase = '' + find . -name '*.ttf' -exec install -Dt $out/share/fonts/truetype {} \; + find . -name '*.otf' -exec install -Dt $out/share/fonts/opentype {} \; + find . -name '*.woff2' -exec install -Dt $out/share/fonts/woff2 {} \; + ''; + + meta = with lib; { + homepage = "https://github.com/subframe7536/Maple-font"; + description = '' + Open source Nerd Font CN unhinted font with round corner and ligatures for IDE and command line + ''; + license = licenses.ofl; + platforms = platforms.all; + maintainers = with maintainers; [ oluceps ]; + }; +}