1
0

modules(home-manager): add alacritty module

This commit is contained in:
Antoine Langlois 2024-02-23 13:19:10 +01:00
parent 8b82fab3b7
commit 08b6e8cf16
Signed by: DataHearth
GPG Key ID: 946E2D0C410C7B3D
3 changed files with 59 additions and 22 deletions

View File

@ -5,7 +5,6 @@
modules_hm_path = modules_base_path + "/home-manager";
in [
# Reusable modules
"${modules_hm_path}/alacritty.nix"
"${modules_hm_path}/zsh.nix"
"${modules_hm_path}/ssh.nix"
"${modules_hm_path}/go.nix"
@ -76,6 +75,8 @@
# Custom modules (./modules/home-manager)
hm = {
alacritty.enable = true;
git = {
enable = true;
signingKey = "A12925470298BFEE7EE092B3946E2D0C410C7B3D";

View File

@ -1,26 +1,61 @@
{ ... }:
{ config, lib, options,... }:
with lib;
let
cfg = config.hm.alacritty;
enable = mkEnableOption "alacritty";
themes = mkOption {
type = types.listOf types.path;
default = [];
description = "List of themes to install";
example = [
(builtins.fetchurl {
url = "https://example.com/theme.toml";
sha256 = fakeSha256;
})
];
};
opacity = mkOption {
type = types.float;
default = 0.9;
description = "Window opacity";
example = 1.0;
};
fontSize = mkOption {
type = types.int;
default = 12;
description = "Font size";
example = 14;
};
in
{
programs.alacritty = {
enable = true;
settings = {
import = [
(builtins.fetchurl {
url = "https://raw.githubusercontent.com/catppuccin/alacritty/832787d6cc0796c9f0c2b03926f4a83ce4d4519b/catppuccin-macchiato.toml";
sha256 = "1iq187vg64h4rd15b8fv210liqkbzkh8sw04ykq0hgpx20w3qilv";
})
];
env.TERM = "xterm-256color";
font = {
size = 12;
normal = {
family = "FiraCode Nerd Font";
style = "Retina";
options.hm.alacritty = {
inherit enable themes opacity fontSize;
};
config = mkIf cfg.enable {
programs.alacritty = {
enable = true;
settings = {
import = [
(builtins.fetchurl {
url = "https://raw.githubusercontent.com/catppuccin/alacritty/832787d6cc0796c9f0c2b03926f4a83ce4d4519b/catppuccin-macchiato.toml";
sha256 = "1iq187vg64h4rd15b8fv210liqkbzkh8sw04ykq0hgpx20w3qilv";
})
] ++ cfg.themes;
env.TERM = "xterm-256color";
font = {
size = cfg.fontSize;
normal = {
family = "FiraCode Nerd Font";
style = "Retina";
};
};
scrolling.multiplier = 5;
selection.save_to_clipboard = true;
window = {
opacity = cfg.opacity;
};
};
scrolling.multiplier = 5;
selection.save_to_clipboard = true;
window = {
opacity = 0.9;
};
};
};

View File

@ -1,4 +1,5 @@
{ ... }:
[
./git.nix
./alacritty.nix
]