Fix the missing Fira Mono font

This commit is contained in:
Sameer Rahmani 2024-03-27 23:50:44 +00:00
parent 1f4e6f158e
commit 477f24b67b
Signed by: lxsameer
GPG Key ID: 8741FACBF412FFA5
4 changed files with 106 additions and 109 deletions

View File

@ -55,7 +55,7 @@
ourPackages = pkgs.callPackage ./nix/packages.nix {};
fg42 = pkgs.callPackage ./nix/fg42.nix {
inherit elispPkgs ourPackages nixpkgs;
inherit elispPkgs ourPackages;
srcDir = ./.;
emacs = lemacs;
};

33
nix/desktop.nix Normal file
View File

@ -0,0 +1,33 @@
# Fg42 - Emacs Editor for advance users
#
# Copyright (c) 2010-2024 Sameer Rahmani <lxsameer@gnu.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
{ pkgs, fg42, version }:
{
desktop = pkgs.writeText "FG42.desktop" ''
[Desktop Entry]
Encoding=UTF-8
Name=FG42
GenericName=FG42
Comment=Emacs Editor for advance users
MimeType=text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-java;application/x-shellscript;text/x-c;text/x-c++;text/x-ruby;text/x-python;text/x-clojure;text/css;text/html;text/x-javascript;
Type=Application
Terminal=false
Categories=Development;TextEditor;
StartupWMClass=FG42
Exec=${fg42} %F
Icon=fg42
Version=${version}
'';
}

View File

@ -13,72 +13,35 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
{
lib,
nixpkgs,
stdenv,
elispPkgs,
srcDir,
emacsPackagesFor,
ourPackages,
writeText,
symlinkJoin,
direnv,
nix,
nil, # nix lsp server
{ lib, stdenv, elispPkgs, srcDir, emacsPackagesFor, ourPackages, direnv
, makeDesktopItem, nix
, nil, # nix lsp server
# python deps
python311,
python3Packages,
python311, python3Packages,
# This is a set of system tools required for FG42
# to work.
pyright,
emacs,
ripgrep,
git,
texinfo,
vazir-fonts,
fira-code,
nerdfonts,
noto-fonts,
gcc,
ltex-ls,
bash,
tree-sitter,
pyright, emacs, ripgrep, git, texinfo, vazir-fonts, fira-code, nerdfonts
, fira-mono, noto-fonts, gcc, ltex-ls, bash, tree-sitter,
supportWM ? true,
xorg,
slock,
supportWM ? true, xorg, slock,
supportPython ? true,
supportVerilog ? true,
svls,
verilator,
}:
supportPython ? true, supportVerilog ? true, svls, verilator, }:
with builtins;
let
version = "4.0.0";
getPkg = epkgs: pkg:
if hasAttr pkg epkgs
then getAttr pkg epkgs
else getAttr pkg ourPackages;
if hasAttr pkg epkgs then getAttr pkg epkgs else getAttr pkg ourPackages;
emacsBundle = (emacsPackagesFor emacs).withPackages (epkgs:
(map (x: getPkg epkgs x) elispPkgs) ++ [
epkgs.treesit-grammars.with-all-grammars
]
);
(map (x: getPkg epkgs x) elispPkgs)
++ [ epkgs.treesit-grammars.with-all-grammars ]);
maintainers = import ./maintainers.nix;
runtimeBins = [
ripgrep
git
ltex-ls
tree-sitter
direnv
nix
nil
] ++ (lib.optional supportPython [
runtimeBins = [ ripgrep git ltex-ls tree-sitter direnv nix nil ]
++ (lib.optional supportPython [
python311
# Python deps
python311
@ -87,9 +50,8 @@ let
python3Packages.black
python3Packages.pylint
python3Packages.flake8
]) ++ (lib.optional supportVerilog [
svls
]) ++ (lib.optional (supportVerilog && stdenv.isLinux) [
]) ++ (lib.optional supportVerilog [ svls ])
++ (lib.optional (supportVerilog && stdenv.isLinux) [
# SystemC is required by verilator that at the
# moment is only available on Linux
verilator
@ -103,8 +65,29 @@ let
pathsStr = lib.strings.concatStrings (lib.strings.intersperse ":" paths);
in stdenv.mkDerivation (final: rec {
inherit version;
pname = "fg42";
version = "4.0.0";
desktop = makeDesktopItem {
name = "FG42";
desktopName = "FG42";
exec = "${placeholder "out"}/bin/fg42 %F";
comment = "Emacs Editor for advance users";
};
# [Desktop Entry]
# Encoding=UTF-8
# Name=FG42
# GenericName=FG42
# Comment=
# MimeType=text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-java;application/x-shellscript;text/x-c;text/x-c++;text/x-ruby;text/x-python;text/x-clojure;text/css;text/html;text/x-javascript;
# Type=Application
# Terminal=false
# Categories=Development;TextEditor;
# StartupWMClass=FG42
# Exec=
# Icon=fg42
# Version=${version}
# '';
src = srcDir;
outputs = [ "out" ];
@ -178,9 +161,11 @@ in stdenv.mkDerivation (final: rec{
cat >> $out/share/runtiem_deps << EOF
${vazir-fonts}
${fira-code}
${fira-mono}
${nerdfonts}
${noto-fonts}
${lib.strings.concatLines paths}
${desktop}/share/applications/FG42.desktop
EOF
runHook postBuild
@ -195,15 +180,7 @@ in stdenv.mkDerivation (final: rec{
runHook postInstall
'';
buildInputs = [
emacs
emacsBundle
git
texinfo
gcc
bash
];
buildInputs = [ emacs emacsBundle git texinfo gcc bash ];
addEmacsNativeLoadPath = true;

View File

@ -1,13 +0,0 @@
[Desktop Entry]
Encoding=UTF-8
Name=FG42
GenericName=FG42
Comment=An Emacs base editor for true believers
MimeType=text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-java;application/x-shellscript;text/x-c;text/x-c++;text/x-ruby;text/x-python;text/x-clojure;text/css;text/html;text/x-javascript;
Type=Application
Terminal=false
Categories=Development;TextEditor;
StartupWMClass=FG42
Exec=/usr/local/bin/fg42 %F
Icon=fg42
Version=2.67