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,103 +13,86 @@
#
# 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
# python deps
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,
, nil, # nix lsp server
supportWM ? true,
xorg,
slock,
# python deps
python311, python3Packages,
# This is a set of system tools required for FG42
# to work.
pyright, emacs, ripgrep, git, texinfo, vazir-fonts, fira-code, nerdfonts
, fira-mono, noto-fonts, gcc, ltex-ls, bash, tree-sitter,
supportPython ? true,
supportVerilog ? true,
svls,
verilator,
}:
supportWM ? true, xorg, slock,
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 [
python311
# Python deps
python311
pyright
runtimeBins = [ ripgrep git ltex-ls tree-sitter direnv nix nil ]
++ (lib.optional supportPython [
python311
# Python deps
python311
pyright
python3Packages.black
python3Packages.pylint
python3Packages.flake8
]) ++ (lib.optional supportVerilog [
svls
]) ++ (lib.optional (supportVerilog && stdenv.isLinux) [
# SystemC is required by verilator that at the
# moment is only available on Linux
verilator
]) ++ (lib.optional (supportWM && stdenv.isLinux) [
# Window manager supports works on Linux only
xorg.xhost
slock
]);
python3Packages.black
python3Packages.pylint
python3Packages.flake8
]) ++ (lib.optional supportVerilog [ svls ])
++ (lib.optional (supportVerilog && stdenv.isLinux) [
# SystemC is required by verilator that at the
# moment is only available on Linux
verilator
]) ++ (lib.optional (supportWM && stdenv.isLinux) [
# Window manager supports works on Linux only
xorg.xhost
slock
]);
paths = map (x: "${x}/bin/") (lib.lists.flatten runtimeBins);
pathsStr = lib.strings.concatStrings (lib.strings.intersperse ":" paths);
in stdenv.mkDerivation (final: rec{
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" ];
buildPhase = ''
buildPhase = ''
LISPDIR=$out/share/fg42/
mkdir -p $out/bin
install -d $LISPDIR
@ -178,32 +161,26 @@ 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
'';
installPhase = ''
runHook preInstall
runHook preInstall
#LISPDIR=$out/share/fg42/lisp/
#emacs --batch -l package --eval "(package-generate-autoloads \"${pname}\" \"$LISPDIR\")"
#LISPDIR=$out/share/fg42/lisp/
#emacs --batch -l package --eval "(package-generate-autoloads \"${pname}\" \"$LISPDIR\")"
runHook postInstall
'';
runHook postInstall
'';
buildInputs = [
emacs
emacsBundle
git
texinfo
gcc
bash
];
buildInputs = [ emacs emacsBundle git texinfo gcc bash ];
addEmacsNativeLoadPath = true;
@ -214,12 +191,12 @@ in stdenv.mkDerivation (final: rec{
maintainers = [ maintainers.lxsameer ];
description = "The mighty editor for the emacsians";
longDescription = ''
FG42 is a framework to create and editor and window manager based on GNU/Emacs.
It has a pre-defined setup as well which can be installed out of the box. But the
goal of this project is to provide the API necessary to create an integrated editor.
FG42 is a framework to create and editor and window manager based on GNU/Emacs.
It has a pre-defined setup as well which can be installed out of the box. But the
goal of this project is to provide the API necessary to create an integrated editor.
So you need to know about Emacs in advance.
'';
So you need to know about Emacs in advance.
'';
license = lib.licenses.gpl3Plus;
};

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