2020-03-05 14:18:17 +01:00
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
2020-03-13 18:25:05 +01:00
|
|
|
let
|
2020-03-14 00:03:57 +01:00
|
|
|
briefcase = import <briefcase> {};
|
2020-03-13 18:25:05 +01:00
|
|
|
in {
|
2020-03-05 16:02:23 +01:00
|
|
|
home = {
|
|
|
|
packages = with pkgs; [
|
|
|
|
bat
|
|
|
|
exa
|
|
|
|
ripgrep
|
|
|
|
fd
|
|
|
|
pass
|
|
|
|
tokei
|
|
|
|
nmap
|
|
|
|
tldr
|
|
|
|
diskus
|
|
|
|
jq
|
|
|
|
pup
|
|
|
|
];
|
2020-03-10 23:04:52 +01:00
|
|
|
keyboard = {
|
|
|
|
options = [
|
|
|
|
# Swap Caps-Lock and Escape
|
|
|
|
"remove Lock = Caps_Lock"
|
|
|
|
"keysym Caps_Lock = Escape"
|
|
|
|
];
|
|
|
|
};
|
2020-03-05 16:02:23 +01:00
|
|
|
sessionVariables = {
|
2020-03-10 23:08:42 +01:00
|
|
|
BROWSER = "google-chrome";
|
|
|
|
EDITOR = "emacsclient";
|
|
|
|
ALTERNATE_EDITOR = "vim";
|
2020-03-05 16:02:23 +01:00
|
|
|
};
|
|
|
|
stateVersion = "19.09";
|
|
|
|
};
|
2020-03-05 14:18:17 +01:00
|
|
|
|
|
|
|
##############################################################################
|
|
|
|
# Programs
|
|
|
|
##############################################################################
|
|
|
|
|
|
|
|
programs.home-manager = {
|
|
|
|
enable = true;
|
|
|
|
path = builtins.toPath ~/home-manager;
|
|
|
|
};
|
|
|
|
|
2020-03-05 15:06:14 +01:00
|
|
|
programs.git = {
|
|
|
|
enable = true;
|
2020-03-14 00:03:57 +01:00
|
|
|
package = briefcase.utils.wrapNonNixProgram {
|
|
|
|
path = "/usr/bin/git";
|
|
|
|
as = "git";
|
|
|
|
};
|
2020-03-05 15:06:14 +01:00
|
|
|
userName = "William Carroll";
|
|
|
|
userEmail = "wpcarro@gmail.com";
|
|
|
|
aliases = {
|
|
|
|
today = "! git log --date=relative --since=00:00:00 --all --no-merges --oneline --author=\"$(git config --get user.email)\"";
|
|
|
|
yday = "! git log --since=yesterday.midnight --until=today.midnight --oneline --author=\"$(git config --get user.email)\"";
|
|
|
|
changed-files = "! git --no-pager diff --name-only $(current_branch) $(git merge-base $(current_branch) master)";
|
|
|
|
conflicts = "! git --no-pager diff --name-only --diff-filter=U";
|
|
|
|
unstage = "reset HEAD --";
|
|
|
|
};
|
|
|
|
extraConfig = {
|
|
|
|
push.default = "current";
|
|
|
|
rebase = {
|
|
|
|
autosquash = true;
|
|
|
|
autostash = true;
|
|
|
|
};
|
|
|
|
rerere.enabled = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2020-03-05 15:14:03 +01:00
|
|
|
programs.gpg = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
|
|
|
keyserver = "hkp://pgp.mit.edu";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2020-03-05 15:22:32 +01:00
|
|
|
programs.ssh = {
|
|
|
|
enable = true;
|
|
|
|
matchBlocks = {
|
|
|
|
desktop = {
|
|
|
|
user = "wpcarro";
|
|
|
|
hostname = "zeno.lon.corp.google.com";
|
|
|
|
};
|
|
|
|
socrates = {
|
|
|
|
user = "wpcarro";
|
|
|
|
hostname = "84.92.33.141";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2020-03-06 12:19:29 +01:00
|
|
|
programs.fish = {
|
|
|
|
enable = true;
|
|
|
|
shellAliases = {
|
|
|
|
c = "xclip -selection clipboard -i";
|
|
|
|
p = "xclip -selection clipboard -o";
|
2020-03-10 23:04:01 +01:00
|
|
|
cat = "bat --theme='Monokai Extended Light'";
|
2020-03-06 12:19:29 +01:00
|
|
|
rgh = "rg --hidden";
|
|
|
|
fdh = "fd --hidden";
|
|
|
|
tpr = "tput reset";
|
|
|
|
ls = "exa --sort=type";
|
|
|
|
ll = "exa --long --sort=type";
|
|
|
|
la = "exa --long --all --sort=type";
|
|
|
|
gst = "git status";
|
|
|
|
gsh = "git show HEAD";
|
|
|
|
gpf = "git push --force-with-lease";
|
|
|
|
gd = "git diff";
|
|
|
|
};
|
|
|
|
shellAbbrs = {
|
|
|
|
sys = "systemctl";
|
2020-03-10 23:10:04 +01:00
|
|
|
sysst = "systemctl status";
|
2020-03-06 12:19:29 +01:00
|
|
|
sysu = "systemctl --user";
|
2020-03-10 23:10:04 +01:00
|
|
|
sysust = "systemctl --user status";
|
2020-03-06 12:19:29 +01:00
|
|
|
};
|
|
|
|
promptInit = builtins.readFile ../fish/prompt.fish;
|
2020-03-13 13:21:43 +01:00
|
|
|
functions = {
|
|
|
|
ptree = {
|
|
|
|
body = ''
|
|
|
|
for pid in (pgrep $argv[1])
|
|
|
|
pstree -s -p $pid
|
|
|
|
end
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
2020-03-06 12:19:29 +01:00
|
|
|
};
|
|
|
|
|
2020-03-05 16:01:23 +01:00
|
|
|
programs.fzf = rec {
|
2020-03-06 12:19:29 +01:00
|
|
|
enable = true;
|
2020-03-05 16:01:23 +01:00
|
|
|
defaultCommand = "fd --hidden --follow --exclude '.git'";
|
|
|
|
fileWidgetCommand = defaultCommand;
|
2020-03-06 12:19:29 +01:00
|
|
|
enableFishIntegration = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
programs.direnv = {
|
|
|
|
enable = true;
|
|
|
|
enableFishIntegration = true;
|
2020-03-05 16:01:23 +01:00
|
|
|
};
|
|
|
|
|
2020-03-16 14:59:20 +01:00
|
|
|
programs.autorandr = {
|
|
|
|
enable = true;
|
|
|
|
profiles = let
|
|
|
|
# To get these values, I ran `xrandr --props` and searched for
|
|
|
|
# 'EDID:'. While these are long and a bit unsightly, I cannot think of a
|
|
|
|
# desirable workaround, so I'm going to leave them for now.
|
|
|
|
laptop = "00ffffffffffff000daed71400000000151b0104a51f117802ee95a3544c99260f505400000001010101010101010101010101010101363680a0703820402e1e240035ad10000018000000fe004e3134304843452d474e320a20000000fe00434d4e0a202020202020202020000000fe004e3134304843452d474e320a2000e2";
|
|
|
|
hdmi4k = "00ffffffffffff001e6d085b6d4a0400061c0103803c2278ea3035a7554ea3260f50542108007140818081c0a9c0d1c081000101010108e80030f2705a80b0588a0058542100001e04740030f2705a80b0588a0058542100001a000000fd00383d1e873c000a202020202020000000fc004c4720556c7472612048440a200150020330714d902220050403020161605d5e5f230907076d030c001000b83c20006001020367d85dc401788003e30f0003023a801871382d40582c450058542100001a565e00a0a0a029503020350058542100001a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000ad";
|
|
|
|
in {
|
|
|
|
mobile = {
|
|
|
|
fingerprint = {
|
|
|
|
eDP1 = laptop;
|
|
|
|
HDMI1 = hdmi4k;
|
|
|
|
};
|
|
|
|
config = {
|
|
|
|
eDP1 = {
|
|
|
|
enable = true;
|
|
|
|
primary = true;
|
|
|
|
mode = "1920x1080";
|
|
|
|
rate = "59.93";
|
|
|
|
};
|
|
|
|
HDMI1 = {
|
|
|
|
enable = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
docked = {
|
|
|
|
fingerprint = {
|
|
|
|
eDP1 = laptop;
|
|
|
|
HDMI1 = hdmi4k;
|
|
|
|
};
|
|
|
|
config = {
|
|
|
|
eDP1 = {
|
|
|
|
enable = false;
|
|
|
|
};
|
|
|
|
HDMI1 = {
|
|
|
|
enable = true;
|
|
|
|
primary = true;
|
|
|
|
mode = "3840x2160";
|
|
|
|
rate = "30.00";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2020-03-05 14:18:17 +01:00
|
|
|
##############################################################################
|
|
|
|
# Services
|
|
|
|
##############################################################################
|
2020-03-05 15:48:47 +01:00
|
|
|
|
2020-03-11 00:02:30 +01:00
|
|
|
xsession = {
|
|
|
|
enable = true;
|
|
|
|
windowManager.command = "dbus-launch --exit-with-session wpcarros-emacs";
|
|
|
|
};
|
|
|
|
|
2020-03-11 00:01:46 +01:00
|
|
|
# Filter blue light from screen after sunset.
|
|
|
|
services.redshift = {
|
|
|
|
enable = true;
|
|
|
|
latitude = "51.49";
|
|
|
|
longitude = "-0.18";
|
2020-03-14 00:03:57 +01:00
|
|
|
package = briefcase.utils.wrapNonNixProgram {
|
|
|
|
path = "/usr/bin/redshift";
|
|
|
|
as = "redshift";
|
|
|
|
};
|
2020-03-17 19:29:08 +01:00
|
|
|
# Disable the fading animation.
|
|
|
|
extraOptions = [ "-r" ];
|
2020-03-11 00:01:46 +01:00
|
|
|
};
|
|
|
|
|
2020-03-11 00:05:18 +01:00
|
|
|
# Hide the cursor during X sessions after 1 second.
|
|
|
|
services.unclutter.enable = true;
|
|
|
|
|
2020-03-11 00:04:12 +01:00
|
|
|
# Support mouseless workflows.
|
|
|
|
services.keynav.enable = true;
|
|
|
|
|
2020-03-05 15:48:47 +01:00
|
|
|
services.lorri.enable = true;
|
2020-03-05 16:05:21 +01:00
|
|
|
|
|
|
|
services.gpg-agent = {
|
|
|
|
enable = true;
|
2020-03-13 13:21:01 +01:00
|
|
|
defaultCacheTtl = 8 * 60 * 60; # 8 hours
|
|
|
|
maxCacheTtl = 8 * 60 * 60;
|
2020-03-05 16:05:21 +01:00
|
|
|
};
|
2020-03-05 14:18:17 +01:00
|
|
|
}
|