Init commit

This commit is contained in:
2023-10-08 11:42:08 +02:00
commit bf276c349f
56 changed files with 6779 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
{ config, lib, pkgs, materusPkgs, ... }:
let
cfg = config.materus.profile.browser;
in
{
options= let mkBoolOpt = materusPkgs.lib.mkBoolOpt; in{
materus.profile.browser.firefox.enable = mkBoolOpt config.materus.profile.enableDesktop "Enable Firefox with materus cfg";
materus.profile.browser.vivaldi.enable = mkBoolOpt config.materus.profile.enableDesktop "Enable Vivaldi with materus cfg";
materus.profile.browser.brave.enable = mkBoolOpt false "Enable Brave with materus cfg";
};
#TODO: Make some config
config.home.packages = [
(lib.mkIf cfg.firefox.enable config.materus.profile.packages.firefox)
(lib.mkIf cfg.vivaldi.enable pkgs.vivaldi)
(lib.mkIf cfg.brave.enable pkgs.brave)
];
}
+71
View File
@@ -0,0 +1,71 @@
{ config, lib, pkgs, materusPkgs, ... }:
let
packages = cfg.packages;
cfg = config.materus.profile;
in
{
imports = [
./fonts.nix
./browser.nix
./shell
./editor
];
options.materus.profile.enableDesktop = materusPkgs.lib.mkBoolOpt false "Enable settings for desktop";
options.materus.profile.enableTerminal = materusPkgs.lib.mkBoolOpt true "Enable settings for terminal";
options.materus.profile.enableTerminalExtra = materusPkgs.lib.mkBoolOpt false "Enable extra settings for terminal";
options.materus.profile.enableNixDevel = materusPkgs.lib.mkBoolOpt false "Enable settings for nix devel";
config =
{
home.packages = (if cfg.enableDesktop then packages.list.desktopApps else []) ++
(if cfg.enableNixDevel then packages.list.nixRelated else []) ++
(if cfg.enableTerminal then packages.list.terminalApps else []);
#Desktop
programs.feh.enable = lib.mkDefault cfg.enableDesktop;
#Terminal
programs.git = {
enable = lib.mkDefault cfg.enableTerminal;
package = lib.mkDefault pkgs.gitFull;
delta.enable = lib.mkDefault cfg.enableTerminal;
lfs.enable = lib.mkDefault cfg.enableTerminal;
};
programs.gitui.enable = cfg.enableTerminalExtra;
programs.nix-index = {
enable = lib.mkDefault cfg.enableTerminal;
enableBashIntegration = lib.mkDefault config.programs.bash.enable;
enableFishIntegration = lib.mkDefault config.programs.fish.enable;
enableZshIntegration = lib.mkDefault config.programs.zsh.enable;
};
programs.direnv = {
enable = lib.mkDefault (cfg.enableTerminalExtra || cfg.enableNixDevel);
nix-direnv.enable = lib.mkDefault (cfg.enableNixDevel && (config.programs.direnv.enable == true));
enableBashIntegration = lib.mkDefault config.programs.bash.enable;
#enableFishIntegration = lib.mkDefault config.programs.fish.enable;
enableZshIntegration = lib.mkDefault config.programs.zsh.enable;
};
programs.tmux.enable = lib.mkDefault cfg.enableTerminal;
programs.tmux.clock24 = lib.mkDefault config.programs.tmux.enable;
programs.fzf = {
enable = lib.mkDefault cfg.enableTerminalExtra;
enableBashIntegration = lib.mkDefault config.programs.bash.enable;
enableFishIntegration = lib.mkDefault config.programs.fish.enable;
enableZshIntegration = lib.mkDefault config.programs.zsh.enable;
};
programs.exa.enable = lib.mkDefault cfg.enableTerminalExtra;
programs.exa.enableAliases = lib.mkDefault config.programs.exa.enable;
programs.yt-dlp.enable = lib.mkDefault cfg.enableTerminalExtra;
};
}
@@ -0,0 +1,17 @@
{ config, lib, pkgs, materusPkgs, ... }:
let
cfg = config.materus.profile.editor.code;
in
{
options.materus.profile.editor.code.enable = materusPkgs.lib.mkBoolOpt config.materus.profile.enableDesktop "Enable VSCodium with materus cfg";
options.materus.profile.editor.code.fhs.enable = materusPkgs.lib.mkBoolOpt false "Use fhs vscodium";
options.materus.profile.editor.code.fhs.packages = lib.mkOption { default = (ps: []);};
config = lib.mkIf cfg.enable {
programs.vscode = {
enable = lib.mkDefault true;
package = lib.mkDefault (if (cfg.fhs.enable) then (pkgs.vscodium.fhsWithPackages cfg.fhs.packages) else pkgs.vscodium);
mutableExtensionsDir = lib.mkDefault true;
};
materus.profile.fonts.enable = lib.mkDefault true;
};
}
@@ -0,0 +1,8 @@
{ config, lib, pkgs, ... }:
{
imports = [
./code.nix
./neovim.nix
./emacs.nix
];
}
@@ -0,0 +1,25 @@
{ config, lib, pkgs, materusPkgs, ... }:
let
cfg = config.materus.profile.editor.emacs;
in
{
options.materus.profile.editor.emacs.enable = materusPkgs.lib.mkBoolOpt false "Enable emacs with materus cfg";
config = lib.mkIf cfg.enable {
#TODO: Make config
/*home.activation.doomEmacs = lib.hm.dag.entryBetween [ "onFilesChange" ] [ "writeBoundry" ] ''
if [ ! -d ~/.emacs.d ] ;
then ${pkgs.git}/bin/git clone --depth 1 https://github.com/doomemacs/doomemacs ~/.emacs.d
fi
PATH="${config.programs.git.package}/bin:${config.programs.emacs.package}/bin:$PATH"
~/.emacs.d/bin/doom sync
'';
home.file.doomEmacs.source = "${materusArg.flakeData.extraFiles}/config/emacs/doom";
home.file.doomEmacs.target = "${config.xdg.configHome}/doom";*/
programs.emacs.enable = true;
programs.emacs.package = with pkgs; lib.mkDefault (if pkgs ? emacsUnstablePgtk then emacsUnstablePgtk else emacs-gtk);
};
}
@@ -0,0 +1,54 @@
{ config, lib, pkgs, materusPkgs, ... }:
let
cfg = config.materus.profile.editor.neovim;
in
{
options.materus.profile.editor.neovim.enable = materusPkgs.lib.mkBoolOpt config.materus.profile.enableTerminalExtra "Enable neovim with materus cfg";
config = lib.mkIf cfg.enable {
programs.neovim = {
enable = true;
coc.enable = true;
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
withNodeJs = true;
withPython3 = true;
withRuby = true;
defaultEditor = true;
extraConfig = ''
set number
'';
plugins = with pkgs.vimPlugins;[
nerdtree
syntastic
vim-fugitive
vim-airline
vim-nix
nvim-fzf
nvim-treesitter.withAllGrammars
coc-clangd
coc-python
coc-pyright
coc-sh
coc-git
coc-css
coc-yaml
coc-toml
coc-json
coc-html
coc-highlight
coc-java
coc-cmake
coc-vimlsp
];
};
};
}
+13
View File
@@ -0,0 +1,13 @@
{ config, pkgs, lib, materusPkgs, ... }:
let
packages = config.materus.profile.packages;
cfg = config.materus.profile.fonts;
in
{
options.materus.profile.fonts.enable = materusPkgs.lib.mkBoolOpt config.materus.profile.enableDesktop "Enable materus font settings";
config = lib.mkIf cfg.enable {
fonts.fontconfig.enable = lib.mkDefault true;
home.packages = packages.list.fonts;
};
}
@@ -0,0 +1,20 @@
{ config, pkgs, lib, materusFlake, materusPkgs, ... }:
let
cfg = config.materus.profile.bash;
in
{
options.materus.profile.bash.enable = materusPkgs.lib.mkBoolOpt config.materus.profile.enableTerminal "Enable materus bash config";
config = lib.mkIf cfg.enable {
programs.bash = {
enable = lib.mkDefault true;
enableCompletion = lib.mkDefault true;
enableVteIntegration = lib.mkDefault true;
historyControl = lib.mkDefault ["erasedups" "ignorespace"];
shellOptions = lib.mkDefault [ "autocd" "checkwinsize" "cmdhist" "expand_aliases" "extglob" "globstar" "checkjobs" "nocaseglob" ];
};
};
}
@@ -0,0 +1,9 @@
{
imports = [
./zsh.nix
./bash.nix
./fish.nix
./starship.nix
];
}
@@ -0,0 +1,12 @@
{ config, pkgs, lib, materusFlake, materusPkgs, ... }:
let
cfg = config.materus.profile.fish;
in
{
options.materus.profile.fish.enable = materusPkgs.lib.mkBoolOpt config.materus.profile.enableTerminalExtra "Enable materus fish config";
config = lib.mkIf cfg.enable {
programs.fish = {
enable = lib.mkDefault true;
};
};
}
@@ -0,0 +1,48 @@
{ config, pkgs, lib, materusFlake, materusPkgs, ... }:
let
profile = config.materus.profile;
cfg = config.materus.profile.starship;
in
{
options.materus.profile.starship.enable = materusPkgs.lib.mkBoolOpt (profile.zsh.enable || profile.bash.enable || profile.fish.enable) "Enable materus fish config";
config = lib.mkIf cfg.enable {
programs.starship.enable = lib.mkDefault cfg.enable;
programs.starship.settings = {
python = {
symbol = " ";
};
format = "$username@$hostname$all";
right_format = "$cmd_duration $time";
time = {
disabled = false;
style = "bold bright-black";
format = "[$time]($style)";
};
line_break = { disabled = true; };
shell = {
disabled = false;
fish_indicator = "fish";
bash_indicator= "bash";
zsh_indicator= "zsh";
style = "blue bold";
};
hostname = {
ssh_only = false;
};
username = {
disabled = false;
show_always = true;
format = "[$user]($style)";
style_user = "white bold";
style_root = "black bold";
};
};
};
}
+96
View File
@@ -0,0 +1,96 @@
{ config, pkgs, lib, materusFlake, materusPkgs, options, ... }:
let
p10kcfg = "${zshcfg}/p10kcfg";
zshcfg = "${materusFlake.selfPath}/extraFiles/config/zsh";
cfg = config.materus.profile.zsh;
enableStarship = config.materus.starship.enable;
in
{
options.materus.profile.zsh.enable = materusPkgs.lib.mkBoolOpt config.materus.profile.enableTerminalExtra "Enable materus zsh config";
options.materus.profile.zsh.prompt = lib.mkOption {
type = lib.types.enum ["p10k" "starship"];
example = "p10k";
default = "p10k";
};
config = lib.mkIf cfg.enable {
home.packages = [
pkgs.ripgrep
];
programs.zsh = {
enable = true;
enableAutosuggestions = true;
enableSyntaxHighlighting = true;
enableVteIntegration = true;
historySubstringSearch.enable = true;
historySubstringSearch.searchUpKey = ";5A";
historySubstringSearch.searchDownKey = ";5B";
envExtra = ''
if [[ -z "$__MATERUS_HM_ZSH" ]]; then
__MATERUS_HM_ZSH=1
fi
if [[ -z "$__MATERUS_HM_ZSH_PROMPT" ]]; then
__MATERUS_HM_ZSH_PROMPT=${cfg.prompt}
fi
'';
initExtraFirst = lib.mkIf (cfg.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
'';
plugins = [
(lib.mkIf (cfg.prompt == "p10k" ) {
name = "powerlevel10k";
src = pkgs.fetchFromGitHub {
owner = "romkatv";
repo = "powerlevel10k";
rev = "bc5983543a10cff2eac30cced9208bbfd91428b8";
sha256 = "0s8ndbpmlqakg7s7hryyi1pqij1h5dv0xv9xvr2qwwyhyj6zrx2i";
};
file = "powerlevel10k.zsh-theme";
})
];
history = {
extended = true;
save = 100000;
size = 100000;
share = false;
ignoreDups = true;
ignoreSpace = true;
};
initExtra = ''
. ${zshcfg}/zinputrc
source ${zshcfg}/zshcompletion.zsh
bindkey -r "^["
bindkey ";5C" forward-word
bindkey ";5D" backward-word
'' +
(if (cfg.prompt == "p10k" ) then
''
if zmodload zsh/terminfo && (( terminfo[colors] >= 256 )); then
[[ ! -f ${p10kcfg}/fullcolor.zsh ]] || source ${p10kcfg}/fullcolor.zsh
else
[[ ! -f ${p10kcfg}/compatibility.zsh ]] || source ${p10kcfg}/compatibility.zsh
fi
'' else "");
};
programs.starship.enableZshIntegration = lib.mkForce false;
};
}