mirror of
				https://github.com/materusPL/nixos-config
				synced 2025-10-25 18:50:27 +02:00 
			
		
		
		
	Compare commits
	
		
			No commits in common. "61ca7ef3bb1cf071d6a9120d4cfbf48290d73356" and "8b1d9ff963456d30e12156f14461c1eb9a87d9d2" have entirely different histories.
		
	
	
		
			61ca7ef3bb
			...
			8b1d9ff963
		
	
		
| @ -93,7 +93,7 @@ in | |||||||
| 
 | 
 | ||||||
|   config = lib.mkIf cfg.enable { |   config = lib.mkIf cfg.enable { | ||||||
|     home.activation.emacsCompile = lib.hm.dag.entryAfter [ "linkGeneration" ] '' |     home.activation.emacsCompile = lib.hm.dag.entryAfter [ "linkGeneration" ] '' | ||||||
|       run ${config.programs.emacs.finalPackage}/bin/emacs --batch \ |       ${config.programs.emacs.finalPackage}/bin/emacs --batch \ | ||||||
|       --eval '(setq warning-minimum-log-level :error)' \ |       --eval '(setq warning-minimum-log-level :error)' \ | ||||||
|       --eval '(byte-compile-file "${config.xdg.configHome}/emacs/early-init.el")' \ |       --eval '(byte-compile-file "${config.xdg.configHome}/emacs/early-init.el")' \ | ||||||
|       --eval '(byte-compile-file "${config.xdg.configHome}/emacs/init.el")' |       --eval '(byte-compile-file "${config.xdg.configHome}/emacs/init.el")' | ||||||
|  | |||||||
| @ -41,8 +41,6 @@ let | |||||||
|       sha256 = "sha256-ES5vJXHjAKw/VHjWs8Au/3R+/aotSbY7PWnWAMzCR8E="; |       sha256 = "sha256-ES5vJXHjAKw/VHjWs8Au/3R+/aotSbY7PWnWAMzCR8E="; | ||||||
|     }); |     }); | ||||||
|     sudo = makePlugin "sudo" "sudo.plugin.zsh" "${pkgs.oh-my-zsh}/share/oh-my-zsh/plugins/sudo"; |     sudo = makePlugin "sudo" "sudo.plugin.zsh" "${pkgs.oh-my-zsh}/share/oh-my-zsh/plugins/sudo"; | ||||||
|     extract = makePlugin "extract" "extract.plugin.zsh" "${pkgs.oh-my-zsh}/share/oh-my-zsh/plugins/extract"; |  | ||||||
| 
 |  | ||||||
| 
 | 
 | ||||||
