dotfiles/home-manager/home.nix

310 lines
6.4 KiB
Nix
Raw Normal View History

2021-05-29 17:58:13 +02:00
{ lib, config, options, pkgs, ... }:
2021-05-23 17:31:52 +02:00
let
2022-04-11 15:27:39 +02:00
thefuck-alias = shell:
pkgs.runCommand "thefuck-alias" {
TF_SHELL = shell;
HOME = "/build";
} "${pkgs.thefuck}/bin/thefuck -a > $out";
2023-01-18 18:03:30 +01:00
headphones = "88:C9:E8:AD:73:E8";
2021-05-29 18:05:31 +02:00
in {
2023-05-20 13:39:59 +02:00
imports = [ ./desktop.nix ./emacs.nix ./lumi.nix ./email.nix ];
2018-04-07 20:04:20 +02:00
programs = {
2022-05-15 15:39:25 +02:00
nix-index.enable = true;
2021-06-06 15:57:47 +02:00
# todo: .aws/config default region
2021-05-23 17:31:52 +02:00
gh = {
enable = true;
2021-11-15 13:34:51 +01:00
settings.aliases.co = "pr checkout";
2021-05-23 17:31:52 +02:00
};
direnv.enable = true;
2022-07-06 09:25:58 +02:00
direnv.nix-direnv.enable = true;
2022-05-15 14:35:03 +02:00
home-manager.enable = true;
2018-04-07 20:04:20 +02:00
git = {
2022-01-13 20:36:50 +01:00
#lfs.enable = true;
2018-04-07 20:04:20 +02:00
enable = true;
userName = "Yorick van Pelt";
userEmail = "yorick@yorickvanpelt.nl";
signing.key = "A36E70F9DC014A15";
2021-05-23 17:31:52 +02:00
signing.signByDefault = true;
extraConfig.merge.conflictStyle = "diff3";
2018-04-07 20:04:20 +02:00
extraConfig.help.autocorrect = 5;
extraConfig.push.default = "simple";
2021-05-23 17:31:52 +02:00
extraConfig.pull.ff = "only";
2023-09-24 22:26:24 +02:00
extraConfig.hub.protocol = "ssh";
ignores = [
"/.envrc"
"/.cache"
"/.direnv"
];
2018-04-07 20:04:20 +02:00
aliases = {
2021-05-29 18:05:31 +02:00
lg =
"log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative";
2018-04-07 20:04:20 +02:00
st = "status";
remotes = "remote -v";
branches = "branch -a";
tags = "tag";
stashes = "stash list";
unstage = "reset -q HEAD --";
discard = "checkout --";
uncommit = "reset --mixed HEAD~";
2021-05-29 18:05:31 +02:00
graph =
"log --graph -10 --branches --remotes --tags --format=format:'%Cgreen%h %Creset %<(75,trunc)%s (%cN, %cr) %Cred%d' --date-order ";
2018-04-07 20:04:20 +02:00
dad = "!curl https://icanhazdadjoke.com/ && git add";
};
};
2018-04-07 20:20:22 +02:00
ssh = {
enable = true;
compression = true;
serverAliveInterval = 120;
controlMaster = "auto";
matchBlocks = {
2018-04-07 20:20:22 +02:00
"pub.yori.cc" = {
user = "public";
identityFile = "~/.ssh/id_rsa_pub";
identitiesOnly = true;
};
2021-05-29 18:05:31 +02:00
phassa = {
hostname = "karpenoktem.nl";
port = 33933;
};
2022-04-11 15:27:39 +02:00
"karpenoktem.nl" = { user = "root"; };
2022-03-20 15:27:00 +01:00
sankhara = {
user = "infra";
port = 33931;
hostname = "sankhara.karpenoktem.nl";
};
2022-04-11 11:45:58 +02:00
blackadder.hostname = "10.209.0.6";
frumar.hostname = "frumar.local";
pennyworth.hostname = "pennyworth.yori.cc";
smithers.hostname = "10.209.0.8";
2023-09-23 15:55:23 +02:00
replicate.hostname = "216.153.63.208";
2021-05-23 17:31:52 +02:00
# "192.168.178.*" = {
2021-05-29 18:32:09 +02:00
# only if wired
2021-05-23 17:31:52 +02:00
# 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";
2023-12-20 13:32:18 +01:00
ls = "eza";
2022-09-15 10:14:50 +02:00
nr = ''nix repl --file "/home/yorick/dotfiles/repl.nix"'';
"n." = "nix repl --file .";
2022-04-11 13:37:52 +02:00
nsd = "nix show-derivation";
nb = "nix build";
nl = "nix log";
g = "git";
2023-01-18 18:03:30 +01:00
bc = "bluetoothctl connect ${headphones}";
bd = "bluetoothctl disconnect ${headphones}";
2018-04-07 20:20:22 +02:00
};
2021-05-23 17:31:52 +02:00
interactiveShellInit = ''
2021-11-15 13:34:51 +01:00
set fish_greeting
2021-05-29 18:32:09 +02:00
source ${thefuck-alias "fish"}
2021-05-29 18:05:31 +02:00
source ~/dotfiles/nr.fish
2021-05-23 17:31:52 +02:00
'';
2023-05-20 13:39:59 +02:00
plugins = [
{ inherit (pkgs.fishPlugins.tide) name src; }
];
2018-04-07 20:20:22 +02:00
};
2018-04-07 20:27:44 +02:00
bash = {
enable = true;
historyControl = [ "erasedups" "ignoredups" "ignorespace" ];
shellAliases = {
2022-05-15 15:39:25 +02:00
nr = ''nix repl "/home/yorick/dotfiles/repl.nix"'';
2018-04-07 20:27:44 +02:00
nsp = "nix-shell -p";
};
2021-05-23 17:31:52 +02:00
initExtra = ''
2021-05-30 11:20:35 +02:00
source ${thefuck-alias "bash"}
2021-05-29 18:32:09 +02:00
eval "$(broot --print-shell-function bash)"
2021-06-06 18:15:35 +02:00
if [ "$IN_CACHED_NIX_SHELL" ]; then
2022-04-11 15:27:39 +02:00
eval "$shellHook"
unset shellHook
2021-06-06 18:15:35 +02:00
fi
2021-05-29 18:32:09 +02:00
'';
2018-04-07 20:27:44 +02:00
};
2018-04-07 20:04:20 +02:00
};
2021-05-30 12:55:27 +02:00
xdg.configFile."nixpkgs/config.nix".text = ''
2022-06-01 09:43:09 +02:00
builtins.trace "tried to read nixpkgs/config.nix" {}
2021-05-30 12:55:27 +02:00
'';
xdg.configFile."nixpkgs/overlays.nix".text = ''
2022-06-01 09:43:09 +02:00
builtins.trace "tried to read nixpkgs/overlays.nix" []
2021-05-30 12:55:27 +02:00
'';
2018-04-07 20:20:22 +02:00
xdg.configFile."streamlink/config".text = ''
player = mpv --cache 2048
default-stream = best
'';
2022-04-13 10:19:22 +02:00
programs.mpv = {
enable = true;
scripts = [ pkgs.mpvScripts.mpris ];
};
2022-04-12 19:26:08 +02:00
services.gpg-agent = {
enable = true;
enableSshSupport = true;
2021-05-23 17:31:52 +02:00
};
2022-04-13 10:19:22 +02:00
services.playerctld.enable = true;
2022-04-11 15:27:39 +02:00
home.packages = (with pkgs; [
## utils
afew # mail
2022-04-11 15:27:39 +02:00
broot
fd
gcr.out
git-absorb
github-cli
2022-10-04 10:15:29 +02:00
lieer
2022-04-11 15:27:39 +02:00
htop
kcachegrind
lm_sensors
notmuch
watchman
2022-09-15 10:14:50 +02:00
nix-output-monitor
2022-04-11 15:27:39 +02:00
## misc
2022-04-19 07:49:05 +02:00
moreutils
2022-04-11 15:27:39 +02:00
atop
awscli
borgbackup
bup
# catdoc
2023-05-20 13:39:59 +02:00
trurl
2022-04-11 15:27:39 +02:00
expect
fzf
2022-06-01 09:42:51 +02:00
fx
2022-04-11 15:27:39 +02:00
gitAndTools.git-annex
glxinfo
gnupg1
imagemagick
iodine
jo
2023-01-18 18:03:59 +01:00
jless
2022-04-11 15:27:39 +02:00
jq
lnav
magic-wormhole
man-pages
mosh
neofetch
openssl
pass
pv
screen
sshfs-fuse
sshuttle
thefuck
wakelan
## media
aria2
castnow
nodePackages.peerflix
streamlink
yt-dlp
## code
cloc
gcc
gdb
git-crypt
git-fire
gnumake
hub
python3
silver-searcher
sqlite
2023-12-28 13:41:27 +01:00
noulith
2022-04-11 15:27:39 +02:00
## nix
nix-tree
niv
nixfmt
patchelf
nix-prefetch-git
nix-du
nix-top
nix-diff
2024-03-10 13:43:08 +01:00
#cachix
2022-04-11 15:27:39 +02:00
cached-nix-shell
## js
nodejs
electron
## pdf
ocamlPackages.cpdf
zathura
pandoc
poppler_utils
## misc
asciinema
cargo
2023-12-20 13:32:18 +01:00
eza
2022-04-11 15:27:39 +02:00
linuxPackages.perf
ltrace
2022-07-06 09:25:58 +02:00
lz4json
2022-04-11 15:27:39 +02:00
pssh
smartmontools
unzip
vim
2022-10-04 10:15:29 +02:00
xdg-utils
2023-04-03 15:51:22 +02:00
countfftabs
2022-04-11 15:27:39 +02:00
#wlrctl
## coins
electrum
## apps
alacritty
2022-05-04 12:23:27 +02:00
calibre
2022-04-11 15:27:39 +02:00
chromium
discord
2023-03-22 11:35:37 +01:00
wayland-push-to-talk-fix
2022-04-11 15:27:39 +02:00
fanficfare
feh
gimp
gopass
hledger
spotify
tdesktop
2023-04-03 15:51:22 +02:00
signal-desktop
2022-04-11 15:27:39 +02:00
virt-manager
wireshark
2023-09-18 10:57:35 +02:00
notion-desktop
2023-04-03 15:51:22 +02:00
#yubioath-flutter
2022-04-11 15:27:39 +02:00
## games
2023-01-18 18:03:59 +01:00
prismlauncher
2022-04-11 15:27:39 +02:00
steam
# minecraft
# nottetris2
# openttd
# wine
# winetricks
2023-05-01 14:35:39 +02:00
# work
timesync
2023-09-23 15:53:36 +02:00
r8-cog
2023-10-18 09:56:46 +02:00
mutagen
zoom-us
2024-03-15 10:01:03 +01:00
llm
2023-05-01 14:35:39 +02:00
2024-01-02 11:44:43 +01:00
# admin
nsc
natscli
2022-04-11 15:27:39 +02:00
]);
2021-05-23 17:31:52 +02:00
home.file.".gnupg/gpg.conf".text = ''
no-greeting
require-cross-certification
charset utf-8
keyserver hkps://keys.openpgp.org
#keyserver-options auto-key-retrieve
'';
2021-05-30 11:47:17 +02:00
home.sessionVariables = {
2022-05-15 15:39:25 +02:00
FLAKE_CONFIG_URI = "/home/yorick/dotfiles#homeConfigurations.${pkgs.stdenv.system}.activationPackage";
2021-05-30 11:47:17 +02:00
};
2018-04-07 20:04:20 +02:00
}