345 lines
7.4 KiB
Nix
345 lines
7.4 KiB
Nix
{ lib, config, options, pkgs, ... }:
|
|
let
|
|
thefuck-alias = shell:
|
|
pkgs.runCommand "thefuck-alias" {
|
|
TF_SHELL = shell;
|
|
HOME = "/build";
|
|
} "${pkgs.thefuck}/bin/thefuck -a > $out";
|
|
headphones = "88:C9:E8:AD:73:E8";
|
|
emacsPackages = pkgs.emacsPackagesFor config.programs.emacs.package;
|
|
in {
|
|
imports = [ ./desktop.nix ./emacs.nix ./email.nix ];
|
|
programs = {
|
|
nix-index.enable = true;
|
|
# todo: .aws/config default region
|
|
gh = {
|
|
enable = true;
|
|
settings.aliases.co = "pr checkout";
|
|
settings.git_protocol = "ssh";
|
|
};
|
|
direnv.enable = true;
|
|
direnv.nix-direnv.enable = true;
|
|
home-manager.enable = true;
|
|
git = {
|
|
#lfs.enable = true;
|
|
enable = true;
|
|
userName = "Yorick van Pelt";
|
|
userEmail = "yorick@yorickvanpelt.nl";
|
|
signing.key = "A36E70F9DC014A15";
|
|
signing.signByDefault = true;
|
|
extraConfig.merge.conflictStyle = "diff3";
|
|
extraConfig.help.autocorrect = 5;
|
|
extraConfig.push.default = "simple";
|
|
extraConfig.pull.ff = "only";
|
|
extraConfig.hub.protocol = "ssh";
|
|
extraConfig.github.user = "yorickvP";
|
|
ignores = [
|
|
"/.envrc"
|
|
"/.cache"
|
|
"/.direnv"
|
|
];
|
|
aliases = {
|
|
lg =
|
|
"log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative";
|
|
st = "status";
|
|
remotes = "remote -v";
|
|
branches = "branch -a";
|
|
tags = "tag";
|
|
stashes = "stash list";
|
|
unstage = "reset -q HEAD --";
|
|
discard = "checkout --";
|
|
uncommit = "reset --mixed HEAD~";
|
|
graph =
|
|
"log --graph -10 --branches --remotes --tags --format=format:'%Cgreen%h %Creset• %<(75,trunc)%s (%cN, %cr) %Cred%d' --date-order ";
|
|
dad = "!curl https://icanhazdadjoke.com/ && git add";
|
|
};
|
|
};
|
|
|
|
ssh = {
|
|
enable = true;
|
|
compression = true;
|
|
serverAliveInterval = 120;
|
|
controlMaster = "auto";
|
|
matchBlocks = {
|
|
"pub.yori.cc" = {
|
|
user = "public";
|
|
identityFile = "~/.ssh/id_rsa_pub";
|
|
identitiesOnly = true;
|
|
};
|
|
phassa = {
|
|
hostname = "karpenoktem.nl";
|
|
port = 33933;
|
|
};
|
|
"karpenoktem.nl" = { user = "root"; };
|
|
sankhara = {
|
|
user = "infra";
|
|
port = 33931;
|
|
hostname = "sankhara.karpenoktem.nl";
|
|
};
|
|
blackadder.hostname = "10.209.0.6";
|
|
frumar.hostname = "frumar.local";
|
|
pennyworth.hostname = "pennyworth.yori.cc";
|
|
smithers.hostname = "10.209.0.8";
|
|
replicate.hostname = "216.153.63.208";
|
|
# "192.168.178.*" = {
|
|
# only if wired
|
|
# extraOptions.Compression = "no";
|
|
# };
|
|
};
|
|
extraConfig = ''
|
|
Match host "192.168.*.*" exec "ip route get %h | grep -v -q via"
|
|
Compression no
|
|
'';
|
|
};
|
|
fish = {
|
|
enable = true;
|
|
shellAliases = {
|
|
l = "ls";
|
|
ls = "eza";
|
|
nr = ''nix repl --file "/home/yorick/dotfiles/repl.nix"'';
|
|
"n." = "nix repl --file .";
|
|
nsd = "nix show-derivation";
|
|
nb = "nix build";
|
|
nl = "nix log";
|
|
g = "git";
|
|
bc = "bluetoothctl connect ${headphones}";
|
|
bd = "bluetoothctl disconnect ${headphones}";
|
|
bw-personal = "BITWARDENCLI_APPDATA_DIR=~/.config/Bitwarden\\ CLI\\ Personal bw";
|
|
bw-work = "BITWARDENCLI_APPDATA_DIR=~/.config/Bitwarden\\ CLI\\ Work bw";
|
|
};
|
|
interactiveShellInit = let
|
|
inherit (emacsPackages) vterm;
|
|
vtermPath = "${vterm}/share/emacs/site-lisp/elpa/${vterm.pname}-${vterm.version}/etc/emacs-vterm.fish";
|
|
in ''
|
|
set fish_greeting
|
|
source ${thefuck-alias "fish"}
|
|
source ~/dotfiles/nr.fish
|
|
source ${vtermPath}
|
|
function tmp --description 'cd to ~/tmp/YYYY-MM-DD, creating it if needed'
|
|
set dated_tmp $HOME"/tmp/"(date +%Y-%m-%d)
|
|
mkdir -p $dated_tmp
|
|
cd $dated_tmp
|
|
end
|
|
|
|
'';
|
|
plugins = [
|
|
{ inherit (pkgs.fishPlugins.tide) name src; }
|
|
];
|
|
};
|
|
bash = {
|
|
enable = true;
|
|
historyControl = [ "erasedups" "ignoredups" "ignorespace" ];
|
|
shellAliases = {
|
|
nr = ''nix repl "/home/yorick/dotfiles/repl.nix"'';
|
|
nsp = "nix-shell -p";
|
|
};
|
|
initExtra = ''
|
|
source ${thefuck-alias "bash"}
|
|
if [ "$IN_CACHED_NIX_SHELL" ]; then
|
|
eval "$shellHook"
|
|
unset shellHook
|
|
fi
|
|
'';
|
|
};
|
|
};
|
|
xdg.configFile."nixpkgs/config.nix".text = ''
|
|
builtins.trace "tried to read nixpkgs/config.nix" {}
|
|
'';
|
|
xdg.configFile."nixpkgs/overlays.nix".text = ''
|
|
builtins.trace "tried to read nixpkgs/overlays.nix" []
|
|
'';
|
|
xdg.configFile."streamlink/config".text = ''
|
|
player = mpv --cache 2048
|
|
default-stream = best
|
|
'';
|
|
programs.mpv = {
|
|
enable = true;
|
|
scripts = [ pkgs.mpvScripts.mpris ];
|
|
};
|
|
services.gpg-agent = {
|
|
enable = true;
|
|
enableSshSupport = true;
|
|
enableExtraSocket = true;
|
|
};
|
|
services.playerctld.enable = true;
|
|
home.packages = (with pkgs; [
|
|
## utils
|
|
afew # mail
|
|
fd
|
|
gcr.out
|
|
git-absorb
|
|
github-cli
|
|
lieer
|
|
htop
|
|
kcachegrind
|
|
lm_sensors
|
|
notmuch
|
|
watchman
|
|
nix-output-monitor
|
|
appimage-run
|
|
ripgrep
|
|
zip
|
|
|
|
## misc
|
|
moreutils
|
|
atop
|
|
awscli
|
|
borgbackup
|
|
bup
|
|
# catdoc
|
|
trurl
|
|
expect
|
|
fzf
|
|
fx
|
|
gitAndTools.git-annex
|
|
glxinfo
|
|
gnupg1
|
|
imagemagick
|
|
iodine
|
|
jo
|
|
jless
|
|
jq
|
|
lnav
|
|
magic-wormhole
|
|
man-pages
|
|
mosh
|
|
neofetch
|
|
openssl
|
|
pass
|
|
pv
|
|
screen
|
|
sshfs-fuse
|
|
sshuttle
|
|
thefuck
|
|
wakelan
|
|
tty-clock
|
|
|
|
## media
|
|
aria2
|
|
castnow
|
|
nodePackages.peerflix
|
|
streamlink
|
|
yt-dlp
|
|
ffmpeg
|
|
transmission-remote-gtk
|
|
|
|
## code
|
|
cloc
|
|
gcc
|
|
gdb
|
|
git-crypt
|
|
git-fire
|
|
gnumake
|
|
hub
|
|
python3
|
|
silver-searcher
|
|
sqlite
|
|
noulith
|
|
|
|
## nix
|
|
nix-tree
|
|
niv
|
|
nixfmt-rfc-style
|
|
patchelf
|
|
nix-prefetch-git
|
|
nix-du
|
|
nix-top
|
|
nix-diff
|
|
cachix
|
|
cached-nix-shell
|
|
|
|
## js
|
|
nodejs
|
|
electron
|
|
|
|
## pdf
|
|
ocamlPackages.cpdf
|
|
zathura
|
|
pandoc
|
|
poppler_utils
|
|
|
|
## misc
|
|
asciinema
|
|
cargo
|
|
eza
|
|
linuxPackages.perf
|
|
ltrace
|
|
lz4json
|
|
pssh
|
|
smartmontools
|
|
unzip
|
|
vim
|
|
xdg-utils
|
|
countfftabs
|
|
datasette
|
|
spacer
|
|
#wlrctl
|
|
asciiquarium-transparent
|
|
|
|
## coins
|
|
electrum
|
|
ledger-live-desktop
|
|
|
|
## apps
|
|
alacritty
|
|
calibre
|
|
chromium
|
|
discord
|
|
wayland-push-to-talk-fix
|
|
fanficfare
|
|
feh
|
|
gimp
|
|
gopass
|
|
hledger
|
|
spotify
|
|
tdesktop
|
|
signal-desktop
|
|
virt-manager
|
|
wireshark
|
|
inkscape
|
|
bitwarden-cli
|
|
# notion-desktop
|
|
#yubioath-flutter
|
|
gnucash
|
|
|
|
## games
|
|
prismlauncher
|
|
steam
|
|
# minecraft
|
|
# nottetris2
|
|
# openttd
|
|
# wine
|
|
# winetricks
|
|
kmines
|
|
|
|
# work
|
|
timesync
|
|
r8-cog
|
|
mutagen
|
|
zoom-us
|
|
llm
|
|
google-cloud-sdk
|
|
kubectl
|
|
uv
|
|
ruff
|
|
oathToolkit
|
|
|
|
# admin
|
|
nsc
|
|
natscli
|
|
]);
|
|
|
|
home.file.".gnupg/gpg.conf".text = ''
|
|
no-greeting
|
|
require-cross-certification
|
|
charset utf-8
|
|
keyserver hkps://keys.openpgp.org
|
|
#keyserver-options auto-key-retrieve
|
|
'';
|
|
home.sessionVariables = {
|
|
FLAKE_CONFIG_URI = "/home/yorick/dotfiles#homeConfigurations.${pkgs.stdenv.system}.activationPackage";
|
|
};
|
|
# enabled by fish, slow
|
|
programs.man.generateCaches = false;
|
|
}
|