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,103 +13,86 @@
# #
# 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,
elispPkgs,
srcDir,
emacsPackagesFor,
ourPackages,
writeText,
symlinkJoin,
direnv,
nix,
nil, # nix lsp server
# python deps , nil, # nix lsp server
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,
supportWM ? true, # python deps
xorg, python311, python3Packages,
slock, # 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, supportWM ? true, xorg, slock,
supportVerilog ? true,
svls, supportPython ? true, supportVerilog ? true, svls, verilator, }:
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 python311
ltex-ls # Python deps
tree-sitter python311
direnv pyright
nix
nil
] ++ (lib.optional supportPython [
python311
# Python deps
python311
pyright
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 ]) ++ (lib.optional (supportWM && stdenv.isLinux) [
]) ++ (lib.optional (supportWM && stdenv.isLinux) [ # Window manager supports works on Linux only
# Window manager supports works on Linux only xorg.xhost
xorg.xhost slock
slock ]);
]);
paths = map (x: "${x}/bin/") (lib.lists.flatten runtimeBins); paths = map (x: "${x}/bin/") (lib.lists.flatten runtimeBins);
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" ];
buildPhase = '' buildPhase = ''
LISPDIR=$out/share/fg42/ LISPDIR=$out/share/fg42/
mkdir -p $out/bin mkdir -p $out/bin
install -d $LISPDIR install -d $LISPDIR
@ -178,32 +161,26 @@ 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
''; '';
installPhase = '' installPhase = ''
runHook preInstall runHook preInstall
#LISPDIR=$out/share/fg42/lisp/ #LISPDIR=$out/share/fg42/lisp/
#emacs --batch -l package --eval "(package-generate-autoloads \"${pname}\" \"$LISPDIR\")" #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; addEmacsNativeLoadPath = true;
@ -214,12 +191,12 @@ in stdenv.mkDerivation (final: rec{
maintainers = [ maintainers.lxsameer ]; maintainers = [ maintainers.lxsameer ];
description = "The mighty editor for the emacsians"; description = "The mighty editor for the emacsians";
longDescription = '' longDescription = ''
FG42 is a framework to create and editor and window manager based on GNU/Emacs. 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 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. 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; 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