diff --git a/modules/home/default.nix b/modules/home/default.nix index e642e87..c8183cf 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -8,7 +8,6 @@ ./bluetooth ./calibre ./comma - ./delta ./dircolors ./direnv ./discord diff --git a/modules/home/delta/default.nix b/modules/home/delta/default.nix deleted file mode 100644 index 4d83749..0000000 --- a/modules/home/delta/default.nix +++ /dev/null @@ -1,61 +0,0 @@ -{ config, pkgs, lib, ... }: -let - cfg = config.my.home.delta; - - configFormat = pkgs.formats.gitIni { }; - configPath = "${config.xdg.configHome}/delta/config"; -in -{ - options.my.home.delta = with lib; { - enable = my.mkDisableOption "delta configuration"; - - package = mkPackageOption pkgs "delta" { }; - - git = { - enable = my.mkDisableOption "git integration"; - }; - }; - - config = lib.mkIf cfg.enable { - home.packages = [ cfg.package ]; - - xdg.configFile."delta/config".source = configFormat.generate "delta-config" { - delta = { - features = "diff-highlight decorations"; - - # Less jarring style for `diff-highlight` emulation - diff-highlight = { - minus-style = "red"; - minus-non-emph-style = "red"; - minus-emph-style = "bold red 52"; - - plus-style = "green"; - plus-non-emph-style = "green"; - plus-emph-style = "bold green 22"; - - whitespace-error-style = "reverse red"; - }; - - # Personal preference for easier reading - decorations = { - commit-style = "raw"; # Do not recolor meta information - keep-plus-minus-markers = true; - paging = "always"; - }; - }; - }; - - programs.git = lib.mkIf cfg.git.enable { - includes = [ - { - path = configPath; - } - ]; - - delta = { - enable = true; - inherit (cfg) package; - }; - }; - }; -} diff --git a/modules/home/git/default.nix b/modules/home/git/default.nix index 98361ad..8791cb2 100644 --- a/modules/home/git/default.nix +++ b/modules/home/git/default.nix @@ -42,6 +42,34 @@ in lfs.enable = true; + delta = { + enable = true; + + options = { + features = "diff-highlight decorations"; + + # Less jarring style for `diff-highlight` emulation + diff-highlight = { + minus-style = "red"; + minus-non-emph-style = "red"; + minus-emph-style = "bold red 52"; + + plus-style = "green"; + plus-non-emph-style = "green"; + plus-emph-style = "bold green 22"; + + whitespace-error-style = "reverse red"; + }; + + # Personal preference for easier reading + decorations = { + commit-style = "raw"; # Do not recolor meta information + keep-plus-minus-markers = true; + paging = "always"; + }; + }; + }; + # There's more extraConfig = { # Makes it a bit more readable @@ -134,34 +162,30 @@ in }; }; - includes = lib.mkMerge [ + includes = [ # Multiple identities - [ - { - condition = "gitdir:~/git/EPITA/"; - contents = { - user = { - name = "Bruno BELANYI"; - email = mkMailAddress "bruno.belanyi" "epita.fr"; - }; + { + condition = "gitdir:~/git/EPITA/"; + contents = { + user = { + name = "Bruno BELANYI"; + email = mkMailAddress "bruno.belanyi" "epita.fr"; }; - } - { - condition = "gitdir:~/git/work/"; - contents = { - user = { - name = "Bruno BELANYI"; - email = mkMailAddress "ambroisie" "google.com"; - }; + }; + } + { + condition = "gitdir:~/git/work/"; + contents = { + user = { + name = "Bruno BELANYI"; + email = mkMailAddress "ambroisie" "google.com"; }; - } - ] + }; + } # Local configuration, not-versioned - (lib.mkAfter [ - { - path = "config.local"; - } - ]) + { + path = "config.local"; + } ]; ignores =