Tue Jun 4 04:16:30 PM CEST 2024

This commit is contained in:
Thomas Avé 2024-06-04 16:16:30 +02:00
parent 2f88658882
commit d6f4ca2f3d
9 changed files with 262 additions and 271 deletions

View File

@ -31,8 +31,8 @@
{ nixpkgs.overlays = [ nur.overlay ]; } { nixpkgs.overlays = [ nur.overlay ]; }
{ {
hardware.opengl = { hardware.opengl = {
enable = true; enable = true;
driSupport = true; driSupport = true;
}; };
networking.hostName = host; networking.hostName = host;
boot.loader.systemd-boot = { boot.loader.systemd-boot = {
@ -50,7 +50,7 @@
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
]; ];
experimental-features = [ "nix-command" "flakes" ]; experimental-features = [ "nix-command" "flakes" ];
trusted-users = ["root" "user"]; trusted-users = [ "root" "user" ];
auto-optimise-store = true; auto-optimise-store = true;
}; };

View File

@ -12,11 +12,7 @@
./ssh ./ssh
./mpv ./mpv
]; ];
home.packages = with pkgs; [ home.packages = with pkgs; [ telegram-desktop webcord devenv ];
telegram-desktop
webcord
devenv
];
services.hyprpaper = { services.hyprpaper = {
settings = { settings = {

View File

@ -1,146 +1,139 @@
{ inputs, config, pkgs, ... }: { inputs, config, pkgs, ... }:
let let
notify_script = (pkgs.writers.writePython3Bin "telegram-notify.py" { libraries = [ pkgs.python3Packages.python-telegram-bot ]; } '' notify_script = (pkgs.writers.writePython3Bin "telegram-notify.py" {
import telegram libraries = [ pkgs.python3Packages.python-telegram-bot ];
import asyncio } ''
import sys import telegram
import subprocess import asyncio
import sys
import subprocess
async def run(): async def run():
text = subprocess.check_output( text = subprocess.check_output(
["journalctl", "--user", "-u", sys.argv[1], "-b"] ["journalctl", "--user", "-u", sys.argv[1], "-b"]
).decode("utf-8") ).decode("utf-8")
with open("/home/server/mail.log", "a") as f: with open("/home/server/mail.log", "a") as f:
f.write("===========================================") f.write("===========================================")
f.write(text) f.write(text)
bot = telegram.Bot(token="381718873:AAElFmI2BDjumCehhWicuksE0vutrPSkoGA") bot = telegram.Bot(token="381718873:AAElFmI2BDjumCehhWicuksE0vutrPSkoGA")
chat_id = 125754925 chat_id = 125754925
await bot.send_message( await bot.send_message(
chat_id, "Mallorea encountered an error in the service: " + sys.argv[1] chat_id, "Mallorea encountered an error in the service: " + sys.argv[1]
) )
await bot.send_message(chat_id, text) await bot.send_message(chat_id, text)
if __name__ == "__main__": if __name__ == "__main__":
loop = asyncio.get_event_loop() loop = asyncio.get_event_loop()
loop.run_until_complete(asyncio.wait([loop.create_task(run())])) loop.run_until_complete(asyncio.wait([loop.create_task(run())]))
loop.close() loop.close()
''); '');
mkTimer = name: cfg: mkTimer = name: cfg: {
{ Install.WantedBy = [ "timers.target" ];
Install.WantedBy = [ "timers.target" ]; Timer = {
Timer = { Persistent = true;
Persistent = true; OnCalendar = cfg.when;
OnCalendar = cfg.when; Unit = "${name}.service";
Unit = "${name}.service";
};
};
mkService = name: cfg:
{
Unit.Description = name;
Unit.OnFailure = "status_notify@%n.service";
Install = {
WantedBy = [ "default.target" ];
};
Service = {
ExecStart = cfg.script;
};
};
scripts = {
disk_check = {
when = "*-*-* *:00:00";
script = toString (pkgs.writeShellScript "script" ''
REPORT_EMAIL=email@thomasave.be
ZPOOL_STATUS=$(zpool status -x)
if [ "$ZPOOL_STATUS" = "all pools are healthy" ] || [ "$ZPOOL_STATUS" = "no pools available" ]
then
printf 0 > /var/db/zpool.status
else
if [ "$(cat /var/db/zpool.status)" -eq 0 ]
then
zpool status | mail -s "ZPOOL NOT HEALTHY" $REPORT_EMAIL
printf 1 > /var/db/zpool.status
fi
fi
'');
};
vdirsyncer = {
when = "*:0/15";
script = toString (pkgs.writeShellScript "script" ''
${pkgs.vdirsyncer}/bin/vdirsyncer sync imec/pair
'');
};
mbsync = {
when = "*-*-* 00:00:00";
script = toString (pkgs.writeShellScript "script" ''
BASEDIR=/home/server/Containers/mbsync
# python3 $BASEDIR/config/oauth2/mutt_oauth2.py $BASEDIR/data/oauth2/credentials.json
docker exec --user "1000:1000" mbsync-container /home/user/.config/mbsync/run.sh -a
${pkgs.notmuch}/bin/notmuch new
'');
};
sync_vault = {
when = "*-*-* 02:00:00";
script = toString (pkgs.writeShellScript "script" ''
source $HOME/.secrets/Backup/env.sh
for _ in {1..2}; do
OUTPUT=$(echo "$ZFS_PASSPHRASE" | ssh 10.4.0.1 zfs load-key Vault/Thomas/Encrypted 2>&1);
if [ "$OUTPUT" == "Key load error: Key already loaded for 'Vault/Thomas/Encrypted'." ]; then
echo "Key successfully loaded, starting syncoid"
syncoid --no-privilege-elevation --no-sync-snap tank/Storage/Thomas/Workspace 10.4.0.1:Vault/Thomas/Encrypted/Storage/Workspace
syncoid --no-privilege-elevation --no-sync-snap tank/Storage/Thomas 10.4.0.1:Vault/Thomas/Encrypted/Storage/T
syncoid --no-privilege-elevation --no-sync-snap tank/Storage/Niels 10.4.0.1:Vault/Thomas/Encrypted/Storage/N
syncoid --no-privilege-elevation --no-sync-snap tank/Storage/Yolande 10.4.0.1:Vault/Thomas/Encrypted/Storage/Y
syncoid --no-privilege-elevation --no-sync-snap tank/Containers 10.4.0.1:Vault/Thomas/Encrypted/Containers
ssh 10.4.0.1 zfs unload-key Vault/Thomas/Encrypted
${pkgs.curl}/bin/curl https://uptime.thomasave.be/api/push/s39pIIrB0R
exit 0
fi
done
echo "Found output instead: $OUTPUT"
echo "Failed to load key: $OUTPUT" | sendmail
exit 1
'');
};
backup = {
when = "*-*-* 04:00:00";
script = toString (pkgs.writeShellScript "script" ''
${./scripts/files/backup.sh}
${pkgs.curl}/bin/curl https://uptime.thomasave.be/api/push/R6iJcWqGp0
'');
};
}; };
in };
{ mkService = name: cfg: {
Unit.Description = name;
Unit.OnFailure = "status_notify@%n.service";
Install = { WantedBy = [ "default.target" ]; };
Service = { ExecStart = cfg.script; };
};
scripts = {
disk_check = {
when = "*-*-* *:00:00";
script = toString (pkgs.writeShellScript "script" ''
REPORT_EMAIL=email@thomasave.be
ZPOOL_STATUS=$(zpool status -x)
if [ "$ZPOOL_STATUS" = "all pools are healthy" ] || [ "$ZPOOL_STATUS" = "no pools available" ]
then
printf 0 > /var/db/zpool.status
else
if [ "$(cat /var/db/zpool.status)" -eq 0 ]
then
zpool status | mail -s "ZPOOL NOT HEALTHY" $REPORT_EMAIL
printf 1 > /var/db/zpool.status
fi
fi
'');
};
vdirsyncer = {
when = "*:0/15";
script = toString (pkgs.writeShellScript "script" ''
${pkgs.vdirsyncer}/bin/vdirsyncer sync imec/pair
'');
};
mbsync = {
when = "*-*-* 00:00:00";
script = toString (pkgs.writeShellScript "script" ''
BASEDIR=/home/server/Containers/mbsync
# python3 $BASEDIR/config/oauth2/mutt_oauth2.py $BASEDIR/data/oauth2/credentials.json
docker exec --user "1000:1000" mbsync-container /home/user/.config/mbsync/run.sh -a
${pkgs.notmuch}/bin/notmuch new
'');
};
sync_vault = {
when = "*-*-* 02:00:00";
script = toString (pkgs.writeShellScript "script" ''
source $HOME/.secrets/Backup/env.sh
for _ in {1..2}; do
OUTPUT=$(echo "$ZFS_PASSPHRASE" | ssh 10.4.0.1 zfs load-key Vault/Thomas/Encrypted 2>&1);
if [ "$OUTPUT" == "Key load error: Key already loaded for 'Vault/Thomas/Encrypted'." ]; then
echo "Key successfully loaded, starting syncoid"
syncoid --no-privilege-elevation --no-sync-snap tank/Storage/Thomas/Workspace 10.4.0.1:Vault/Thomas/Encrypted/Storage/Workspace
syncoid --no-privilege-elevation --no-sync-snap tank/Storage/Thomas 10.4.0.1:Vault/Thomas/Encrypted/Storage/T
syncoid --no-privilege-elevation --no-sync-snap tank/Storage/Niels 10.4.0.1:Vault/Thomas/Encrypted/Storage/N
syncoid --no-privilege-elevation --no-sync-snap tank/Storage/Yolande 10.4.0.1:Vault/Thomas/Encrypted/Storage/Y
syncoid --no-privilege-elevation --no-sync-snap tank/Containers 10.4.0.1:Vault/Thomas/Encrypted/Containers
ssh 10.4.0.1 zfs unload-key Vault/Thomas/Encrypted
${pkgs.curl}/bin/curl https://uptime.thomasave.be/api/push/s39pIIrB0R
exit 0
fi
done
echo "Found output instead: $OUTPUT"
echo "Failed to load key: $OUTPUT" | sendmail
exit 1
'');
};
backup = {
when = "*-*-* 04:00:00";
script = toString (pkgs.writeShellScript "script" ''
${./scripts/files/backup.sh}
${pkgs.curl}/bin/curl https://uptime.thomasave.be/api/push/R6iJcWqGp0
'');
};
};
in {
home.username = "server"; home.username = "server";
home.homeDirectory = "/home/server"; home.homeDirectory = "/home/server";
nix = { nix = {
package = pkgs.nix; package = pkgs.nix;
settings.use-xdg-base-directories = true; settings.use-xdg-base-directories = true;
}; };
xdg.enable = true; xdg.enable = true;
# home.profileDirectory = "${config.xdg.stateHome}/nix/profile"; # home.profileDirectory = "${config.xdg.stateHome}/nix/profile";
imports = [ imports = [ (import ./common.nix { inherit inputs config pkgs; }) ./ssh ];
(import ./common.nix { inherit inputs config pkgs; })
./ssh
];
home.sessionVariables = { home.sessionVariables = {
NIX_PATH = "${config.xdg.stateHome}/nix/profiles/channels/"; NIX_PATH = "${config.xdg.stateHome}/nix/profiles/channels/";
LANG = "en_US.UTF-8"; LANG = "en_US.UTF-8";
XDG_RUNTIME_DIR="/run/user/$(id -u)"; XDG_RUNTIME_DIR = "/run/user/$(id -u)";
}; };
systemd.user.services = pkgs.lib.mapAttrs mkService scripts // systemd.user.services = pkgs.lib.mapAttrs mkService scripts
(pkgs.lib.mapAttrs mkService { // (pkgs.lib.mapAttrs mkService {
"status_notify@" = { "status_notify@" = {
script = "${notify_script}/bin/telegram-notify.py %i"; script = "${notify_script}/bin/telegram-notify.py %i";
};}); };
});
systemd.user.timers = pkgs.lib.mapAttrs mkTimer scripts; systemd.user.timers = pkgs.lib.mapAttrs mkTimer scripts;
# Don't forget to enable these timers! Or reboot, after which it should also be activated automatically # Don't forget to enable these timers! Or reboot, after which it should also be activated automatically

View File

@ -5,9 +5,7 @@
".mailcap".text = ".mailcap".text =
"text/html; w3m -dump -o -document_charset=%{charset} %s; nametemplate=%s.html; copiousoutput"; "text/html; w3m -dump -o -document_charset=%{charset} %s; nametemplate=%s.html; copiousoutput";
}; };
home.packages = with pkgs; [ home.packages = with pkgs; [ mailcap ];
mailcap
];
programs.notmuch = { programs.notmuch = {
enable = true; enable = true;
@ -155,8 +153,8 @@
}; };
extraConfig = { extraConfig = {
general = { general = {
term = "xterm-256color"; term = "xterm-256color";
unsafe-accounts-conf = true; unsafe-accounts-conf = true;
}; };
ui = { ui = {
border-char-vertical = ""; border-char-vertical = "";
@ -168,59 +166,72 @@
dirlist-right = "{{if .Unread}}{{humanReadable .Unread}}{{end}}"; dirlist-right = "{{if .Unread}}{{humanReadable .Unread}}{{end}}";
dirlist-tree = true; dirlist-tree = true;
}; };
viewer = { pager = "${pkgs.neovim}/bin/nvim -u ${config.xdg.configHome}/nvim/aerc.lua"; }; viewer = {
pager =
"${pkgs.neovim}/bin/nvim -u ${config.xdg.configHome}/nvim/aerc.lua";
};
compose = { address-book-cmd = ''notmuch address "%s"''; }; compose = { address-book-cmd = ''notmuch address "%s"''; };
multipart-converters = { multipart-converters = {
"text/html" = "${pkgs.w3m}/bin/w3m -dump -o display_link_number=1 -T text/html"; "text/html" =
"${pkgs.w3m}/bin/w3m -dump -o display_link_number=1 -T text/html";
}; };
filters = { filters = {
"text/plain" = "cat"; "text/plain" = "cat";
"text/calendar" = "${pkgs.gnome.gnome-calendar}/bin/gnome-calendar"; "text/calendar" = "${pkgs.gnome.gnome-calendar}/bin/gnome-calendar";
"message/delivery-status" = "cat"; "message/delivery-status" = "cat";
"message/rfc822" = "cat"; "message/rfc822" = "cat";
"text/html" = "${pkgs.w3m}/bin/w3m -dump -o display_link_number=1 -T text/html"; "text/html" =
"${pkgs.w3m}/bin/w3m -dump -o display_link_number=1 -T text/html";
"application/x-sh" = "${pkgs.bat}/bin/bat -fP -l sh"; "application/x-sh" = "${pkgs.bat}/bin/bat -fP -l sh";
}; };
}; };
extraAccounts = { extraAccounts = {
Zoho = { Zoho = {
outgoing = "smtps://email%40thomasave.be@smtp.zoho.com"; outgoing = "smtps://email%40thomasave.be@smtp.zoho.com";
outgoing-cred-cmd = "cat ~/.secrets/Aerc/Zoho.key"; outgoing-cred-cmd = "cat ~/.secrets/Aerc/Zoho.key";
source = "maildir:///home/server/Storage/Thomas/Mail/email@thomasave.be/"; source =
check-mail-cmd = "ssh server@10.1 /home/server/Containers/mbsync/sync.sh"; "maildir:///home/server/Storage/Thomas/Mail/email@thomasave.be/";
check-mail-timeout = "60s"; check-mail-cmd =
default = "Inbox"; "ssh server@10.1 /home/server/Containers/mbsync/sync.sh";
from = "\"Thomas Avé\" <email@thomasave.be>"; check-mail-timeout = "60s";
cache-headers = true; default = "Inbox";
}; from = ''"Thomas Avé" <email@thomasave.be>'';
UAntwerpen = { cache-headers = true;
outgoing = "ssh server@192.168.1.2 /home/server/Containers/mbsync/send.sh"; };
source = "maildir:///home/server/Storage/Thomas/Mail/Thomas.Ave@uantwerpen.be"; UAntwerpen = {
check-mail-cmd = "ssh server@10.1 /home/server/Containers/mbsync/sync.sh"; outgoing =
check-mail-timeout = "60s"; "ssh server@192.168.1.2 /home/server/Containers/mbsync/send.sh";
default = "Inbox"; source =
from = "\"Thomas Avé\" <Thomas.Ave@uantwerpen.be>"; "maildir:///home/server/Storage/Thomas/Mail/Thomas.Ave@uantwerpen.be";
cache-headers = true; check-mail-cmd =
}; "ssh server@10.1 /home/server/Containers/mbsync/sync.sh";
IMEC = { check-mail-timeout = "60s";
outgoing = "smtp+insecure://ave57%40imec.be@smtp.thomasave.be:1025"; default = "Inbox";
outgoing-cred-cmd = "cat ~/.secrets/Aerc/IMEC.key"; from = ''"Thomas Avé" <Thomas.Ave@uantwerpen.be>'';
source = "maildir:///home/server/Storage/Thomas/Mail/Thomas.Ave@imec.be/"; cache-headers = true;
check-mail-cmd = "ssh server@10.1 /home/server/Containers/mbsync/sync.sh"; };
check-mail-timeout = "60s"; IMEC = {
default = "Inbox"; outgoing = "smtp+insecure://ave57%40imec.be@smtp.thomasave.be:1025";
from = "\"Thomas Avé\" <Thomas.Ave@imec.be>"; outgoing-cred-cmd = "cat ~/.secrets/Aerc/IMEC.key";
cache-headers = true; source =
}; "maildir:///home/server/Storage/Thomas/Mail/Thomas.Ave@imec.be/";
NotMuch = { check-mail-cmd =
source = "notmuch:///home/server/Storage/Thomas/Mail/"; "ssh server@10.1 /home/server/Containers/mbsync/sync.sh";
check-mail-cmd = "ssh server@10.1 /home/server/Containers/mbsync/sync.sh"; check-mail-timeout = "60s";
check-mail-timeout = "60s"; default = "Inbox";
from = "\"Thomas Avé\" <Thomas.Ave@uantwerpen.be>"; from = ''"Thomas Avé" <Thomas.Ave@imec.be>'';
query-map = "${config.xdg.configHome}/aerc/map.conf"; cache-headers = true;
default = "INBOX"; };
cache-headers = true; NotMuch = {
}; source = "notmuch:///home/server/Storage/Thomas/Mail/";
check-mail-cmd =
"ssh server@10.1 /home/server/Containers/mbsync/sync.sh";
check-mail-timeout = "60s";
from = ''"Thomas Avé" <Thomas.Ave@uantwerpen.be>'';
query-map = "${config.xdg.configHome}/aerc/map.conf";
default = "INBOX";
cache-headers = true;
};
}; };
}; };

