Personal Nix setup
at main 926 B view raw
1{ lib, config, pkgs, helpers, ... } @ inputs: 2 3with lib; 4let 5 inherit (import ../../../lib/colors.nix inputs) colors mkLuaSyntax; 6 inherit (pkgs) wezterm; 7 8 cfg = config.modules.apps; 9 10 configStr = '' 11 local font_size = ${if helpers.isDarwin then "14" else "12"}; 12 local is_linux = ${if helpers.isLinux then "true" else "false"}; 13 local zsh_bin = "${pkgs.zsh}/bin/zsh"; 14 local colors = ${mkLuaSyntax colors}; 15 '' + (builtins.readFile ./init.lua); 16 17 shellIntegrationStr = '' 18 source "${wezterm}/etc/profile.d/wezterm.sh" 19 ''; 20in { 21 options.modules.apps.wezterm = { 22 enable = mkOption { 23 default = false; 24 description = "Whether to enable Wezterm."; 25 type = types.bool; 26 }; 27 }; 28 29 config = mkIf (cfg.enable && cfg.wezterm.enable) { 30 home.packages = [ wezterm ]; 31 xdg.configFile."wezterm/wezterm.lua".text = configStr; 32 programs.zsh.initContent = shellIntegrationStr; 33 }; 34}