Compare commits
5 commits
4e26e1aa0b
...
9f548cffe3
| Author | SHA1 | Date | |
|---|---|---|---|
| 9f548cffe3 | |||
| 0422859f85 | |||
| a5aa99c83f | |||
| 49262360ab | |||
| 5bc4b4d33f |
5 changed files with 75 additions and 28 deletions
|
|
@ -15,6 +15,9 @@
|
||||||
# I use scripts that use the passthrough sequence often on this host
|
# I use scripts that use the passthrough sequence often on this host
|
||||||
enablePassthrough = true;
|
enablePassthrough = true;
|
||||||
|
|
||||||
|
# Frequent reboots mean that session persistence can be handy
|
||||||
|
enableResurrect = true;
|
||||||
|
|
||||||
terminalFeatures = {
|
terminalFeatures = {
|
||||||
# HTerm uses `xterm-256color` as its `$TERM`, so use that here
|
# HTerm uses `xterm-256color` as its `$TERM`, so use that here
|
||||||
xterm-256color = { };
|
xterm-256color = { };
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
./bluetooth
|
./bluetooth
|
||||||
./calibre
|
./calibre
|
||||||
./comma
|
./comma
|
||||||
|
./delta
|
||||||
./dircolors
|
./dircolors
|
||||||
./direnv
|
./direnv
|
||||||
./discord
|
./discord
|
||||||
|
|
|
||||||
61
modules/home/delta/default.nix
Normal file
61
modules/home/delta/default.nix
Normal file
|
|
@ -0,0 +1,61 @@
|
||||||
|
{ 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 {
|
||||||
|
delta = {
|
||||||
|
enable = true;
|
||||||
|
inherit (cfg) package;
|
||||||
|
};
|
||||||
|
|
||||||
|
includes = [
|
||||||
|
{
|
||||||
|
path = configPath;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -42,34 +42,6 @@ in
|
||||||
|
|
||||||
lfs.enable = true;
|
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
|
# There's more
|
||||||
extraConfig = {
|
extraConfig = {
|
||||||
# Makes it a bit more readable
|
# Makes it a bit more readable
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,8 @@ in
|
||||||
|
|
||||||
enablePassthrough = mkEnableOption "tmux DCS passthrough sequence";
|
enablePassthrough = mkEnableOption "tmux DCS passthrough sequence";
|
||||||
|
|
||||||
|
enableResurrect = mkEnableOption "tmux-resurrect plugin";
|
||||||
|
|
||||||
terminalFeatures = mkOption {
|
terminalFeatures = mkOption {
|
||||||
type = with types; attrsOf (submodule {
|
type = with types; attrsOf (submodule {
|
||||||
options = {
|
options = {
|
||||||
|
|
@ -50,6 +52,7 @@ in
|
||||||
mouse = false; # I dislike mouse support
|
mouse = false; # I dislike mouse support
|
||||||
focusEvents = true; # Report focus events
|
focusEvents = true; # Report focus events
|
||||||
terminal = "tmux-256color"; # I want accurate termcap info
|
terminal = "tmux-256color"; # I want accurate termcap info
|
||||||
|
aggressiveResize = true; # Automatic resize when switching client size
|
||||||
|
|
||||||
plugins = with pkgs.tmuxPlugins; [
|
plugins = with pkgs.tmuxPlugins; [
|
||||||
# Open high-lighted files in copy mode
|
# Open high-lighted files in copy mode
|
||||||
|
|
@ -79,6 +82,13 @@ in
|
||||||
set -g status-right '#{prefix_highlight} %a %Y-%m-%d %H:%M'
|
set -g status-right '#{prefix_highlight} %a %Y-%m-%d %H:%M'
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
# Resurrect sessions
|
||||||
|
(lib.optionalAttrs cfg.enableResurrect {
|
||||||
|
plugin = resurrect;
|
||||||
|
extraConfig = ''
|
||||||
|
set -g @resurrect-dir '${config.xdg.stateHome}/tmux/resurrect'
|
||||||
|
'';
|
||||||
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue