Fix the missing desktop file

This commit is contained in:
Sameer Rahmani 2024-04-05 22:32:40 +01:00
parent 9beeda8a9d
commit 02794af163
Signed by: lxsameer
GPG Key ID: 8741FACBF412FFA5
2 changed files with 53 additions and 14 deletions

View File

@ -67,6 +67,8 @@ let
paths = map (x: "${x}/bin/") (lib.lists.flatten runtimeBins);
pathsStr = lib.strings.concatStrings (lib.strings.intersperse ":" paths);
mimes = import ./mimes.nix;
in stdenv.mkDerivation (final: rec {
inherit version;
pname = "fg42";
@ -77,20 +79,6 @@ in stdenv.mkDerivation (final: rec {
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" ];
@ -98,12 +86,29 @@ in stdenv.mkDerivation (final: rec {
buildPhase = ''
LISPDIR=$out/share/fg42/
mkdir -p $out/bin
mkdir -p $out/share/applications/
install -d $LISPDIR
cp -rv ${src}/lisp/ $LISPDIR
cp -rv ${src}/share $out/
cp -rv ${src}/snippets $LISPDIR/snippets
cat >> $out/share/applications/FG42.desktop << EOF
[Desktop Entry]
Encoding=UTF-8
Name=FG42
GenericName=FG42
Comment=The nix base Emacs bundle for advance users
MimeType=${mimes.mimeTypes}
Type=Application
Terminal=false
Categories=Development;TextEditor;
StartupWMClass=FG42
Exec=${placeholder "out"}/bin/fg42
Icon=fg42
Version=${version}
EOF
runHook preBuild
cd $LISPDIR

34
nix/mimes.nix Normal file
View File

@ -0,0 +1,34 @@
# 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/>.
rec {
types = [
"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"
];
mimeTypes = builtins.concatStringsSep ";" types;
}