From 2e7935767f2bc49ec45cd7a92289a208882c1797 Mon Sep 17 00:00:00 2001 From: Leon Kowarschick <5300871+elkowar@users.noreply.github.com> Date: Fri, 3 Jul 2020 19:09:35 +0200 Subject: [PATCH] alacritty: add package option PR #1372 --- modules/programs/alacritty.nix | 9 ++++++++- tests/modules/programs/alacritty/example-settings.nix | 5 +---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/modules/programs/alacritty.nix b/modules/programs/alacritty.nix index 69b9ea96..ea908f2b 100644 --- a/modules/programs/alacritty.nix +++ b/modules/programs/alacritty.nix @@ -11,6 +11,13 @@ in { programs.alacritty = { enable = mkEnableOption "Alacritty"; + package = mkOption { + type = types.package; + default = pkgs.alacritty; + defaultText = literalExample "pkgs.alacritty"; + description = "The Alacritty package to install."; + }; + settings = mkOption { type = types.attrs; default = { }; @@ -41,7 +48,7 @@ in { config = mkMerge [ (mkIf cfg.enable { - home.packages = [ pkgs.alacritty ]; + home.packages = [ cfg.package ]; xdg.configFile."alacritty/alacritty.yml" = mkIf (cfg.settings != { }) { text = diff --git a/tests/modules/programs/alacritty/example-settings.nix b/tests/modules/programs/alacritty/example-settings.nix index 46be1064..c3671aa0 100644 --- a/tests/modules/programs/alacritty/example-settings.nix +++ b/tests/modules/programs/alacritty/example-settings.nix @@ -6,6 +6,7 @@ with lib; config = { programs.alacritty = { enable = true; + package = pkgs.writeScriptBin "dummy-alacritty" ""; settings = { window.dimensions = { @@ -21,10 +22,6 @@ with lib; }; }; - nixpkgs.overlays = [ - (self: super: { alacritty = pkgs.writeScriptBin "dummy-alacritty" ""; }) - ]; - nmt.script = '' assertFileContent \ home-files/.config/alacritty/alacritty.yml \