Move alacritty into a separate module

This commit is contained in:
bad 2022-09-19 15:41:22 +02:00
parent 4d1a550da9
commit bb817e9dec
3 changed files with 84 additions and 70 deletions

View file

@ -1,21 +1,14 @@
{ pkgs, ... }: {
imports = [ ../profiles/direnv ../profiles/git ../profiles/zsh ../profiles/neovim ../profiles/syncthing ../profiles/kdeconnect ../profiles/podman ../profiles/alacritty ../profiles/tmux ../profiles/mpv ../profiles/sway ];
imports = [ ../profiles/direnv ../profiles/git ../profiles/zsh ../profiles/neovim ../profiles/syncthing ../profiles/kdeconnect ../profiles/podman ../profiles/tmux ../profiles/mpv ../profiles/sway ];
targets.genericLinux.enable = true;
programs.alacritty.package = pkgs.symlinkJoin {
name = "alacritty-nixgl";
paths = [
(pkgs.writeShellScriptBin
"alacritty"
''
${pkgs.nixgl.nixGLIntel}/bin/nixGLIntel ${pkgs.alacritty}/bin/alacritty "$@"
'')
pkgs.alacritty
];
};
home.packages = [ pkgs.home-manager ];
wayland.windowManager.sway.extraSessionCommands = ''
export WLR_NO_HARDWARE_CURSORS=1
'';
mae.alacritty = {
enable = true;
libglWrapper = true;
};
home.sessionVariables = {
XDG_DATA_DIRS = "$XDG_DATA_DIRS:/var/lib/flatpak/exports/share:$HOME/.local/share/flatpak/exports/share";

View file

@ -0,0 +1,79 @@
{ pkgs, lib, config, ... }:
let
cfg = config.mae.alacritty;
alacrittyLibGL = pkgs.symlinkJoin {
name = "alacritty-nixgl";
paths = [
(pkgs.writeShellScriptBin
"alacritty"
''
${pkgs.nixgl.nixGLIntel}/bin/nixGLIntel ${pkgs.alacritty}/bin/alacritty "$@"
'')
pkgs.alacritty
];
};
in
{
options.mae.alacritty = {
enable = lib.mkEnableOption "Enable the alacritty terminal";
libglWrapper = lib.mkEnableOption "Wrap alacritty in libgl to make it work on non nixos systems";
};
config = lib.mkIf cfg.enable {
fonts.fontconfig.enable = true;
home.packages = [
(pkgs.nerdfonts.override { fonts = [ "JetBrainsMono" ]; })
];
programs.alacritty = {
package = lib.mkIf cfg.libglWrapper alacrittyLibGL;
enable = true;
settings = {
window = {
padding = {
x = 6;
y = 6;
};
};
font = {
normal = {
family = "JetBrainsMono Nerd Font";
};
size = 12;
};
colors = {
primary = {
background = "#161821";
foreground = "#d2d4de";
};
normal = {
black = "#161821";
red = "#e27878";
green = "#b4be82";
yellow = "#e2a478";
blue = "#84a0c6";
magenta = "#a093c7";
cyan = "#89b8c2";
white = "#c6c8d1";
};
bright = {
black = "#6b7089";
red = "#e98989";
green = "#c0ca8e";
yellow = "#e9b189";
blue = "#91acd1";
magenta = "#ada0d3";
cyan = "#95c4ce";
white = "#d2d4de";
};
};
cursor = {
style = "Block";
blinking = "On";
};
live_config_reload = false;
mouse = {
hide_when_typing = false;
};
};
};
};
}

View file

@ -1,58 +0,0 @@
{ pkgs, ... }:
{
fonts.fontconfig.enable = true;
home.packages = [
(pkgs.nerdfonts.override { fonts = [ "JetBrainsMono" ]; })
];
programs.alacritty = {
enable = true;
settings = {
window = {
padding = {
x = 6;
y = 6;
};
};
font = {
normal = {
family = "JetBrainsMono Nerd Font";
};
size = 12;
};
colors = {
primary = {
background = "#161821";
foreground = "#d2d4de";
};
normal = {
black = "#161821";
red = "#e27878";
green = "#b4be82";
yellow = "#e2a478";
blue = "#84a0c6";
magenta = "#a093c7";
cyan = "#89b8c2";
white = "#c6c8d1";
};
bright = {
black = "#6b7089";
red = "#e98989";
green = "#c0ca8e";
yellow = "#e9b189";
blue = "#91acd1";
magenta = "#ada0d3";
cyan = "#95c4ce";
white = "#d2d4de";
};
};
cursor = {
style = "Block";
blinking = "On";
};
live_config_reload = false;
mouse = {
hide_when_typing = false;
};
};
};
}