configs/emacs: move things around so I can add packages

It would be nice if they weren't system level.. but this works
This commit is contained in:
Aaron Bieber 2024-09-06 09:49:49 -06:00
parent ab773d3f69
commit f7dcd6dcd7
No known key found for this signature in database
4 changed files with 48 additions and 29 deletions

View File

@ -3,17 +3,18 @@
./alacritty.nix ./alacritty.nix
./ca.nix ./ca.nix
./ci.nix ./ci.nix
./smug.nix
./konsole.nix
./colemak.nix ./colemak.nix
./dns.nix ./dns.nix
./doas.nix ./doas.nix
./emacs.nix
./git.nix ./git.nix
./konsole.nix
./manager.nix ./manager.nix
./neovim.nix ./neovim.nix
./net-overlay.nix ./net-overlay.nix
./nix.nix ./nix.nix
./polybar.nix ./polybar.nix
./smug.nix
./ssh.nix ./ssh.nix
./tmux.nix ./tmux.nix
./update.nix ./update.nix

View File

@ -1,21 +1,31 @@
{ emacsWithPackagesFromUsePackage { config
, pkgs , pkgs
, emacsPkg ? pkgs.emacs-pgtk , isUnstable
, lib
, ... , ...
}: }:
emacsWithPackagesFromUsePackage { let
config = ./emacs.org; myEmacs = pkgs.callPackage ../pkgs/emacs.nix { inherit isUnstable; };
editorScript = pkgs.writeShellScriptBin "emacseditor" ''
if [ -z "$1" ]; then
exec ${myEmacs}/bin/emacsclient --create-frame --alternate-editor ${myEmacs}/bin/emacs
else
exec ${myEmacs}/bin/emacsclient --alternate-editor ${myEmacs}/bin/emacs "$@"
fi
'';
in
{
config = {
environment = {
variables.EDITOR = lib.mkOverride 900 "emacseditor";
systemPackages = with pkgs; [
(aspellWithDicts (dicts: with dicts; [ en en-computers es de ]))
go-font
texlive.combined.scheme-full
alwaysEnsure = true; myEmacs
alwaysTangle = true; editorScript
];
defaultInitFile = true;
package = emacsPkg;
override = epkgs: epkgs // {
ollama = pkgs.callPackage ../pkgs/ollama-el.nix {
inherit (pkgs) fetchFromGitHub;
inherit (epkgs) trivialBuild;
}; };
}; };
} }

View File

@ -2,7 +2,6 @@
, lib , lib
, pkgs , pkgs
, xinlib , xinlib
, isUnstable
, inputs , inputs
, ... , ...
}: }:
@ -12,17 +11,9 @@ let
inherit (inputs.beyt.packages.${pkgs.system}) beyt; inherit (inputs.beyt.packages.${pkgs.system}) beyt;
firefox = import ../configs/firefox.nix { inherit pkgs; }; firefox = import ../configs/firefox.nix { inherit pkgs; };
rage = pkgs.writeScriptBin "rage" (import ../bins/rage.nix { inherit pkgs; }); rage = pkgs.writeScriptBin "rage" (import ../bins/rage.nix { inherit pkgs; });
myEmacs = pkgs.callPackage ../configs/emacs.nix { inherit isUnstable; };
rpr = rpr =
pkgs.writeScriptBin "rpr" pkgs.writeScriptBin "rpr"
(import ../bins/rpr.nix { inherit (pkgs) hut gh tea; }); (import ../bins/rpr.nix { inherit (pkgs) hut gh tea; });
editorScript = pkgs.writeShellScriptBin "emacseditor" ''
if [ -z "$1" ]; then
exec ${myEmacs}/bin/emacsclient --create-frame --alternate-editor ${myEmacs}/bin/emacs
else
exec ${myEmacs}/bin/emacsclient --alternate-editor ${myEmacs}/bin/emacs "$@"
fi
'';
promnesia = promnesia =
pkgs.python3Packages.callPackage ../pkgs/promnesia.nix { inherit pkgs; }; pkgs.python3Packages.callPackage ../pkgs/promnesia.nix { inherit pkgs; };
hpi = pkgs.python3Packages.callPackage ../pkgs/hpi.nix { inherit pkgs; }; hpi = pkgs.python3Packages.callPackage ../pkgs/hpi.nix { inherit pkgs; };
@ -113,10 +104,8 @@ with lib; {
SSH_AUTH_SOCK = "$HOME/.traygent"; SSH_AUTH_SOCK = "$HOME/.traygent";
OLLAMA_HOST = "https://ollama.otter-alligator.ts.net"; OLLAMA_HOST = "https://ollama.otter-alligator.ts.net";
}; };
variables.EDITOR = mkOverride 900 "emacseditor";
systemPackages = with pkgs; (xinlib.filterList [ systemPackages = with pkgs; (xinlib.filterList [
alacritty alacritty
(aspellWithDicts (dicts: with dicts; [ en en-computers es de ]))
bc bc
beyt beyt
black black
@ -137,8 +126,6 @@ with lib; {
zeal zeal
trayscale trayscale
myEmacs
editorScript
(callPackage ../configs/helix.nix { }) (callPackage ../configs/helix.nix { })
]); ]);
}; };

21
pkgs/emacs.nix Normal file
View File

@ -0,0 +1,21 @@
{ emacsWithPackagesFromUsePackage
, pkgs
, emacsPkg ? pkgs.emacs-pgtk
, ...
}:
emacsWithPackagesFromUsePackage {
config = ../configs/emacs.org;
alwaysEnsure = true;
alwaysTangle = true;
defaultInitFile = true;
package = emacsPkg;
override = epkgs: epkgs // {
ollama = pkgs.callPackage ../pkgs/ollama-el.nix {
inherit (pkgs) fetchFromGitHub;
inherit (epkgs) trivialBuild;
};
};
}