working emacs?

This commit is contained in:
Charlie Root 2024-05-19 23:38:49 +02:00
commit 3fc5284ec8
6 changed files with 33 additions and 23 deletions

View file

@ -15,11 +15,9 @@ in {
dig dig
easyeffects easyeffects
element-desktop element-desktop
emacs
evince evince
eza eza
fastfetch fastfetch
fd
feh feh
(fenix.complete.withComponents [ (fenix.complete.withComponents [
"cargo" "cargo"
@ -75,7 +73,6 @@ in {
polkit polkit
python3 python3
qbittorrent qbittorrent
ripgrep
rustdesk rustdesk
scc scc
scummvm scummvm

0
lib/default.nix Normal file
View file

17
lib/options.nix Normal file
View file

@ -0,0 +1,17 @@
# Taken from: https://github.com/hlissner/dotfiles/blob/master/lib/options.nix
{ lib, ... }:
let inherit (lib) mkOption types;
in {
mkOpt = type: default: mkOption { inherit type default; };
mkOpt' = type: default: description:
mkOption { inherit type default description; };
mkBoolOpt = default:
mkOption {
inherit default;
type = types.bool;
example = true;
};
}

View file

@ -1,27 +1,26 @@
{ config, lib, pkgs, inputs, ... }: # Taken from: https://github.com/hlissner/dotfiles/blob/master/modules/editors/emacs.nix
{ config, lib, pkgs, ... }:
with lib; with lib;
# with lib.my; # with lib.my;
let let
cfg = config.modules.editors.emacs; cfg = config.modules.editors.emacs;
configDir = config.dotfiles.configDir;
in {
options.modules.editors.emacs = {
enable = mkBoolOpt false;
doom = rec {
enable = mkBoolOpt false;
forgeUrl = "https://github.com"; forgeUrl = "https://github.com";
repoUrl = "${forgeUrl}/doomemacs/doomemacs"; repoUrl = "${forgeUrl}/doomemacs/doomemacs";
configRepoUrl = "${forgeUrl}/bloxx12/doom-emacs-private"; configRepoUrl = "${forgeUrl}/bloxx12/doom-emacs-config";
}; in {
options.modules.editors.emacs = {
enable = mkEnableOption "emacs";
doom.enable = mkEnableOption "doom";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
# Why is this needed? # Why is this needed?
# nixpkgs.overlays = [ inputs.emacs-overlay.overlay ]; # nixpkgs.overlays = [ inputs.emacs-overlay.overlay ];
user.packages = with pkgs; [ environment.systemPackages = with pkgs; [
## Emacs itself ## Emacs itself
emacs
binutils # native-comp needs 'as', provided by this binutils # native-comp needs 'as', provided by this
# 28.2 + native-comp # 28.2 + native-comp
((emacsPackagesFor emacsNativeComp).emacsWithPackages ((emacsPackagesFor emacsNativeComp).emacsWithPackages
@ -35,8 +34,6 @@ in {
## Optional dependencies ## Optional dependencies
fd # faster projectile indexing fd # faster projectile indexing
imagemagick # for image-dired imagemagick # for image-dired
(mkIf (config.programs.gnupg.agent.enable)
pinentry_emacs) # in-emacs gnupg prompts
zstd # for undo-fu-session/undo-tree compression zstd # for undo-fu-session/undo-tree compression
## Module dependencies ## Module dependencies
@ -50,20 +47,19 @@ in {
texlive.combined.scheme-medium texlive.combined.scheme-medium
# :lang beancount # :lang beancount
beancount beancount
unstable.fava # HACK Momentarily broken on nixos-unstable
]; ];
env.PATH = [ "$XDG_CONFIG_HOME/emacs/bin" ]; environment.sessionVariables.PATH = [ "$XDG_CONFIG_HOME/emacs/bin" ];
modules.shell.zsh.rcFiles = [ "${configDir}/emacs/aliases.zsh" ]; # modules.shell.zsh.rcFiles = [ "${configDir}/emacs/aliases.zsh" ];
fonts.fonts = [ pkgs.emacs-all-the-icons-fonts ]; fonts.fonts = [ pkgs.emacs-all-the-icons-fonts ];
system.userActivationScripts = mkIf cfg.doom.enable { system.userActivationScripts = mkIf cfg.doom.enable {
installDoomEmacs = '' installDoomEmacs = ''
if [ ! -d "$XDG_CONFIG_HOME/emacs" ]; then if [ ! -d "$XDG_CONFIG_HOME/emacs" ]; then
git clone --depth=1 --single-branch "${cfg.doom.repoUrl}" "$XDG_CONFIG_HOME/emacs" git clone --depth=1 --single-branch "${repoUrl}" "$XDG_CONFIG_HOME/emacs"
git clone "${cfg.doom.configRepoUrl}" "$XDG_CONFIG_HOME/doom" git clone "${configRepoUrl}" "$XDG_CONFIG_HOME/doom"
fi fi
''; '';
}; };

View file

@ -10,7 +10,7 @@ in {
home-manager.users.${username} = { home-manager.users.${username} = {
stylix = { stylix = {
polarity = "dark"; polarity = "dark";
image = ../../lib/wallpapers/mafu_trad_wall.png; image = ../../assets/wallpapers/mafu_trad_wall.png;
base16Scheme = base16Scheme =
"${pkgs.base16-schemes}/share/themes/catppuccin-mocha.yaml"; "${pkgs.base16-schemes}/share/themes/catppuccin-mocha.yaml";
autoEnable = true; autoEnable = true;
@ -71,7 +71,7 @@ in {
}; };
}; };
stylix = { stylix = {
image = ../../lib/wallpapers/FreeBSD.png; image = ../../assets/wallpapers/FreeBSD.png;
polarity = "dark"; polarity = "dark";
targets.plymouth.enable = false; targets.plymouth.enable = false;
}; };

View file

@ -1,4 +1,4 @@
{ pkgs, config, ... }: { config, ... }:
let let
username = config.modules.other.system.username; username = config.modules.other.system.username;
hmCfg = config.home-manager.users.${username}; hmCfg = config.home-manager.users.${username};