View File

@ -66,9 +66,7 @@ in {
home.packages = with pkgs; [ wl-clipboard ]; home.packages = with pkgs; [ wl-clipboard ];
services.cliphist = { services.cliphist = { enable = true; };
enable = true;
};
services.hyprpaper = { services.hyprpaper = {
enable = true; enable = true;
@ -202,7 +200,7 @@ in {
"$mainMod, SPACE, togglesplit, # dwindle" "$mainMod, SPACE, togglesplit, # dwindle"
"CONTROL_L ALT_L, L, exec, ${swaylock}" "CONTROL_L ALT_L, L, exec, ${swaylock}"
'' ''
$mainMod, C, exec, cliphist list | awk '{print $0, "\0icon\x1fcom.github.davidmhewitt.clipped"; }' | ${rofi} -dmenu -display-columns 2 | cliphist decode | wl-copy'' $mainMod, C, exec, cliphist list | awk '{print $0, "\0icon\x1fcom.github.davidmhewitt.clipped"; }' | ${rofi} -dmenu -display-columns 2 | cliphist decode | wl-copy''
"$mainMod, Y, exec, ${rofi-ykman}/bin/rofi-ykman" "$mainMod, Y, exec, ${rofi-ykman}/bin/rofi-ykman"
"$mainMod, N, exec, ${./files/rofi-ssh.sh}" "$mainMod, N, exec, ${./files/rofi-ssh.sh}"

View File

@ -5,38 +5,38 @@
enable = true; enable = true;
shellIntegration.enableZshIntegration = true; shellIntegration.enableZshIntegration = true;
font = { font = {
name = "Iosevka Extended"; name = "Iosevka Extended";
size = 15; size = 15;
}; };
settings = { settings = {
cursor_shape = "block"; cursor_shape = "block";
cursor_beam_thickness = 10; cursor_beam_thickness = 10;
scrollback_lines = 100000; scrollback_lines = 100000;
# Theme # Theme
background = "#000010"; background = "#000010";
foreground = "#F8F8F2"; foreground = "#F8F8F2";
cursor = "#bbbbbb"; cursor = "#bbbbbb";
selection_background = "#b4d5ff"; selection_background = "#b4d5ff";
color0 = "#121212"; color0 = "#121212";
color8 = "#545454"; color8 = "#545454";
color1 = "#fa2573"; color1 = "#fa2573";
color9 = "#f5669c"; color9 = "#f5669c";
color2 = "#97e123"; color2 = "#97e123";
color10 = "#b0e05e"; color10 = "#b0e05e";
color3 = "#dfd460"; color3 = "#dfd460";
color11 = "#fef26c"; color11 = "#fef26c";
color4 = "#0f7fcf"; color4 = "#0f7fcf";
color12 = "#00afff"; color12 = "#00afff";
color5 = "#8700ff"; color5 = "#8700ff";
color13 = "#af87ff"; color13 = "#af87ff";
color6 = "#42a7cf"; color6 = "#42a7cf";
color14 = "#50cdfe"; color14 = "#50cdfe";
color7 = "#bbbbbb"; color7 = "#bbbbbb";
color15 = "#ffffff"; color15 = "#ffffff";
selection_foreground = "#121212"; selection_foreground = "#121212";
background_opacity = "0.3"; background_opacity = "0.3";
}; };
}; };
} }

View File

@ -1,11 +1,9 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
home.file."${config.xdg.configHome}/mpv" = { home.file."${config.xdg.configHome}/mpv" = {
source = ./files; source = ./files;
recursive = true; recursive = true;
}; };
programs.mpv = { programs.mpv = { enable = true; };
enable = true;
};
} }

View File

@ -1,58 +1,57 @@
{ inputs, config, pkgs, ... }: { inputs, config, pkgs, ... }:
let let
tmux-themepack = pkgs.tmuxPlugins.mkTmuxPlugin { tmux-themepack = pkgs.tmuxPlugins.mkTmuxPlugin {
pluginName = "tmux-themepack"; pluginName = "tmux-themepack";
rtpFilePath = "themepack.tmux"; rtpFilePath = "themepack.tmux";
version = "unstable-2019-12-22"; version = "unstable-2019-12-22";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "jimeh"; owner = "jimeh";
repo = "tmux-themepack"; repo = "tmux-themepack";
rev = "7c59902f64dcd7ea356e891274b21144d1ea5948"; rev = "7c59902f64dcd7ea356e891274b21144d1ea5948";
sha256 = "sha256-c5EGBrKcrqHWTKpCEhxYfxPeERFrbTuDfcQhsUAbic4="; sha256 = "sha256-c5EGBrKcrqHWTKpCEhxYfxPeERFrbTuDfcQhsUAbic4=";
}; };
}; };
in in {
{ programs.tmux = {
programs.tmux = { shell = "${pkgs.zsh}/bin/zsh";
shell = "${pkgs.zsh}/bin/zsh"; terminal = "screen-256color";
terminal = "screen-256color"; enable = true;
enable = true; clock24 = true;
clock24 = true; shortcut = "a";
shortcut = "a"; escapeTime = 0;
escapeTime = 0; newSession = true;
newSession = true; mouse = true;
mouse = true; keyMode = "vi";
keyMode = "vi"; plugins = [
plugins = [ pkgs.tmuxPlugins.vim-tmux-navigator
pkgs.tmuxPlugins.vim-tmux-navigator pkgs.tmuxPlugins.better-mouse-mode
pkgs.tmuxPlugins.better-mouse-mode pkgs.tmuxPlugins.yank
pkgs.tmuxPlugins.yank {
{ plugin = tmux-themepack;
plugin = tmux-themepack;
extraConfig = ''
set -g @themepack "powerline/double/blue"
set-window-option -g status-left " #S "
set-window-option -g status-right " #{prefix_highlight} \"#(hostname)\" %H:%M %d-%b-%y "
set-window-option -g window-status-format " #I: #W "
set-window-option -g window-status-current-format " #I: #W "
'';
}
];
extraConfig = '' extraConfig = ''
set-window-option -g mode-keys vi set -g @themepack "powerline/double/blue"
bind-key -T copy-mode-vi 'v' send -X begin-selection set-window-option -g status-left " #S "
bind-key -T copy-mode-vi 'y' send -X copy-selection set-window-option -g status-right " #{prefix_highlight} \"#(hostname)\" %H:%M %d-%b-%y "
set-window-option -g window-status-format " #I: #W "
bind | split-window -h -c "#{pane_current_path}" set-window-option -g window-status-current-format " #I: #W "
bind - split-window -v -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
unbind '"'
unbind %
set-option -g xterm-keys on
''; '';
};
}
];
extraConfig = ''
set-window-option -g mode-keys vi
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-selection
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
unbind '"'
unbind %
set-option -g xterm-keys on
'';
};
} }

View File

@ -23,17 +23,13 @@
TERM = "screen-256color"; TERM = "screen-256color";
PYTHONDONTWRITEBYTECODE = "1"; PYTHONDONTWRITEBYTECODE = "1";
GOPATH = "${config.xdg.dataHome}/go"; GOPATH = "${config.xdg.dataHome}/go";
DIRENV_LOG_FORMAT=""; DIRENV_LOG_FORMAT = "";
}; };
programs.direnv = { programs.direnv = {
enable = true; enable = true;
enableZshIntegration = true; # see note on other shells below enableZshIntegration = true; # see note on other shells below
nix-direnv.enable = true; nix-direnv.enable = true;
config = { config = { global = { hiden_env_diff = true; }; };
global = {
hiden_env_diff = true;
};
};
}; };
programs.command-not-found.enable = true; programs.command-not-found.enable = true;
programs.zoxide = { programs.zoxide = {