{ config, lib, pkgs, inputs, ... }:
{
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
imports = [
./packages.nix
./unstable.nix
./home-minimal.nix
];
home.sessionVariables = {
MOZ_ENABLE_WAYLAND = 1;
_JAVA_AWT_WM_NONREPARENTING = 1;
};
xdg.mimeApps = {
enable = true;
associations.added."application/pdf" = [ "org.pwmt.zathura.desktop" ];
defaultApplications."application/pdf" = [ "org.pwmt.zathura.desktop" ];
};
programs.msmtp.enable = true;
programs.mbsync.enable = true;
programs.mu.enable = true;
accounts.email = {
accounts.hacc = {
address = "stuebinm@hacc.space";
imap.host = "mail.hacc.space";
mbsync = {
enable = true;
create = "maildir";
};
msmtp.enable = true;
mu.enable = true;
primary = true;
realName = "stuebinm";
smtp.host = "mail.hacc.space";
userName = "stuebinm@hacc.space";
passwordCommand = "secret-tool lookup mail hacc";
};
accounts.disroot = {
address = "stuebinm@disroot.org";
imap.host = "disroot.org";
mbsync = {
enable = true;
create = "maildir";
};
msmtp.enable = true;
mu.enable = true;
realName = "terru";
smtp.host = "disroot.org";
userName = "stuebinm@disroot.org";
passwordCommand = "secret-tool lookup mail disroot";
};
accounts.tum = {
address = "stuebinm@in.tum.de";
imap.host = "mail.in.tum.de";
mbsync = {
enable = true;
create = "maildir";
};
msmtp.enable = true;
mu.enable = true;
realName = "stuebinm";
smtp.host = "mail.in.tum.de";
userName = "stuebinm@in.tum.de";
passwordCommand = "secret-tool lookup mail in.tum.de";
};
accounts.ilztalbahn = {
address = "stuebinm@ilztalbahn.eu";
imap.host = "imap.strato.de";
mbsync = {
enable = true;
create = "maildir";
};
msmtp.enable = true;
mu.enable = true;
realName = "terru";
smtp.host = "smtp.strato.de";
userName = "stuebinm@ilztalbahn.eu";
passwordCommand = "secret-tool lookup mail ilztalbahn";
};
};
programs.bash = {
shellAliases = {
"lrz-vpn" = "sudo openconnect https://asa-cluster.lrz.de -g AnyConnect";
news = "newsboat";
pj = "pijul";
};
};
programs.fish = {
shellAliases = {
"lrz-vpn" = "sudo openconnect https://asa-cluster.lrz.de";
news = "newsboat";
pj = "pijul";
agenda = "CLICOLOR_FORCE=1 almanac month ~/.cache/feedsync/* | less";
xmlpretty = "xmllint --format - | bat -l xml";
wormhole = "wormhole-rs";
};
functions.fetchpdf.body = ''
set url $argv[1]
if test "$url" = ""
echo "No url given"
return
end
set choice (curl -L $url | rg -e ']*href="([^"]*\.pdf)"[^>]*>([^<]*)' -o | sed 's/]*href="\([^"]*\)"[^>]*>\(.*\)<\/a>/"\1" "\2"/g' | fzf)
if test "$status" != 0
return
end
set docurl (echo $choice | sed 's/"\(.*\)" ".*"/\1/g')
set docname (echo $choice | sed 's/".*" "\(.*\)"/\1/g')
echo Fetching $docname from $docurl
curl "$docurl" > ~/Downloads/news/"$docname".pdf
zathura ~/Downloads/news/"$docname".pdf
if test (read -P "move this file to archive? [y/N] ") = "y"
set filename (read -P "filename? [$docname] ")
if test "$filename" = ""
cp ~/Downloads/news/"$docname".pdf ~/archive/"$docname".pdf
else
cp ~/Downloads/news/"$docname".pdf ~/archive/$filename
end
end
'';
functions.nix-what.body = ''
nix-doc search $argv[1] ~/clones/nixpkgs
'';
};
programs.kitty = {
enable = true;
extraConfig = ''
background_opacity 0.8
confirm_os_window_close 0
allow_remote_control yes
'';
};
programs.neovim = {
enable = true;
viAlias = true;
plugins = with pkgs; [
(vimPlugins.nvim-treesitter.withPlugins
(plugins: [ tree-sitter-grammars.tree-sitter-nix ]))
];
generatedConfigViml = ''
lua < /dev/null" ; open-in-browser ; set browser "${config.programs.newsboat.browser} %u"
macro f set browser "${pkgs.xdg_utils}/bin/xdg-open %u >/dev/null 2>&1 &" ; open-in-browser ; set browser "${config.programs.newsboat.browser} %u"
macro d set browser "kitty @launch --type tab fish -c 'fetchpdf %u'" ; open-in-browser ; set browser "${config.programs.newsboat.browser} %u"
bind-key j down
bind-key k up
'';
};
programs.obs-studio = {
enable = true;
plugins = let
move-transition = import obs/move-transition.nix;
obs-websocket = import obs/obs-websocket.nix;
in
with pkgs; [
];
};
programs.gpg = {
enable = true;
settings = {
auto-key-locate = "keyserver";
with-fingerprint = "";
};
};
services.gpg-agent = {
enable = true;
pinentryFlavor = "gtk2";
maxCacheTtl = 1800;
};
programs.ssh = {
forwardAgent = true;
enable = true;
matchBlocks = let
keydir = config.home.homeDirectory + "/.ssh";
hetznerlogin = match: {user = "root"; identityFile = keydir + "/hetzner"; forwardAgent = true;} // match;
vpslogin = hostname: hetznerlogin {inherit hostname;};
lmulogin = hostname: {identityFile = keydir + "/key_lmu"; user = "lmu-user"; } // { inherit hostname;};
in {
"parsons" = hetznerlogin {
hostname = "parsons.hacc.space";
port = 62954;
user = "stuebinm";
identityFile = keydir + "/id_rsa";
};
"flora" = vpslogin "flora.stuebinm.eu";
"chaski" = vpslogin "chaski.stuebinm.eu";
"cgit" = vpslogin "flora.stuebinm.eu" // {user = "git";};
"mate" = {
hostname = "192.168.69.174";
user = "root";
identityFile = keydir + "/hetzner";
};
"c3voc" = {
hostname = "git.c3voc.de";
user = "git";
identityFile = keydir + "/id_ed25519";
};
"nobelium" = {
hostname = "no.colorspace.club";
user = "root";
identityFile = keydir + "/id_ed25519";
};
"colorspace-git" = {
hostname = "no.colorspace.club";
user = "git";
identityFile = keydir + "/id_ed25519";
};
};
};
programs.mpv = {
enable = true;
bindings = {
"up" = "add speed 0.1";
"down" = "add speed -0.1";
"n" = "add chapter 1";
"p" = "add chapter -1";
};
};
programs.mako = {
enable = true;
backgroundColor = "#ff00ff80";
borderColor = "#ff00ff";
defaultTimeout = 5000; # milliseconds
padding = "10";
output = "DVI-I-1";
};
services.mpd = {
enable = true;
musicDirectory = "${config.home.homeDirectory}/music";
network.startWhenNeeded = true;
};
}