1

add emacs nativecomp/pgtk option

This commit is contained in:
2022-08-10 12:57:12 +02:00
parent 33dc750d4c
commit 341f1c0fef
2 changed files with 50 additions and 37 deletions

View File

@ -26,6 +26,7 @@ rec {
# Config my modules # Config my modules
modules.emacs = { modules.emacs = {
enable = true; enable = true;
pgtkNativeComp = true;
doom.enable = true; doom.enable = true;
doom.autoSync = true; doom.autoSync = true;
@ -47,6 +48,7 @@ rec {
# TODO: Store the external binaries for my derivations in GitHub LFS (Vital, NeuralDSP, other plugins etc.) # TODO: Store the external binaries for my derivations in GitHub LFS (Vital, NeuralDSP, other plugins etc.)
# TODO: Derivations for bottles like UPlay, NeuralDSP, LoL (don't know what is possible with bottles-cli though) # TODO: Derivations for bottles like UPlay, NeuralDSP, LoL (don't know what is possible with bottles-cli though)
# TODO: When bottles derivations are there remove the bottles option from audio/gaming module and assert that bottles is enabled in flatpak module # TODO: When bottles derivations are there remove the bottles option from audio/gaming module and assert that bottles is enabled in flatpak module
# TODO: Fix chinese input
# Chinese Input # Chinese Input
i18n.inputMethod.enabled = "fcitx5"; i18n.inputMethod.enabled = "fcitx5";
@ -169,7 +171,6 @@ rec {
# gcc # nvim needs this # gcc # nvim needs this
# Gnome extensions # Gnome extensions
# gnome.gnome-tweaks # Disabled since settings should be set declaratively
gnomeExtensions.appindicator gnomeExtensions.appindicator
gnomeExtensions.blur-my-shell gnomeExtensions.blur-my-shell
gnomeExtensions.sound-output-device-chooser gnomeExtensions.sound-output-device-chooser
@ -194,14 +195,14 @@ rec {
gnome.gnome-boxes gnome.gnome-boxes
gnome.sushi # Gnome files previews gnome.sushi # Gnome files previews
gnome.gnome-logs # systemd log viewer gnome.gnome-logs # systemd log viewer
gnome.gnome-tweaks # conflicts with nixos/hm gnome settings file gnome.gnome-tweaks # conflicts with nixos/hm gnome settings file sometimes, watch out what settings to change
gnome.gnome-nettool gnome.gnome-nettool
gnome.simple-scan gnome.simple-scan
gnome.gnome-sound-recorder
gnome.file-roller # archive manager gnome.file-roller # archive manager
# gnome-usage # Alternative system performance monitor (gnome.gnome-system-monitor is the preinstalled one) # gnome-usage # Alternative system performance monitor (gnome.gnome-system-monitor is the preinstalled one)
# gnome-secrets # Alternative keepass database viewer # gnome-secrets # Alternative keepass database viewer
gnome-firmware gnome-firmware
wike # Wikipedia viewer
# Ranger # Ranger
ranger ranger
@ -218,9 +219,7 @@ rec {
# Web # Web
signal-desktop signal-desktop
# Flatpak discord
yt-dlp yt-dlp
# Flatpak spotify
# thunderbird # Try gnome mail # thunderbird # Try gnome mail
protonmail-bridge protonmail-bridge
protonvpn-cli protonvpn-cli
@ -228,19 +227,21 @@ rec {
# Tools # Tools
# calibre # calibre
# virt-manager # Let's try gnome-boxes while we're at it # virt-manager # Let's try gnome-boxes while we're at it
gource gource # Visualize git commit log
keepassxc keepassxc
anki-bin # Use anki-bin as anki is some versions behind anki-bin # Use anki-bin as anki is some versions behind
libreoffice-fresh # libreoffice-fresh
jabref # manage bibilography jabref # manage bibilography
# wike # Wikipedia viewer
# Graphics # Media
wacomtablet wacomtablet
xournalpp xournalpp
# kdenlive # kdenlive
# krita # krita
# blender # blender
# godot # godot
# obs-studio
# Use NixCommunity binary cache # Use NixCommunity binary cache
cachix cachix
@ -684,7 +685,7 @@ rec {
EOF EOF
''; '';
} }
vim-gitgutter # vim-gitgutter
# YouCompleteMe # YouCompleteMe
{ {
@ -739,7 +740,7 @@ rec {
nextcloud-client = { nextcloud-client = {
enable = true; enable = true;
startInBackground = true; startInBackground = false; # TODO: Nextcloud doesn't start after login
}; };
}; };

View File

@ -17,10 +17,12 @@ in {
# Options is a vector of options this module defines # Options is a vector of options this module defines
# This module defines only the "emacs" option and suboptions "enable" and "doom" # This module defines only the "emacs" option and suboptions "enable" and "doom"
options.modules.emacs = { options.modules.emacs = {
enable = mkBoolOpt false "Enable the GNU Emacs editor"; enable = mkEnableOpt "Emacs module";
nativeComp = mkBoolOpt false "Use Emacs 28.x branch with native comp support";
pgtkNativeComp = mkBoolOpt false "Use Emacs 29.x branch with native comp and pure gtk support";
doom = { doom = {
enable = mkBoolOpt false "Use the Doom Emacs framework"; enable = mkEnableOpt "Doom Emacs framework";
autoSync = mkBoolOpt false "Sync Doom Emacs on nixos-rebuild"; autoSync = mkBoolOpt false "Sync Doom Emacs on nixos-rebuild";
autoUpgrade = mkBoolOpt false "Upgrade Doom Emacs on nixos-rebuild"; autoUpgrade = mkBoolOpt false "Upgrade Doom Emacs on nixos-rebuild";
}; };
@ -35,35 +37,45 @@ in {
# as it delays the evaluation (the if is moved inside the assignments inside the set) # as it delays the evaluation (the if is moved inside the assignments inside the set)
# mkIf can only be used in the config section (like mkMerge, mkForce and co) # mkIf can only be used in the config section (like mkMerge, mkForce and co)
config = mkIf cfg.enable { config = mkIf cfg.enable {
assertions = [
(mkIf cfg.nativeComp {
assertion = !cfg.pgtkNativeComp;
message = "Can't enable both nativeComp and pgtkNativeComp!";
})
(mkIf cfg.pgtkNativeComp {
assertion = !cfg.nativeComp;
message = "Can't enable both nativeComp and pgtkNativeComp!";
})
];
# What home packages should be enabled # What home packages should be enabled
home.packages = with pkgs; [ home.packages = with pkgs; builtins.concatLists [
((emacsPackagesFor emacsPgtkNativeComp).emacsWithPackages (optionals cfg.nativeComp [ ((emacsPackagesFor emacsNativeComp).emacsWithPackages (epkgs: [ epkgs.vterm ])) ])
(epkgs: [ epkgs.vterm ])) (optionals cfg.pgtkNativeComp [ ((emacsPackagesFor emacsPgtkNativeComp).emacsWithPackages (epkgs: [ epkgs.vterm ])) ])
# binutils # conflicts with gcc # TODO: Check what hlissner has enabled
zstd (optionals cfg.doom.enable [
(ripgrep.override { withPCRE2 = true; }) emacs-all-the-icons-fonts
fd (ripgrep.override { withPCRE2 = true; })
# libgccjit fd
sqlite zstd
inkscape sqlite # Org roam
graphviz inkscape # Org latex preview
gnuplot graphviz # Org graphviz support
pandoc gnuplot # Org gnuplot support
nixfmt pandoc # Org export formats
shellcheck maim
maim bashInteractive # For keychain
# TODO: Use LaTeX module instead
texlive.combined.scheme-medium
emacs-all-the-icons-fonts
bashInteractive # For keychain
# Treemacs needs python + syntax coloring in org/latex needs pygments # withPackages expects a function that gets all the packages as argument and returns a list with the packages we want
(python310.withPackages (ppkgs: (python310.withPackages (ppkgs: [ ppkgs.pygments ])) # Latex minted
[
ppkgs.pygments # nixfmt # This belongs in specific flake.nix
])) # withPackages expects a function that gets all the packages as argument and returns a list with the packages we want # shellcheck # This belongs in specific flake.nix
# TODO: Use LaTeX module instead
texlive.combined.scheme-medium
])
]; ];
home.sessionPath = mkIf cfg.doom.enable [ "${config.home.homeDirectory}/.emacs.d/bin" ]; home.sessionPath = mkIf cfg.doom.enable [ "${config.home.homeDirectory}/.emacs.d/bin" ];