depot/ops/nixos/lib/home-manager/client.nix

49 lines
1.1 KiB
Nix

{ depot, lib, pkgs, ... }:
let
inherit (pkgs.stdenv.hostPlatform) isDarwin isLinux;
in
{
imports = [ ./common.nix ];
home.sessionVariables.GITHUB_TOKEN = with depot.ops; if builtins.hasAttr "githubToken" secrets then secrets.githubToken else null;
programs.git = {
enable = true;
package = pkgs.gitAndTools.gitFull;
extraConfig = {
user.name = "Luke Granger-Brown";
user.email = "git@lukegb.com";
pull.ff = "only";
};
};
programs.direnv.enable = true;
programs.vim = {
plugins = (with pkgs.vimPlugins; [
vim-go
]);
extraConfig = ''
source $VIMRUNTIME/defaults.vim
let g:go_def_mode='gopls'
let g:go_info_mode='gopls'
let g:go_fmt_command='goimports'
set mouse=
'';
};
programs.ssh.controlMaster = "auto";
programs.ssh.controlPersist = "10m";
programs.bash.initExtra = lib.mkAfter ''
ssh-add -q -l >/dev/null || ssh-add -c -q
'';
home.packages = lib.mkAfter (with pkgs; ([
go
gopls
goimports
graphicsmagick-imagemagick-compat
youtube-dl
] ++ lib.optionals isLinux [
depot.nix.pkgs.copybara
]));
}