mirror of
https://github.com/nix-community/nix-doom-emacs
synced 2025-08-05 12:37:35 -05:00
home-manager: set services.emacs.package
only if it is defined
Fixes #263
This commit is contained in:
@ -1,8 +1,8 @@
|
|||||||
{ self, ... }@inputs:
|
{ self, ... }@inputs:
|
||||||
{ config, lib, pkgs, ... }:
|
{ options, config, lib, pkgs, ... }:
|
||||||
let
|
let
|
||||||
cfg = config.programs.doom-emacs;
|
cfg = config.programs.doom-emacs;
|
||||||
inherit (lib) literalExample mkEnableOption mkIf mkOption types;
|
inherit (lib) literalExample mkEnableOption mkIf mkMerge mkOption optional types;
|
||||||
overlayType = lib.mkOptionType {
|
overlayType = lib.mkOptionType {
|
||||||
name = "overlay";
|
name = "overlay";
|
||||||
description = "Emacs packages overlay";
|
description = "Emacs packages overlay";
|
||||||
@ -89,20 +89,24 @@ in
|
|||||||
dependencyOverrides = inputs;
|
dependencyOverrides = inputs;
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
mkMerge ([
|
||||||
home.file.".emacs.d/init.el".text = ''
|
{
|
||||||
(load "default.el")
|
home.file.".emacs.d/init.el".text = ''
|
||||||
'';
|
(load "default.el")
|
||||||
home.packages = with pkgs; [
|
'';
|
||||||
emacs-all-the-icons-fonts
|
home.packages = with pkgs; [
|
||||||
];
|
emacs-all-the-icons-fonts
|
||||||
programs.emacs.package = emacs;
|
];
|
||||||
programs.emacs.enable = true;
|
programs.emacs.package = emacs;
|
||||||
|
programs.emacs.enable = true;
|
||||||
|
|
||||||
|
programs.doom-emacs.package = emacs;
|
||||||
|
}
|
||||||
|
]
|
||||||
|
# this option is not available on darwin platform.
|
||||||
|
++ optional (options.services ? emacs) {
|
||||||
# Set the service's package but don't enable. Leave that up to the user
|
# Set the service's package but don't enable. Leave that up to the user
|
||||||
services.emacs.package = emacs;
|
services.emacs.package = emacs;
|
||||||
|
})
|
||||||
programs.doom-emacs.package = emacs;
|
|
||||||
}
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user