From 495d6d952437f2cb1a98a86693e59553a95590ce Mon Sep 17 00:00:00 2001 From: janabhumi Date: Mon, 26 Sep 2022 04:07:33 +0300 Subject: [PATCH] home/alacritty: config font size via param --- home/progs/alacritty/config.nix | 4 +++- home/progs/alacritty/default.nix | 8 +++++++- makefile | 3 +++ outputs/home.nix | 15 +++++++++++---- 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/home/progs/alacritty/config.nix b/home/progs/alacritty/config.nix index 5d05d4a..27bbafe 100644 --- a/home/progs/alacritty/config.nix +++ b/home/progs/alacritty/config.nix @@ -1,3 +1,5 @@ +{ fontSize ? 11.0 }: + { window = { padding = { @@ -28,6 +30,6 @@ italic = mkFont "Italic"; bold_italic = mkFont "Bold Italic"; - size = 8.0; + size = fontSize; }; } diff --git a/home/progs/alacritty/default.nix b/home/progs/alacritty/default.nix index 3aa4501..09ea265 100644 --- a/home/progs/alacritty/default.nix +++ b/home/progs/alacritty/default.nix @@ -5,7 +5,7 @@ with lib; let cfg = config.progs.alacritty; - alacrittyConfig = import ./config.nix; + alacrittyConfig = import ./config.nix { inherit (cfg) fontSize; }; in { options.progs.alacritty = { @@ -14,6 +14,12 @@ in default = false; description = "Enable alacritty, GPU-accelerated terminal emulator"; }; + + fontSize = mkOption { + type = types.number; + default = 11.0; + description = "Alacritty font size"; + }; }; config = mkIf cfg.enable { diff --git a/makefile b/makefile index af9a2bc..1a7c2bb 100644 --- a/makefile +++ b/makefile @@ -4,6 +4,9 @@ switchSys = nixos-rebuild switch --flake home-me: fix-systemd ${switchHm} .#home-me +home-laptop-me: fix-systemd + ${switchHm} .#home-laptop-me + sys-home: sudo ${switchSys} .#system-home diff --git a/outputs/home.nix b/outputs/home.nix index 6cb61eb..efd84c3 100644 --- a/outputs/home.nix +++ b/outputs/home.nix @@ -13,14 +13,21 @@ let inputs.nil.overlays.default ]; }; -in -{ - home-me = home-manager.lib.homeManagerConfiguration { + + mkHome = mods: home-manager.lib.homeManagerConfiguration { inherit pkgs; modules = [ inputs.wired.homeManagerModules.default ../home/home.nix - ]; + ] ++ mods; }; +in +{ + home-me = mkHome [ ]; + home-laptop-me = mkHome [ + ({ config, ... }: { + progs.alacritty.fontSize = 8.0; + }) + ]; }