|   }; |   }; | ||||||
| in | in | ||||||
| @ -53,11 +51,6 @@ in | |||||||
|     example = "p10k"; |     example = "p10k"; | ||||||
|     default = "p10k"; |     default = "p10k"; | ||||||
|   }; |   }; | ||||||
|   options.materus.profile.zsh.endConfig = lib.mkOption { |  | ||||||
|     default = ""; |  | ||||||
|     description = "Zsh config after all of config"; |  | ||||||
|     type = lib.types.lines; |  | ||||||
|   }; |  | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|   config = lib.mkIf cfg.enable { |   config = lib.mkIf cfg.enable { | ||||||
| @ -67,7 +60,9 @@ in | |||||||
| 
 | 
 | ||||||
|     home.file = lib.mkMerge [ |     home.file = lib.mkMerge [ | ||||||
|       (builtins.foldl' (a: b: a // b) { } (builtins.map (plugin: { ${plugin.path}.source = plugin.src; }) (builtins.attrValues extraPlugins))) |       (builtins.foldl' (a: b: a // b) { } (builtins.map (plugin: { ${plugin.path}.source = plugin.src; }) (builtins.attrValues extraPlugins))) | ||||||
|       { "${relToDotDir ".zshrc"}".text = lib.mkAfter cfg.endConfig; } |       { "${relToDotDir ".zshrc"}".text = lib.mkAfter '' | ||||||
|  |       ${lib.optionalString config.programs.wezterm.enable "source \"${config.programs.wezterm.package}/etc/profile.d/wezterm.sh\""} | ||||||
|  |       ''; } | ||||||
|     ]; |     ]; | ||||||
| 
 | 
 | ||||||
|     programs.zsh = { |     programs.zsh = { | ||||||
| @ -93,25 +88,18 @@ in | |||||||
|             if [[ -r "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh" ]]; then |             if [[ -r "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh" ]]; then | ||||||
|               source "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh" |               source "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh" | ||||||
|             fi |             fi | ||||||
|               if [[ -f "${extraPlugins.powerlevel10k.fullPath}" ]]; then |  | ||||||
|                 source "${extraPlugins.powerlevel10k.fullPath}" |  | ||||||
|               fi |  | ||||||
|               '' |  | ||||||
|         } |  | ||||||
|             if zmodload zsh/terminfo && (( "$terminfo[colors]" >= "256" )); then  |             if zmodload zsh/terminfo && (( "$terminfo[colors]" >= "256" )); then  | ||||||
|               __MATERUS_HM_ZSH_256COLORS="''${__MATERUS_HM_ZSH_256COLORS:-1}"; else |               __MATERUS_HM_ZSH_256COLORS="''${__MATERUS_HM_ZSH_256COLORS:-1}"; else | ||||||
|               __MATERUS_HM_ZSH_256COLORS="''${__MATERUS_HM_ZSH_256COLORS:-0}";  |               __MATERUS_HM_ZSH_256COLORS="''${__MATERUS_HM_ZSH_256COLORS:-0}";  | ||||||
|             fi |             fi | ||||||
| 
 |             if [[ -f "${extraPlugins.powerlevel10k.fullPath}" ]]; then | ||||||
|  |               source "${extraPlugins.powerlevel10k.fullPath}" | ||||||
|  |             fi | ||||||
|             if [[ -f "${extraPlugins.sudo.fullPath}" ]]; then |             if [[ -f "${extraPlugins.sudo.fullPath}" ]]; then | ||||||
|               source "${extraPlugins.sudo.fullPath}" |               source "${extraPlugins.sudo.fullPath}" | ||||||
|             fi |             fi | ||||||
|         if [[ -f "${extraPlugins.extract.fullPath}" ]]; then |             '' | ||||||
|           source "${extraPlugins.extract.fullPath}" |         }''; | ||||||
|           path+="${extraPlugins.extract.path}" |  | ||||||
|           fpath+="${extraPlugins.extract.path}" |  | ||||||
|         fi |  | ||||||
|         ''; |  | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,44 +1,31 @@ | |||||||
| { config, lib, materusArg, pkgs, ... }: | { config, lib, materusArg, pkgs, ... }: | ||||||
| let | let | ||||||
|   cfg = config.materus.profile.wezterm; |   cfg = config.materus.profile.wezterm; | ||||||
|   zshCfg = '' |   cfgText = '' | ||||||
|     source "${config.programs.wezterm.package}/etc/profile.d/wezterm.sh" |     config.hide_tab_bar_if_only_one_tab = true; | ||||||
|  |     config.enable_scroll_bar = true; | ||||||
|  |     config.font = wezterm.font 'Hack Nerd Font'; | ||||||
|   ''; |   ''; | ||||||
| in | in | ||||||
| { | { | ||||||
|   options.materus.profile.wezterm.enable = materusArg.pkgs.lib.mkBoolOpt config.materus.profile.enableDesktop "Enable materus wezterm config"; |   options.materus.profile.wezterm.enable = materusArg.pkgs.lib.mkBoolOpt config.materus.profile.enableDesktop "Enable materus wezterm config"; | ||||||
|   options.materus.profile.wezterm.enableHackFont = materusArg.pkgs.lib.mkBoolOpt true "Enable hack nerd font for wezterm"; |   options.materus.profile.wezterm.enableHackFont = materusArg.pkgs.lib.mkBoolOpt true "Enable hack nerd font for wezterm"; | ||||||
|   options.materus.profile.wezterm.enableWezcraft = materusArg.pkgs.lib.mkBoolOpt true "Enable alias to start wezcraft with monocraft font"; |   options.materus.profile.wezterm.config = lib.mkOption { | ||||||
|   options.materus.profile.wezterm.extraConfig = lib.mkOption { |     default = cfgText; | ||||||
|     default = ""; |  | ||||||
|     description = "Config for wezterm"; |     description = "Config for wezterm"; | ||||||
|     type = lib.types.lines; |     type = lib.types.string; | ||||||
|   }; |   }; | ||||||
|   config = lib.mkIf cfg.enable |   config = lib.mkIf cfg.enable { | ||||||
|     { |  | ||||||
|     programs.wezterm.enable = true; |     programs.wezterm.enable = true; | ||||||
|     programs.wezterm.colorSchemes = { }; |     programs.wezterm.colorSchemes = { }; | ||||||
|     programs.wezterm.extraConfig = '' |     programs.wezterm.extraConfig = '' | ||||||
|  |       local config = wezterm.config_builder(); | ||||||
| 
 | 
 | ||||||
|       package.path = package.path .. ";${materusArg.cfg.path}/extraFiles/config/wezterm/?.lua" |       ${cfgText} | ||||||
|       require("wezterm_config"); |  | ||||||
|       local config = materus_wezterm_config(); |  | ||||||
|       ${lib.optionalString cfg.enableHackFont "config.font = wezterm.font 'Hack Nerd Font';"} |  | ||||||
|       ${cfg.extraConfig} |  | ||||||
| 
 | 
 | ||||||
|       return config; |       return config; | ||||||
|     ''; |     ''; | ||||||
| 
 | 
 | ||||||
|       home.packages = [ |     home.packages = lib.mkIf cfg.enableHackFont [ (pkgs.nerdfonts.override { fonts = [ "Hack" ]; }) ]; | ||||||
|         (lib.mkIf cfg.enableHackFont (pkgs.nerdfonts.override { |  | ||||||
|           fonts = [ "Hack" ]; |  | ||||||
|         })) |  | ||||||
|         (lib.mkIf cfg.enableWezcraft (pkgs.monocraft)) |  | ||||||
|         (lib.mkIf cfg.enableWezcraft (pkgs.writeShellScriptBin "wezcraft" '' |  | ||||||
|           ${lib.getExe config.programs.wezterm.package} --config font="wezterm.font 'Monocraft Nerd Font'" $@ |  | ||||||
|         '')) |  | ||||||
|       ]; |  | ||||||
| 
 |  | ||||||
|       materus.profile.zsh.endConfig = lib.optionalString cfg.enableWezcraft zshCfg; |  | ||||||
|   }; |   }; | ||||||
| } | } | ||||||
|  | |||||||
| @ -1,9 +0,0 @@ | |||||||
| local wezterm_config = {}; |  | ||||||
| 
 |  | ||||||
| function materus_wezterm_config() |  | ||||||
|     local wezterm = require 'wezterm'; |  | ||||||
|     local cfg = wezterm.config_builder(); |  | ||||||
|     cfg.hide_tab_bar_if_only_one_tab = true; |  | ||||||
|     cfg.enable_scroll_bar = true; |  | ||||||
|     return cfg; |  | ||||||
| end |  | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user