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:
|
||||
{ config, lib, pkgs, ... }:
|
||||
{ options, config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.programs.doom-emacs;
|
||||
inherit (lib) literalExample mkEnableOption mkIf mkOption types;
|
||||
inherit (lib) literalExample mkEnableOption mkIf mkMerge mkOption optional types;
|
||||
overlayType = lib.mkOptionType {
|
||||
name = "overlay";
|
||||
description = "Emacs packages overlay";
|
||||
@ -89,6 +89,7 @@ in
|
||||
dependencyOverrides = inputs;
|
||||
};
|
||||
in
|
||||
mkMerge ([
|
||||
{
|
||||
home.file.".emacs.d/init.el".text = ''
|
||||
(load "default.el")
|
||||
@ -99,10 +100,13 @@ in
|
||||
programs.emacs.package = emacs;
|
||||
programs.emacs.enable = true;
|
||||
|
||||
# Set the service's package but don't enable. Leave that up to the user
|
||||
services.emacs.package = emacs;
|
||||
|
||||
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
|
||||
services.emacs.package = emacs;
|
||||
})
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user