Compare commits

...

3 Commits

6 changed files with 57 additions and 12 deletions

View File

@ -2,7 +2,7 @@
{
home.stateVersion = "22.11";
home.homeDirectory = "/home/materus";
programs.wezterm.enable = true;
programs.git = {
userEmail = "materus@podkos.pl";
userName = "materus";

View File

@ -16,15 +16,15 @@ let
pkgs.noto-fonts-cjk-serif
pkgs.wqy_zenhei
pkgs.corefonts
(pkgs.nerdfonts.override { fonts = [ "FiraCode" ]; })
pkgs.hack-font
(pkgs.nerdfonts.override { fonts = [ "Hack" ]; })
] ++ defaultFonts;
moreFonts = [
pkgs.ubuntu_font_family
pkgs.monocraft
pkgs.hack-font
(pkgs.nerdfonts.override { fonts = [ "DroidSansMono" "Meslo" "ProFont" ]; })
(pkgs.nerdfonts.override { fonts = [ "DroidSansMono" "Meslo" "ProFont" "FiraCode"]; })
];
in
{

View File

@ -11,6 +11,7 @@ in
./shell
./editor
./terminal
];
options.materus.profile.enableDesktop = materusArg.pkgs.lib.mkBoolOpt false "Enable settings for desktop";

View File

@ -18,7 +18,7 @@ let
if [ ''$${var} = "${val}" ]; then
${ret}
fi
'';
'';
@ -58,7 +58,12 @@ in
pkgs.ripgrep
];
home.file = builtins.foldl' (a: b: a // b) { } (builtins.map (plugin: { ${plugin.path}.source = plugin.src; }) (builtins.attrValues extraPlugins));
home.file = lib.mkMerge [
(builtins.foldl' (a: b: a // b) { } (builtins.map (plugin: { ${plugin.path}.source = plugin.src; }) (builtins.attrValues extraPlugins)))
{ "${relToDotDir ".zshrc"}".text = lib.mkAfter ''
${lib.optionalString config.programs.wezterm.enable "source \"${config.programs.wezterm.package}/etc/profile.d/wezterm.sh\""}
''; }
];
programs.zsh = {
enable = true;
@ -71,11 +76,6 @@ in
envExtra = ''
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:-0}";
fi
${makeEnv "__MATERUS_HM_ZSH" "1"}
${makeEnv "__MATERUS_HM_ZSH_PROMPT" cfg.prompt}
${makeEnv "__MATERUS_HM_ZSH_PRIVATE" "0"}
@ -83,10 +83,15 @@ in
initExtraFirst = ''
${makeIfVar "__MATERUS_HM_ZSH_PROMPT" "p10k" ''
if [[ -r "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh" ]]; then
source "''${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-''${(%):-%n}.zsh"
fi
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:-0}";
fi
if [[ -f "${extraPlugins.powerlevel10k.fullPath}" ]]; then
source "${extraPlugins.powerlevel10k.fullPath}"
fi
@ -158,7 +163,7 @@ in
${lib.optionalString config.programs.zsh.history.share "unsetopt SHARE_HISTORY"}
alias -- 'zsh'="__MATERUS_HM_ZSH_PRIVATE=0 zsh "
''
;
};

View File

@ -0,0 +1,8 @@
{...}:
{
imports = [
./wezterm.nix
];
}

View File

@ -0,0 +1,31 @@
{ config, lib, materusArg, pkgs, ... }:
let
cfg = config.materus.profile.wezterm;
cfgText = ''
config.hide_tab_bar_if_only_one_tab = true;
config.enable_scroll_bar = true;
config.font = wezterm.font 'Hack Nerd Font';
'';
in
{
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.config = lib.mkOption {
default = cfgText;
description = "Config for wezterm";
type = lib.types.string;
};
config = lib.mkIf cfg.enable {
programs.wezterm.enable = true;
programs.wezterm.colorSchemes = { };
programs.wezterm.extraConfig = ''
local config = wezterm.config_builder();
${cfgText}
return config;
'';
home.packages = lib.mkIf cfg.enableHackFont [ (pkgs.nerdfonts.override { fonts = [ "Hack" ]; }) ];
};
}