2023-10-06 11:24:00 +03:00
|
|
|
{
|
2023-10-09 17:17:24 +03:00
|
|
|
lib,
|
2023-10-06 11:24:00 +03:00
|
|
|
pkgs,
|
2023-10-06 11:32:22 +03:00
|
|
|
stateVersion,
|
2023-10-06 14:32:52 +03:00
|
|
|
email,
|
2023-10-08 23:00:39 +03:00
|
|
|
devEnvironment,
|
2023-10-06 11:24:00 +03:00
|
|
|
...
|
2023-10-23 09:48:14 +03:00
|
|
|
}: let
|
|
|
|
queryWatchman = with pkgs; let
|
|
|
|
# TODO: this is a perl script which needs $LOCALE_ARCHIVE.
|
|
|
|
# As of writing, I have this in my ~/.bashrc:
|
|
|
|
# export LOCALE_ARCHIVE=/usr/lib/locale/locale-archive
|
|
|
|
fsmon =
|
|
|
|
runCommand "fsmonitor-watchman"
|
|
|
|
{
|
|
|
|
src = "${git}/share/git-core/templates/hooks/fsmonitor-watchman.sample";
|
|
|
|
buildInputs = [gnused];
|
|
|
|
} ''
|
2023-10-23 10:20:36 +03:00
|
|
|
sed -e 's@^#!/usr/bin/perl@#!${perl}@' $src > $out
|
2023-10-23 09:48:14 +03:00
|
|
|
chmod +x $out
|
|
|
|
'';
|
|
|
|
in
|
|
|
|
writeShellScript "query-watchman" ''
|
|
|
|
export PATH=${pkgs.watchman}/bin:$PATH
|
|
|
|
exec ${fsmon.outPath} "$@"
|
|
|
|
'';
|
|
|
|
in {
|
2023-10-06 11:24:00 +03:00
|
|
|
home = {
|
2023-10-06 11:32:22 +03:00
|
|
|
inherit stateVersion;
|
2023-10-06 11:24:00 +03:00
|
|
|
|
|
|
|
username = "motiejus";
|
|
|
|
homeDirectory = "/home/motiejus";
|
|
|
|
};
|
|
|
|
|
2023-10-23 09:48:14 +03:00
|
|
|
home.packages = with pkgs;
|
2023-10-23 10:20:36 +03:00
|
|
|
if devEnvironment
|
|
|
|
then [
|
|
|
|
go
|
2023-10-08 23:00:39 +03:00
|
|
|
|
2023-10-23 10:20:36 +03:00
|
|
|
zigpkgs."0.11.0"
|
|
|
|
sbt
|
2023-10-09 12:15:07 +03:00
|
|
|
|
2023-10-23 10:20:36 +03:00
|
|
|
scala_2_12
|
|
|
|
metals
|
|
|
|
coursier
|
|
|
|
]
|
|
|
|
else [];
|
2023-10-06 11:24:00 +03:00
|
|
|
|
|
|
|
programs.direnv.enable = true;
|
|
|
|
|
2023-10-09 17:17:24 +03:00
|
|
|
programs.neovim = lib.mkMerge [
|
|
|
|
{
|
|
|
|
enable = true;
|
|
|
|
vimAlias = true;
|
|
|
|
vimdiffAlias = true;
|
|
|
|
defaultEditor = true;
|
|
|
|
plugins = with pkgs.vimPlugins;
|
|
|
|
[
|
|
|
|
fugitive
|
|
|
|
]
|
|
|
|
++ (
|
|
|
|
if devEnvironment
|
|
|
|
then [
|
|
|
|
vim-go
|
2023-10-08 23:00:39 +03:00
|
|
|
|
2023-10-09 17:17:24 +03:00
|
|
|
zig-vim
|
2023-10-08 23:00:39 +03:00
|
|
|
|
2023-10-10 14:50:21 +03:00
|
|
|
vim-vsnip
|
2023-10-09 17:17:24 +03:00
|
|
|
cmp-nvim-lsp
|
|
|
|
nvim-cmp
|
|
|
|
nvim-metals
|
|
|
|
plenary-nvim
|
|
|
|
]
|
|
|
|
else []
|
|
|
|
);
|
|
|
|
extraConfig = builtins.readFile ./vimrc;
|
|
|
|
}
|
|
|
|
(lib.mkIf devEnvironment {
|
|
|
|
extraLuaConfig =
|
|
|
|
builtins.readFile
|
|
|
|
(pkgs.substituteAll {
|
|
|
|
src = ./dev.lua;
|
|
|
|
javaHome = pkgs.jdk.home;
|
|
|
|
inherit (pkgs) metals;
|
|
|
|
inherit (pkgs) gotools;
|
|
|
|
})
|
|
|
|
.outPath;
|
|
|
|
})
|
|
|
|
];
|
2023-10-06 11:24:00 +03:00
|
|
|
|
|
|
|
programs.git = {
|
|
|
|
enable = true;
|
2023-10-06 14:32:52 +03:00
|
|
|
userEmail = email;
|
2023-10-06 11:24:00 +03:00
|
|
|
userName = "Motiejus Jakštys";
|
|
|
|
aliases.yolo = "commit --amend --no-edit -a";
|
|
|
|
extraConfig = {
|
2023-10-23 09:48:14 +03:00
|
|
|
core.fsmonitor = queryWatchman.outPath;
|
|
|
|
core.untrackedcache = true;
|
2023-10-06 11:24:00 +03:00
|
|
|
rerere.enabled = true;
|
|
|
|
pull.ff = "only";
|
|
|
|
merge.conflictstyle = "diff3";
|
2023-10-19 10:04:53 +03:00
|
|
|
init.defaultBranch = "main";
|
2023-10-06 11:24:00 +03:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
programs.gpg = {
|
|
|
|
enable = true;
|
|
|
|
mutableKeys = false;
|
|
|
|
mutableTrust = false;
|
|
|
|
publicKeys = [
|
|
|
|
{
|
|
|
|
source = ./motiejus-gpg.txt;
|
|
|
|
trust = "ultimate";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
2023-10-06 14:52:44 +03:00
|
|
|
|
|
|
|
programs.tmux = {
|
|
|
|
enable = true;
|
|
|
|
keyMode = "vi";
|
2023-10-09 09:42:11 +03:00
|
|
|
historyLimit = 1000000;
|
2023-10-06 14:52:44 +03:00
|
|
|
};
|
2023-10-06 11:24:00 +03:00
|
|
|
}
|