launchd for gpg and emacs

This commit is contained in:
willemml 2022-12-29 19:57:58 -08:00
parent e698956215
commit 2b6ec1955e
Signed by: willemml
GPG key ID: C3DE5DF6198DACBD
3 changed files with 35 additions and 4 deletions

View file

@ -4,6 +4,7 @@ let homeDirectory = config.home.homeDirectory;
in {
imports = [
./emacs.nix
./launchd.nix
./packages.nix
./programs.nix
];
@ -31,5 +32,5 @@ in {
variant = "colemak";
};
home.sessionVariables = { EDITOR = "emacs"; };
home.sessionVariables = { EDITOR = "emacsclient -c -nw"; };
}

28
launchd.nix Normal file
View file

@ -0,0 +1,28 @@
{ lib, config, pkgs, ... }:
{
launchd = {
enable = true;
agents.emacs = {
enable = true;
config = {
ProgramArguments = [ "${pkgs.emacs}/bin/emacs" "--fg-daemon" ];
KeepAlive.SuccessfulExit = true;
};
};
agents.gpg-daemon = {
enable = true;
config = {
ProgramArguments = [
"${pkgs.gnupg}/bin/gpg-agent"
''
--pinentry-program="${pkgs.pinentry_mac}/Applications/pinentry-mac.app/Contents/MacOS/pinentry-mac"''
"--daemon"
];
KeepAlive = true;
};
};
};
}

View file

@ -11,6 +11,7 @@
gpg = {
enable = true;
package = pkgs.gnupg;
settings = {
use-agent = true;
default-key = "860B5C62BF1FCE4272D26BF8C3DE5DF6198DACBD";
@ -68,12 +69,13 @@
ignoreDups = true;
};
shellAliases = {
em = "emacsclient -c";
emw = "emacsclient -c -nw";
ew = "emacs -nw";
em = "emacs";
emw = "emacs -nw";
ew = "emacsclient -c";
e = "$EDITOR";
np = "nix-shell -p";
hms = "home-manager switch";
cd = "z";
};
plugins = with pkgs; [
{