configs/alacritty: use config in desktop file, add cmdline wrapper

This commit is contained in:
Aaron Bieber 2024-01-19 11:11:29 -07:00
parent 890606de70
commit 558906869b
No known key found for this signature in database
2 changed files with 30 additions and 18 deletions

View File

@ -1,6 +1,13 @@
{ pkgs, ... }: { pkgs, ... }:
let let
theme = { settings = {
font = {
normal = {
family = "Go Mono";
};
size = 6;
};
colors = { colors = {
primary = { primary = {
background = "#ffffea"; background = "#ffffea";
@ -8,28 +15,32 @@ let
}; };
}; };
}; };
themeFormat = pkgs.formats.toml { };
themeFile = themeFormat.generate "plan9.toml" theme;
settings = {
import = [
"${themeFile}"
];
font = {
normal = {
family = "Go";
style = "Mono";
};
};
};
settingsFormat = pkgs.formats.toml { }; settingsFormat = pkgs.formats.toml { };
settingsFile = settingsFormat.generate "alacritty.toml" settings; settingsFile = settingsFormat.generate "alacritty.toml" settings;
script = pkgs.writeScriptBin "alacritty-etc" ''
${pkgs.alacritty}/bin/alacritty --config-file ${settingsFile}
'';
in in
{ {
config = { config = {
environment.etc = { nixpkgs.overlays = [
"alacritty/alacritty.toml".text = builtins.readFile settingsFile; (self: super: {
"alacritty/theme.yml".text = builtins.readFile themeFile; alacritty = super.alacritty.overrideAttrs (old: {
postInstall = old.postInstall + ''
${super.gnused}/bin/sed -i 's#^Exec=alacritty#Exec=alacritty --config-file ${settingsFile}#g' \
extra/linux/Alacritty.desktop
install -D extra/linux/Alacritty.desktop -t $out/share/applications/
'';
});
})
];
environment = {
systemPackages = [
script
];
etc = {
" alacritty/alacritty.toml ".text = builtins.readFile settingsFile;
};
}; };
}; };
} }

View File

@ -38,6 +38,7 @@ in
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
alacritty
direwolf direwolf
polybar polybar
python3Packages.nomadnet python3Packages.nomadnet