config/shared/home/default.nix

123 lines
2.2 KiB
Nix
Raw Normal View History

{
2023-10-09 17:17:24 +03:00
lib,
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-27 10:31:00 +03:00
hmOnly,
...
}: {
home = {
2023-10-06 11:32:22 +03:00
inherit stateVersion;
username = "motiejus";
homeDirectory = "/home/motiejus";
};
2023-10-23 09:48:14 +03:00
home.packages = with pkgs;
2023-10-27 10:31:00 +03:00
(
if devEnvironment
then [
go
zigpkgs."0.11.0"
sbt
scala_2_12
metals
coursier
]
else []
)
++ (
if hmOnly
then [
ncdu
tokei
vimv-rs
hyperfine
]
else []
);
2023-11-27 18:17:27 +02:00
programs = {
direnv.enable = true;
2023-11-27 18:17:27 +02:00
neovim = lib.mkMerge [
{
enable = true;
vimAlias = true;
vimdiffAlias = true;
defaultEditor = true;
plugins = with pkgs.vimPlugins;
[
fugitive
2023-10-09 17:17:24 +03:00
]
2023-11-27 18:17:27 +02:00
++ (
if devEnvironment
then [
vim-go
2023-11-27 18:17:27 +02:00
zig-vim
2023-11-27 18:17:27 +02:00
vim-vsnip
cmp-nvim-lsp
nvim-cmp
nvim-metals
plenary-nvim
]
else []
);
extraConfig = builtins.readFile ./vimrc;
}
2023-11-27 18:17:27 +02:00
(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 14:52:44 +03:00
2023-11-27 18:17:27 +02:00
git = {
enable = true;
userEmail = email;
userName = "Motiejus Jakštys";
aliases.yolo = "commit --amend --no-edit -a";
extraConfig = {
rerere.enabled = true;
pull.ff = "only";
merge.conflictstyle = "diff3";
init.defaultBranch = "main";
};
};
gpg = {
enable = true;
mutableKeys = false;
mutableTrust = false;
publicKeys = [
{
source = ./motiejus-gpg.txt;
trust = "ultimate";
}
];
};
tmux = {
enable = true;
keyMode = "vi";
historyLimit = 1000000;
extraConfig = ''
bind c new-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind '"' split-window -v -c "#{pane_current_path}"
'';
};
2023-10-06 14:52:44 +03:00
};
}