diff --git a/git/default.nix b/git/default.nix index dfe8f1a..11a026a 100644 --- a/git/default.nix +++ b/git/default.nix @@ -1,37 +1,6 @@ -{ - config, - pkgs, - lib, - ... -}: { +{config, ...}: { programs.git = { - enable = true; userName = "traxys"; userEmail = config.extraInfo.email; - delta = { - enable = true; - options = { - line-numbers = true; - syntax-theme = "Dracula"; - plus-style = "auto \"#121bce\""; - plus-emph-style = "auto \"#6083eb\""; - }; - }; - extraConfig = { - diff = { - algorithm = "histogram"; - }; - core = { - excludesfile = "${config.home.homeDirectory}/.gitignore"; - }; - }; - aliases = { - ri = "rebase -i"; - amend = "commit --amend"; - }; - }; - - home.file = { - ".gitignore".source = ./gitignore; }; } diff --git a/git/gitignore b/git/gitignore deleted file mode 100644 index 8e10828..0000000 --- a/git/gitignore +++ /dev/null @@ -1,2 +0,0 @@ -.cache -compile_commands.json diff --git a/home.nix b/home.nix index 578b569..9a025b2 100644 --- a/home.nix +++ b/home.nix @@ -12,57 +12,26 @@ }; in { home.packages = with pkgs; [ - neovimTraxys bitwarden-cli nodePackages.vscode-json-languageserver exa python3 topgrade - rsync - fd niv bintools httpie sqlx-cli codespell - ripgrep - file - jq - wget cargo-flamegraph linuxPackages.perf - unzip tokei gcc11 #nix-alien xdg-ninja bc kabalist_cli - comma - raclette - oscclip nvfetcher hbw - gnumake - gdb - pandoc - # Usefull for pandoc to latex - (texlive.combine { - inherit - (texlive) - scheme-medium - fncychap - wrapfig - capt-of - framed - upquote - needspace - tabulary - varwidth - titlesec - ; - }) - man-pages ]; services = { @@ -71,33 +40,11 @@ in { }; }; - nix.registry = { - "my".flake = flake; - }; - programs = { - direnv = { - enable = true; - nix-direnv.enable = true; - enableZshIntegration = true; - }; - - home-manager = { - enable = true; - }; - starship = { enable = true; }; - bat = { - enable = true; - }; - - zoxide = { - enable = true; - }; - ssh = { enable = true; matchBlocks = { @@ -138,7 +85,6 @@ in { initExtraBeforeCompInit = '' fpath+="$HOME/.zfunc" ''; - envExtra = "export EDITOR=nvim"; shellAliases = { new-direnv = "nix flake new -t github:nix-community/nix-direnv"; }; diff --git a/minimal/default.nix b/minimal/default.nix index 456687d..8a75231 100644 --- a/minimal/default.nix +++ b/minimal/default.nix @@ -1,51 +1,146 @@ { pkgs, inputs, + flake, + lib, + config, ... }: { - home.packages = with pkgs; [ - nix-zsh-completions - ]; + options.programs.git.excludes = lib.mkOption { + type = lib.types.lines; + default = ""; + }; - programs.zsh = { - enable = true; - enableCompletion = true; - oh-my-zsh = { - enable = true; - plugins = ["git" "wd" "rust"]; - }; - plugins = [ - { - name = "fast-syntax-highlighting"; - file = "fast-syntax-highlighting.plugin.zsh"; - src = inputs.fast-syntax-highlighting; - } - { - name = "zsh-nix-shell"; - file = "nix-shell.plugin.zsh"; - src = inputs.zsh-nix-shell; - } + config = { + home.packages = with pkgs; [ + bat + comma + fd + file + gdb + gnumake + jq + man-pages + neovimTraxys + nix-zsh-completions + oscclip + pandoc + raclette + ripgrep + rsync + tokei + unzip + wget + + # Useful for pandoc to latex + (texlive.combine { + inherit + (texlive) + scheme-medium + fncychap + wrapfig + capt-of + framed + upquote + needspace + tabulary + varwidth + titlesec + ; + }) ]; - initExtra = '' - export PATH="$PATH:$HOME/bin"; - source ${./p10k.zsh} - source ${inputs.powerlevel10k}/powerlevel10k.zsh-theme - if [ -f "$HOME/.zvars" ]; then - source "$HOME/.zvars" - fi - - ${pkgs.fortune}/bin/fortune \ - | ${pkgs.cowsay}/bin/cowsay \ - | ${pkgs.dotacat}/bin/dotacat - ''; - shellAliases = { - cat = "${pkgs.bat}/bin/bat -p"; - ls = "${pkgs.exa}/bin/exa --icons"; + nix.registry = { + "my".flake = flake; }; - }; - home.file = { - ".zprofile".source = ./zprofile; + programs.direnv = { + enable = true; + nix-direnv.enable = true; + enableZshIntegration = true; + }; + + programs.home-manager.enable = true; + programs.bat.enable = true; + programs.zoxide.enable = true; + + programs.git = { + enable = true; + package = pkgs.gitAndTools.gitFull; + delta = { + enable = true; + options = { + line-numbers = true; + syntax-theme = "Dracula"; + plus-style = "auto \"#121bce\""; + plus-emph-style = "auto \"#6083eb\""; + }; + }; + + excludes = '' + .cache + compile_commands.json + ''; + + extraConfig = { + diff = { + algorithm = "histogram"; + }; + core = { + excludesfile = "${pkgs.writeText "gitignore" config.programs.git.excludes}"; + }; + }; + + aliases = { + ri = "rebase -i"; + amend = "commit --amend"; + }; + }; + + programs.zsh = { + enable = true; + enableCompletion = true; + oh-my-zsh = { + enable = true; + plugins = ["git" "wd" "rust"]; + }; + plugins = [ + { + name = "fast-syntax-highlighting"; + file = "fast-syntax-highlighting.plugin.zsh"; + src = inputs.fast-syntax-highlighting; + } + { + name = "zsh-nix-shell"; + file = "nix-shell.plugin.zsh"; + src = inputs.zsh-nix-shell; + } + ]; + + envExtra = "export EDITOR=nvim"; + + initExtra = '' + export PATH="$PATH:$HOME/bin"; + source ${./p10k.zsh} + source ${inputs.powerlevel10k}/powerlevel10k.zsh-theme + if [ -f "$HOME/.zvars" ]; then + source "$HOME/.zvars" + fi + + ${pkgs.fortune}/bin/fortune \ + | ${pkgs.cowsay}/bin/cowsay \ + | ${pkgs.dotacat}/bin/dotacat + ''; + shellAliases = { + cat = "${pkgs.bat}/bin/bat -p"; + ls = "${pkgs.exa}/bin/exa --icons"; + }; + }; + + home.file = { + ".zprofile".source = ./zprofile; + }; + + home.stateVersion = "21.11"; }; }