2024-04-12 22:18:03 +01:00
|
|
|
# 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/>.
|
|
|
|
|
|
|
|
# This is the home manager module that exposes FG42. It differs
|
|
|
|
# from FG42 modules that are structurally the same but used in
|
|
|
|
# different context
|
2024-04-15 18:57:22 +01:00
|
|
|
{ lib, pkgs, config, options, ... }:
|
2024-04-12 22:18:03 +01:00
|
|
|
with lib;
|
2024-04-15 18:57:22 +01:00
|
|
|
let
|
|
|
|
nix2elispName = pkg: (builtins.replaceStrings [ "fg42-" ] [ "fg42/" ] pkg.pname);
|
|
|
|
in
|
2024-04-12 22:18:03 +01:00
|
|
|
{
|
|
|
|
options = {
|
|
|
|
fg42.version = mkOption {
|
|
|
|
type = types.str;
|
|
|
|
visible = true;
|
|
|
|
readOnly = true;
|
|
|
|
description = "FG42's version.";
|
|
|
|
};
|
|
|
|
|
|
|
|
fg42.emacs = mkOption {
|
|
|
|
type = types.package;
|
|
|
|
default = pkgs.emacs29.override ({
|
|
|
|
withTreeSitter = true;
|
|
|
|
});
|
|
|
|
description = "What Emacs package to use.";
|
|
|
|
};
|
|
|
|
|
|
|
|
fg42.elispPackages = mkOption {
|
|
|
|
type = types.listOf types.package;
|
|
|
|
default = [ ];
|
|
|
|
description = ''
|
|
|
|
A list of Emacs packages that should be included in FG42
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
fg42.paths = mkOption {
|
|
|
|
type = types.listOf types.package;
|
|
|
|
default = [ ];
|
|
|
|
description = ''
|
|
|
|
A list of packages that should be added to FG42's PATH
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
fg42.mimeTypes = mkOption {
|
|
|
|
type = types.listOf types.str;
|
|
|
|
default = [ ];
|
|
|
|
description = ''
|
|
|
|
A list of mineType strings that FG42 should handle via
|
|
|
|
desktop file.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
fg42.fonts = mkOption {
|
|
|
|
type = types.listOf types.package;
|
|
|
|
default = [ ];
|
|
|
|
description = ''
|
|
|
|
A list of font packages that should be included in FG42
|
|
|
|
'';
|
|
|
|
};
|
2024-04-13 22:21:20 +01:00
|
|
|
|
2024-04-14 19:49:21 +01:00
|
|
|
fg42.font = mkOption {
|
|
|
|
type = types.uniq types.str;
|
|
|
|
example = "fg42.font = ''(cons \"Fira Code\" 10) '';";
|
|
|
|
description = "The default font for FG42";
|
|
|
|
};
|
|
|
|
|
2024-04-14 21:07:12 +01:00
|
|
|
|
|
|
|
fg42.theme = mkOption {
|
|
|
|
type = types.str;
|
|
|
|
description = "The theme name to use with FG42.";
|
2024-04-13 22:21:20 +01:00
|
|
|
};
|
2024-04-15 18:57:22 +01:00
|
|
|
|
2024-04-14 21:07:12 +01:00
|
|
|
fg42.theme-package-name = mkOption
|
|
|
|
{
|
|
|
|
type = types.str;
|
|
|
|
description = ''
|
|
|
|
The theme package name to use with FG42. The package should be added
|
|
|
|
to `elispPackages` already;
|
|
|
|
'';
|
|
|
|
};
|
2024-04-13 22:21:20 +01:00
|
|
|
|
2024-04-15 18:57:22 +01:00
|
|
|
fg42.requires = mkOption {
|
|
|
|
type = types.listOf types.str;
|
|
|
|
readOnly = true;
|
|
|
|
description = ''
|
|
|
|
A list of Emacs packages to preload in compile time.
|
|
|
|
|
|
|
|
In general you want your entry point module in this list
|
|
|
|
to setup your autoloads, hooks, and everything.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
fg42.docstrings = mkOption {
|
|
|
|
type = types.attrsOf types.str;
|
|
|
|
readOnly = true;
|
|
|
|
description = ''
|
|
|
|
A list of Emacs packages to preload in compile time.
|
|
|
|
|
|
|
|
In general you want your entry point module in this list
|
|
|
|
to setup your autoloads, hooks, and everything.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2024-04-12 22:18:03 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
config = {
|
|
|
|
fg42.version = import ../version.nix { };
|
2024-04-15 18:57:22 +01:00
|
|
|
# Extract the package pname's to pass to elisp to `require` them in the init
|
|
|
|
# file, while compiling.
|
|
|
|
fg42.requires = map nix2elispName config.fg42.elispPackages;
|
|
|
|
fg42.docstrings = (with builtins;
|
|
|
|
let
|
|
|
|
desc = opt:
|
|
|
|
if hasAttr "description" opt
|
|
|
|
then opt.description
|
|
|
|
else "";
|
|
|
|
|
|
|
|
in
|
|
|
|
lib.concatMapAttrs
|
|
|
|
(k: v: { ${k} = desc v; })
|
|
|
|
options.fg42);
|
2024-04-12 22:18:03 +01:00
|
|
|
};
|
|
|
|
}
|