2023-12-25 03:40:33 +07:00
|
|
|
{ config
|
|
|
|
, pkgs
|
|
|
|
, lib
|
|
|
|
, inputs
|
|
|
|
, ...
|
|
|
|
}:
|
|
|
|
|
2023-01-24 02:24:40 +07:00
|
|
|
{
|
2023-02-19 19:09:38 +07:00
|
|
|
imports = [
|
|
|
|
./options.nix
|
|
|
|
./zsh.nix
|
|
|
|
./fish.nix
|
|
|
|
];
|
2023-01-24 02:24:40 +07:00
|
|
|
manual.json.enable = true;
|
|
|
|
services.gpg-agent = {
|
|
|
|
enable = true;
|
|
|
|
enableSshSupport = true;
|
|
|
|
maxCacheTtl = 72000;
|
|
|
|
maxCacheTtlSsh = 72000;
|
|
|
|
};
|
2023-02-19 19:09:38 +07:00
|
|
|
home.shellAliases = {
|
|
|
|
s = "sudo -A";
|
|
|
|
se = "sudo -AE";
|
|
|
|
l = "lsd";
|
2023-09-13 17:20:18 +07:00
|
|
|
la = "lsd -A";
|
|
|
|
ll = "lsd -l";
|
2023-07-21 01:51:34 +07:00
|
|
|
g = "git";
|
|
|
|
gp = "git push";
|
|
|
|
gr = "git rebase";
|
|
|
|
gri = "git rebase -i";
|
2023-12-22 19:22:17 +07:00
|
|
|
grc = "git rebase --continue";
|
2023-07-21 01:51:34 +07:00
|
|
|
gc = "git commit";
|
|
|
|
gca = "git commit --amend";
|
|
|
|
gm = "git merge";
|
2023-02-19 19:09:38 +07:00
|
|
|
};
|
2023-01-24 02:24:40 +07:00
|
|
|
|
|
|
|
programs = {
|
2023-01-26 03:41:45 +07:00
|
|
|
atuin = {
|
|
|
|
enable = true;
|
2023-08-04 08:30:16 +07:00
|
|
|
enableFishIntegration = false;
|
2023-01-26 03:41:45 +07:00
|
|
|
settings = {
|
|
|
|
update_check = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
nnn = let pluginSrc = "${pkgs.nnn.src}/plugins"; in {
|
|
|
|
enable = true;
|
2023-12-22 19:22:17 +07:00
|
|
|
package = (pkgs.nnn.override { withNerdIcons = true; }).overrideAttrs (oldAttrs: {
|
2023-01-26 03:41:45 +07:00
|
|
|
# no need to add makeWrapper to nativeBuildInputs as home-manager does it already
|
|
|
|
postInstall =
|
|
|
|
let nnnArchiveRegex = "\\.(${lib.strings.concatStringsSep "|" [
|
|
|
|
"7z" "a" "ace" "alz" "arc" "arj" "bz" "bz2" "cab" "cpio" "deb" "gz" "jar" "lha" "lz" "lzh" "lzma" "lzo" "rar" "rpm" "rz" "t7z" "tar" "tbz" "tbz2" "tgz" "tlz" "txz" "tZ" "tzo" "war" "xpi" "xz" "Z" "zip"
|
2023-12-22 19:22:17 +07:00
|
|
|
]})$"; in ''
|
|
|
|
wrapProgram $out/bin/nnn ${lib.escapeShellArgs [
|
|
|
|
"--set" "GUI" "1"
|
|
|
|
"--set" "NNN_OPENER" "${pluginSrc}/nuke"
|
|
|
|
"--set" "NNN_ARCHIVE" nnnArchiveRegex
|
2023-01-26 03:41:45 +07:00
|
|
|
# -a: auto create fifo file
|
|
|
|
# -c: use NNN_OPENER
|
|
|
|
# -x: x server features
|
2023-12-22 19:22:17 +07:00
|
|
|
"--add-flags" "-a -c -x"
|
|
|
|
]}
|
2023-01-26 03:41:45 +07:00
|
|
|
'';
|
|
|
|
});
|
|
|
|
extraPackages = with pkgs; [
|
|
|
|
# utils
|
2023-06-20 15:11:01 +07:00
|
|
|
gnused mktemp fzf coreutils-full findutils xdg-utils gnupg whois curl
|
2023-01-26 03:41:45 +07:00
|
|
|
file mediainfo unzip gnutar man rclone sshfs trash-cli
|
|
|
|
# for preview
|
2023-09-13 17:20:18 +07:00
|
|
|
# exa - TODO: replace with eza wrapper?
|
|
|
|
bat
|
2023-03-07 18:20:08 +07:00
|
|
|
libarchive atool
|
2023-01-26 03:41:45 +07:00
|
|
|
glow w3m
|
|
|
|
# for opening
|
2023-04-06 21:00:49 +07:00
|
|
|
p7zip unrar-wrapper odt2txt
|
|
|
|
];
|
2023-01-26 03:41:45 +07:00
|
|
|
plugins = {
|
|
|
|
src = pluginSrc;
|
|
|
|
mappings = {
|
|
|
|
p = "-preview-tui";
|
|
|
|
P = "fzplug";
|
|
|
|
D = "dragdrop";
|
|
|
|
c = "-chksum";
|
|
|
|
d = "-diffs";
|
|
|
|
f = "fzopen";
|
|
|
|
s = "suedit";
|
|
|
|
x = "togglex";
|
|
|
|
u = "umounttree";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2023-01-24 02:24:40 +07:00
|
|
|
home-manager.enable = true;
|
2023-01-26 03:41:45 +07:00
|
|
|
# i only use this as a login shell
|
2023-01-24 02:24:40 +07:00
|
|
|
bash = {
|
|
|
|
enable = true;
|
2023-01-26 04:35:21 +07:00
|
|
|
initExtra = ''
|
|
|
|
bind -x '"\C-r": __atuin_history'
|
|
|
|
export ATUIN_NOBIND=true
|
|
|
|
'';
|
2023-01-24 02:24:40 +07:00
|
|
|
};
|
|
|
|
git = {
|
|
|
|
enable = true;
|
|
|
|
package = pkgs.gitAndTools.gitFull;
|
|
|
|
delta.enable = true;
|
2023-01-26 03:41:45 +07:00
|
|
|
extraConfig = {
|
2023-10-26 06:49:55 +07:00
|
|
|
commit.gpgsign = true;
|
2023-07-21 01:51:34 +07:00
|
|
|
# disable the atrocious gui password prompt
|
2023-01-26 03:41:45 +07:00
|
|
|
core.askPass = "";
|
2023-07-21 01:51:34 +07:00
|
|
|
# ...and prefer getting passwords from libsecret (and storing them there)
|
2023-01-26 03:41:45 +07:00
|
|
|
credential.helper = "${pkgs.gitAndTools.gitFull}/bin/git-credential-libsecret";
|
2023-04-22 07:15:07 +07:00
|
|
|
init.defaultBranch = "master";
|
2023-10-26 02:01:59 +07:00
|
|
|
# no need for git pust -u origin <branch>
|
|
|
|
push.autoSetupRemote = true;
|
|
|
|
# allow different upstream branch name
|
|
|
|
push.default = "upstream";
|
2023-01-26 03:41:45 +07:00
|
|
|
};
|
2023-06-20 15:11:01 +07:00
|
|
|
lfs.enable = true;
|
2023-01-24 02:24:40 +07:00
|
|
|
};
|
2023-01-27 04:05:30 +07:00
|
|
|
bat = {
|
|
|
|
enable = true;
|
|
|
|
};
|
2023-02-11 23:30:19 +07:00
|
|
|
bottom = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
|
|
|
flags.network_use_bytes = true;
|
|
|
|
flags.enable_gpu_memory = true;
|
|
|
|
};
|
|
|
|
};
|
2023-01-27 04:05:30 +07:00
|
|
|
lsd = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
|
|
|
date = "+%Y-%m-%d %H:%M:%S";
|
|
|
|
permission = "octal";
|
|
|
|
size = "short";
|
|
|
|
};
|
|
|
|
};
|
2023-01-24 02:24:40 +07:00
|
|
|
ssh = {
|
|
|
|
enable = true;
|
|
|
|
compression = true;
|
|
|
|
};
|
|
|
|
tmux = {
|
|
|
|
enable = true;
|
|
|
|
clock24 = true;
|
|
|
|
customPaneNavigationAndResize = true;
|
|
|
|
keyMode = "vi";
|
|
|
|
};
|
|
|
|
gpg = {
|
|
|
|
enable = true;
|
|
|
|
homedir = "${config.xdg.dataHome}/gnupg";
|
|
|
|
mutableKeys = true;
|
|
|
|
mutableTrust = true;
|
|
|
|
};
|
2023-02-20 00:49:39 +07:00
|
|
|
readline = {
|
|
|
|
enable = true;
|
|
|
|
variables.editing-mode = "vi";
|
2023-12-15 06:03:46 +07:00
|
|
|
variables.show-mode-in-prompt = true;
|
2023-02-20 00:49:39 +07:00
|
|
|
};
|
2023-07-21 01:51:34 +07:00
|
|
|
nix-index = {
|
|
|
|
enable = true;
|
|
|
|
# don't add pkgs.nix to PATH
|
|
|
|
# use the nix that's already in PATH
|
|
|
|
# (because I use nix plugins and plugins are nix version-specific)
|
|
|
|
package = pkgs.nix-index-unwrapped;
|
|
|
|
};
|
2023-11-08 11:47:14 +07:00
|
|
|
#neomutt = {
|
|
|
|
# enable = true;
|
|
|
|
# sidebar.enable = true;
|
|
|
|
# vimKeys = true;
|
|
|
|
#};
|
|
|
|
alot = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
|
|
|
handle_mouse = true;
|
|
|
|
initial_command = "search tag:inbox AND NOT tag:killed";
|
|
|
|
prefer_plaintext = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
msmtp.enable = true;
|
|
|
|
notmuch = {
|
|
|
|
enable = true;
|
|
|
|
hooks.preNew = ''
|
|
|
|
${config.services.mbsync.package}/bin/mbsync --all || ${pkgs.coreutils}/bin/true
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
mbsync.enable = true;
|
2023-07-21 01:51:34 +07:00
|
|
|
};
|
2023-11-08 11:47:14 +07:00
|
|
|
#services.mbsync.enable = true;
|
|
|
|
# TODO: see https://github.com/pazz/alot/issues/1632
|
|
|
|
home.file.".mailcap".text = ''
|
|
|
|
text/html; ${pkgs.w3m}/bin/w3m -dump -o document_charset=%{charset} -o display_link_number=1 '%s'; nametemplate=%s.html; copiousoutput
|
|
|
|
'';
|
2023-07-21 01:51:34 +07:00
|
|
|
|
2023-12-25 03:40:33 +07:00
|
|
|
home.file.".cache/nix-index/files".source = assert config.xdg.cacheHome == "${config.home.homeDirectory}/.cache"; inputs.nix-index-database.legacyPackages.${pkgs.system}.database;
|
2023-01-24 02:24:40 +07:00
|
|
|
|
2023-07-21 01:51:34 +07:00
|
|
|
systemd.user.tmpfiles.rules = builtins.map (file: "r! \"/home/${config.home.username}/${file}\"") [
|
|
|
|
".local/share/clipman.json"
|
|
|
|
".local/state/lesshst" # I don't need less search history to persist across boots...
|
|
|
|
".Xauthority"
|
|
|
|
".sqlite_history"
|
|
|
|
".local/share/krunnerstaterc"
|
|
|
|
".local/share/user-places.xbel.bak"
|
|
|
|
".local/share/user-places.xbel.tbcache"
|
|
|
|
".config/mimeapps.list"
|
|
|
|
".config/ncmpcpp/error.log"
|
|
|
|
".config/mozc/.server.lock"
|
|
|
|
".config/mozc/.session.ipc"
|
|
|
|
".config/mozc/.registry.db" # usage stats (seemingly disabled on my machine)
|
|
|
|
".config/looking-glass/imgui.ini"
|
|
|
|
".config/QtProject.conf"
|
|
|
|
".steampid"
|
|
|
|
".steampath"
|
|
|
|
".config/.xash_id"
|
|
|
|
".config/proton.conf"
|
|
|
|
".local/state/nvim/lsp.log" # this is never cleared...
|
|
|
|
".config/pavucontrol.ini"
|
|
|
|
] ++ builtins.map (dir: "e! \"/home/${config.home.username}/${dir}/\" - - - 60d") [
|
|
|
|
".cache"
|
|
|
|
".local/share/qalculate"
|
|
|
|
".local/share/nvfetcher"
|
|
|
|
".gradle"
|
|
|
|
".openjfx"
|
|
|
|
".mono"
|
|
|
|
".local/share/Trash"
|
|
|
|
".config/wireshark"
|
|
|
|
".config/qt5ct"
|
|
|
|
".config/procps"
|
|
|
|
".config/neofetch"
|
|
|
|
".config/matplotlib"
|
|
|
|
".local/share/arti"
|
|
|
|
# I use this dir as dumping grounds for random stuff
|
|
|
|
"tmp"
|
|
|
|
# games stuff
|
|
|
|
".local/share/vulkan"
|
|
|
|
".steam"
|
|
|
|
".paradoxlauncher"
|
|
|
|
".local/share/StardewValley" # only logs here
|
|
|
|
".local/share/GOG.com"
|
|
|
|
".local/share/Paradox Interactive/launcher-v2"
|
|
|
|
# faf
|
|
|
|
".com.faforever.client.FafClientApplication"
|
|
|
|
".org.testfx.toolkit.PrimaryStageApplication"
|
|
|
|
".faforever/logs"
|
|
|
|
# whatever this is (has a single file named cookie)
|
|
|
|
".config/pulse"
|
|
|
|
# Nextcloud logs
|
|
|
|
".config/Nextcloud/logs"
|
|
|
|
".local/share/Nextcloud"
|
|
|
|
# this might seem useful, but it's only for temporary dbus files actually
|
|
|
|
".config/fcitx"
|
|
|
|
".config/ibus"
|
|
|
|
# fcitx themes (come on would I ever theme something non-declaratively)
|
|
|
|
".local/share/fcitx5"
|
|
|
|
# RGB tooling that I barely use
|
|
|
|
".config/OpenRGB"
|
|
|
|
".config/ario"
|
|
|
|
# I don't use Firefox, I use Librewolf
|
|
|
|
".mozilla"
|
|
|
|
# dev stuff
|
|
|
|
".local/share/tvix"
|
|
|
|
".cargo"
|
|
|
|
".npm"
|
|
|
|
# just when I thought ~ pollution couldn't get worse...
|
|
|
|
"go"
|
|
|
|
# android studio and related
|
|
|
|
".local/share/android"
|
|
|
|
".local/share/Google"
|
|
|
|
".java"
|
|
|
|
".local/share/Sentry"
|
|
|
|
".android/cache"
|
|
|
|
".m2"
|
|
|
|
# chromium
|
|
|
|
".config/chromium"
|
|
|
|
".config/cef_user_data"
|
|
|
|
".pki"
|
|
|
|
# a lib used by glow
|
|
|
|
".local/share/charm"
|
|
|
|
# I barely use FreeCAD, don't need its files
|
|
|
|
".config/FreeCAD"
|
|
|
|
".local/share/FreeCAD"
|
|
|
|
# some useless gui config
|
|
|
|
".config/gtk-2.0"
|
|
|
|
".config/gtk-3.0"
|
|
|
|
".config/kde.org"
|
|
|
|
# QtWebEngine cache
|
|
|
|
".local/share/Anki"
|
|
|
|
# kde connect contacts
|
|
|
|
".local/share/kpeoplevcard"
|
|
|
|
# repl history
|
|
|
|
".local/share/nix"
|
|
|
|
# iwctl history
|
|
|
|
".local/share/iwctl"
|
|
|
|
# non-home-manager-managed files
|
|
|
|
".local/share/applications"
|
|
|
|
".local/share/icons"
|
|
|
|
".local/share/mime"
|
|
|
|
".config/autostart"
|
|
|
|
# logs
|
|
|
|
".local/share/xorg"
|
|
|
|
# if I forgot it, it probably wasn't important
|
|
|
|
"Downloads"
|
|
|
|
] ++ builtins.map (dir: "x \"/home/${config.home.username}/${dir}/\"") [
|
|
|
|
# WHY DOES THIS KEEP PART OF THE CONFIG
|
|
|
|
".cache/keepassxc"
|
|
|
|
];
|
|
|
|
|
2023-01-24 02:24:40 +07:00
|
|
|
home.packages = with pkgs; [
|
2023-02-11 23:30:19 +07:00
|
|
|
rclone sshfs fuse
|
2023-02-17 01:16:44 +07:00
|
|
|
file jq python3Full killall
|
2023-03-07 18:20:08 +07:00
|
|
|
appimage-run comma nix-output-monitor
|
2023-07-21 01:51:34 +07:00
|
|
|
unzip p7zip unrar-wrapper
|
2023-01-24 02:24:40 +07:00
|
|
|
];
|
|
|
|
}
|