Break up the git feature in its own module
This commit is contained in:
parent
1e62751b69
commit
71dbe6ef93
|
@ -16,12 +16,31 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
final: prev:
|
final: prev:
|
||||||
rec {
|
rec {
|
||||||
|
/*
|
||||||
|
Create a value to be accessable on the Elisp side as a variable.
|
||||||
|
*/
|
||||||
defVar = name: defaultValue: docstring: {
|
defVar = name: defaultValue: docstring: {
|
||||||
inherit name defaultValue docstring;
|
inherit name defaultValue docstring;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
Create a value to be accessable on the Elisp side as a constant.
|
||||||
|
*/
|
||||||
defConst = defVar;
|
defConst = defVar;
|
||||||
|
|
||||||
|
/* Creates an Option attribute set for a boolean value option i.e an
|
||||||
|
option to be toggled on or off. The option is enabled by default:
|
||||||
|
|
||||||
|
Example:
|
||||||
|
mkAndEnableOption "foo"
|
||||||
|
=> { _type = "option"; default = true; description = "Whether to enable foo."; example = true; type = { ... }; }
|
||||||
|
*/
|
||||||
|
mkAndEnableOption = name: prev.mkOption {
|
||||||
|
default = true;
|
||||||
|
example = true;
|
||||||
|
description = "Whether to enable ${name}.";
|
||||||
|
type = prev.types.bool;
|
||||||
|
};
|
||||||
|
|
||||||
makeFG42Drv = { pname, version, ... }@args:
|
makeFG42Drv = { pname, version, ... }@args:
|
||||||
(pkgs.emacsPackages.trivialBuild args).overrideAttrs (old: {
|
(pkgs.emacsPackages.trivialBuild args).overrideAttrs (old: {
|
||||||
|
|
|
@ -24,6 +24,7 @@ let
|
||||||
modules = [
|
modules = [
|
||||||
./editor
|
./editor
|
||||||
./elisp
|
./elisp
|
||||||
|
./git
|
||||||
];
|
];
|
||||||
|
|
||||||
pkgsModule = { config, ... }: {
|
pkgsModule = { config, ... }: {
|
||||||
|
|
|
@ -22,7 +22,8 @@
|
||||||
{ lib, config, pkgs, makeFG42Drv, ... }:
|
{ lib, config, pkgs, makeFG42Drv, ... }:
|
||||||
with lib;
|
with lib;
|
||||||
let
|
let
|
||||||
cfg = config.fg42.features;
|
cfg = config.fg42.features.git;
|
||||||
|
|
||||||
deps =
|
deps =
|
||||||
(with pkgs.emacsPackages; [
|
(with pkgs.emacsPackages; [
|
||||||
magit
|
magit
|
||||||
|
@ -38,7 +39,7 @@ let
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.fg42.features.git = mkEnableOption "git";
|
options.fg42.features.git.enable = mkAndEnableOption "git";
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
fg42.elispPackages = [ drv ] ++ deps;
|
fg42.elispPackages = [ drv ] ++ deps;
|
||||||
|
@ -46,5 +47,7 @@ in
|
||||||
fg42.paths = (with pkgs;[
|
fg42.paths = (with pkgs;[
|
||||||
git
|
git
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
fg42.requires = [ drv.pname ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,7 +104,6 @@ in
|
||||||
|
|
||||||
fg42.requires = mkOption {
|
fg42.requires = mkOption {
|
||||||
type = types.listOf types.str;
|
type = types.listOf types.str;
|
||||||
readOnly = true;
|
|
||||||
description = ''
|
description = ''
|
||||||
A list of Emacs packages to preload in compile time.
|
A list of Emacs packages to preload in compile time.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue