2020-11-23 15:22:00 +00:00
|
|
|
{ config, configName, depot, lib, pkgs, ... }:
|
|
|
|
let
|
|
|
|
inherit (pkgs.stdenv.hostPlatform) isDarwin isLinux;
|
|
|
|
in
|
2020-10-25 11:36:16 +00:00
|
|
|
{
|
2021-03-28 23:08:02 +00:00
|
|
|
imports = [ ./ntfy.nix ];
|
|
|
|
|
|
|
|
programs.ntfy = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
|
|
|
backends = [ "pushover" ];
|
|
|
|
pushover = {
|
|
|
|
user_key = depot.ops.secrets.pushover.userKey;
|
|
|
|
api_token = depot.ops.secrets.pushover.tokens.depot;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2020-10-25 11:36:16 +00:00
|
|
|
home.username = "lukegb";
|
2020-11-23 15:22:00 +00:00
|
|
|
home.homeDirectory = if isDarwin then "/Users/lukegb" else "/home/lukegb";
|
2020-10-25 11:36:16 +00:00
|
|
|
home.file = {
|
|
|
|
".hgrc".source = ./hgrc;
|
|
|
|
};
|
2020-11-01 18:11:48 +00:00
|
|
|
home.sessionVariables = {
|
|
|
|
EDITOR = "vim";
|
|
|
|
VISUAL = "vim";
|
|
|
|
};
|
2020-10-25 11:36:16 +00:00
|
|
|
|
2020-11-09 00:21:32 +00:00
|
|
|
programs.ssh = {
|
|
|
|
enable = true;
|
|
|
|
forwardAgent = true;
|
|
|
|
matchBlocks = let
|
|
|
|
allEventBlocks = (lib.concatStringsSep " " (builtins.map (n: "172.${toString n}.*.*") (lib.range 16 31)));
|
|
|
|
in ({
|
|
|
|
marukuru.port = 20022;
|
|
|
|
sar1.hostname = "81.131.50.219";
|
|
|
|
sar1-mon1 = {
|
|
|
|
user = "eng";
|
|
|
|
hostname = "172.16.0.9";
|
|
|
|
proxyJump = "sar1";
|
|
|
|
};
|
|
|
|
} // (builtins.listToAttrs [
|
|
|
|
{ name = allEventBlocks; value = { proxyJump = "sar1"; }; }
|
|
|
|
]));
|
|
|
|
};
|
|
|
|
|
2020-10-25 11:36:16 +00:00
|
|
|
programs.bash = {
|
|
|
|
enable = true;
|
2020-11-23 15:22:00 +00:00
|
|
|
enableVteIntegration = !isDarwin;
|
2020-10-25 11:36:16 +00:00
|
|
|
|
|
|
|
initExtra = ''
|
|
|
|
function join_by { local IFS="$1"; shift; echo "$*"; }
|
|
|
|
|
|
|
|
if [[ -z "$LAUNCH_SHLVL" ]]; then
|
|
|
|
export LAUNCH_SHLVL="$SHLVL"
|
|
|
|
fi
|
|
|
|
export LAUNCH_DEPTH="$(expr $SHLVL - $LAUNCH_SHLVL)"
|
|
|
|
export LAUNCH_DEPTH_STR=""
|
|
|
|
if [[ "$LAUNCH_DEPTH" > 0 ]]; then
|
|
|
|
if [[ "$PATH" == /nix/store/* ]]; then
|
|
|
|
declare -a RECENT_PKGS
|
|
|
|
while read -rd: pathseg; do
|
|
|
|
if [[ "$pathseg" != /nix/store/* ]]; then
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
RECENT_PKGS+=("$(echo "$pathseg" | sed -E -e 's,^/nix/store/[a-z0-9]+-,,' -e 's,/.*$,,' -e 's,-[0-9.]+$,,')")
|
|
|
|
done <<< $PATH
|
|
|
|
RECENT_PKG="$(join_by ":" "''${RECENT_PKGS[@]}")"
|
|
|
|
if [[ "''${#RECENT_PKG}" > 32 ]]; then
|
|
|
|
RECENT_PKGS="''${RECENT_PKGS[0]}"
|
|
|
|
fi
|
|
|
|
if [[ ! -z "$RECENT_PKG" ]]; then
|
|
|
|
LAUNCH_DEPTH_STR="[$RECENT_PKG] "
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [[ -z "$LAUNCH_DEPTH_STR" ]]; then
|
|
|
|
LAUNCH_DEPTH_STR="[$LAUNCH_DEPTH] "
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
export PS1="\n\[\033[1;32m\]$LAUNCH_DEPTH_STR[\[\e]0;\u@\h: \w\a\]\u@\h:\w]\$ \[\033[0m\]"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
programs.vim.enable = true;
|
|
|
|
|
2020-11-23 15:22:00 +00:00
|
|
|
home.packages = (with pkgs; ([
|
2020-10-25 11:36:16 +00:00
|
|
|
ripgrep
|
|
|
|
whois
|
2020-11-18 01:27:50 +00:00
|
|
|
dnsutils
|
2020-11-23 16:47:17 +00:00
|
|
|
] ++ lib.optionals (configName != null) [
|
2021-03-20 12:11:45 +00:00
|
|
|
# This only applies to "external" users of this config.
|
2020-11-23 15:22:00 +00:00
|
|
|
(writeShellScriptBin "home-manager" ''
|
|
|
|
#!/bin/sh
|
|
|
|
exec "${home-manager}/bin/home-manager" -f "${config.home.homeDirectory}/depot/home-manager-ext.nix" -A "${configName}" "$@"
|
|
|
|
'')
|
|
|
|
rxvt_unicode.terminfo tmux rsync libarchive tcpdump restic
|
2021-03-20 12:11:45 +00:00
|
|
|
iftop htop jq
|
2020-11-23 15:22:00 +00:00
|
|
|
(mercurial.overridePythonAttrs (origAttrs: {
|
2020-11-25 13:12:36 +00:00
|
|
|
propagatedBuildInputs = [python3Packages.hg-evolve depot.nix.pkgs.hg-git];
|
2020-11-23 15:22:00 +00:00
|
|
|
}))
|
2021-02-14 21:40:41 +00:00
|
|
|
] ++ lib.optionals isLinux [
|
|
|
|
iotop
|
2020-11-23 15:22:00 +00:00
|
|
|
]));
|
2020-10-25 11:36:16 +00:00
|
|
|
|
|
|
|
home.stateVersion = "20.09";
|
|
|
|
}
|