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 {}; ourPackages = pkgs.callPackage ./nix/packages.nix {};
fg42 = pkgs.callPackage ./nix/fg42.nix { fg42 = pkgs.callPackage ./nix/fg42.nix {
inherit elispPkgs ourPackages nixpkgs; inherit elispPkgs ourPackages;
srcDir = ./.; srcDir = ./.;
emacs = lemacs; 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 # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
{ { lib, stdenv, elispPkgs, srcDir, emacsPackagesFor, ourPackages, direnv
lib, , makeDesktopItem, nix
nixpkgs,
stdenv, , nil, # nix lsp server
elispPkgs,
srcDir,
emacsPackagesFor,
ourPackages,
writeText,
symlinkJoin,
direnv,
nix,
nil, # nix lsp server
# python deps # python deps
python311, python311, python3Packages,
python3Packages,
# This is a set of system tools required for FG42 # This is a set of system tools required for FG42
# to work. # to work.
pyright, pyright, emacs, ripgrep, git, texinfo, vazir-fonts, fira-code, nerdfonts
emacs, , fira-mono, noto-fonts, gcc, ltex-ls, bash, tree-sitter,
ripgrep,
git,
texinfo,
vazir-fonts,
fira-code,
nerdfonts,
noto-fonts,
gcc,
ltex-ls,
bash,
tree-sitter,
supportWM ? true, supportWM ? true, xorg, slock,
xorg,
slock,
supportPython ? true, supportPython ? true, supportVerilog ? true, svls, verilator, }:
supportVerilog ? true,
svls,
verilator,
}:
with builtins; with builtins;
let let
version = "4.0.0";
getPkg = epkgs: pkg: getPkg = epkgs: pkg:
if hasAttr pkg epkgs if hasAttr pkg epkgs then getAttr pkg epkgs else getAttr pkg ourPackages;
then getAttr pkg epkgs
else getAttr pkg ourPackages;
emacsBundle = (emacsPackagesFor emacs).withPackages (epkgs: emacsBundle = (emacsPackagesFor emacs).withPackages (epkgs:
(map (x: getPkg epkgs x) elispPkgs) ++ [ (map (x: getPkg epkgs x) elispPkgs)
epkgs.treesit-grammars.with-all-grammars ++ [ epkgs.treesit-grammars.with-all-grammars ]);
]
);
maintainers = import ./maintainers.nix; maintainers = import ./maintainers.nix;
runtimeBins = [ runtimeBins = [ ripgrep git ltex-ls tree-sitter direnv nix nil ]
ripgrep ++ (lib.optional supportPython [
git
ltex-ls
tree-sitter
direnv
nix
nil
] ++ (lib.optional supportPython [
python311 python311
# Python deps # Python deps
python311 python311
@ -87,9 +50,8 @@ let
python3Packages.black python3Packages.black
python3Packages.pylint python3Packages.pylint
python3Packages.flake8 python3Packages.flake8
]) ++ (lib.optional supportVerilog [ ]) ++ (lib.optional supportVerilog [ svls ])
svls ++ (lib.optional (supportVerilog && stdenv.isLinux) [
]) ++ (lib.optional (supportVerilog && stdenv.isLinux) [
# SystemC is required by verilator that at the # SystemC is required by verilator that at the
# moment is only available on Linux # moment is only available on Linux
verilator verilator
@ -103,8 +65,29 @@ let
pathsStr = lib.strings.concatStrings (lib.strings.intersperse ":" paths); pathsStr = lib.strings.concatStrings (lib.strings.intersperse ":" paths);
in stdenv.mkDerivation (final: rec { in stdenv.mkDerivation (final: rec {
inherit version;
pname = "fg42"; 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; src = srcDir;
outputs = [ "out" ]; outputs = [ "out" ];
@ -178,9 +161,11 @@ in stdenv.mkDerivation (final: rec{
cat >> $out/share/runtiem_deps << EOF cat >> $out/share/runtiem_deps << EOF
${vazir-fonts} ${vazir-fonts}
${fira-code} ${fira-code}
${fira-mono}
${nerdfonts} ${nerdfonts}
${noto-fonts} ${noto-fonts}
${lib.strings.concatLines paths} ${lib.strings.concatLines paths}
${desktop}/share/applications/FG42.desktop
EOF EOF
runHook postBuild runHook postBuild
@ -195,15 +180,7 @@ in stdenv.mkDerivation (final: rec{
runHook postInstall runHook postInstall
''; '';
buildInputs = [ emacs emacsBundle git texinfo gcc bash ];
buildInputs = [
emacs
emacsBundle
git
texinfo
gcc
bash
];
addEmacsNativeLoadPath = true; 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