nix-config/home.nix

241 lines
5.8 KiB
Nix
Raw Normal View History

2020-10-12 00:47:07 -07:00
{ config, lib, pkgs, ... }:
{
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
2021-04-11 23:31:11 -07:00
imports = (import ./programs);
2021-07-11 22:50:49 -07:00
nixpkgs.overlays = [
(import ./overlays/sumneko-lua-language-server)
];
2021-04-11 23:31:11 -07:00
home = {
username = "salar";
homeDirectory = "/Users/salar";
2021-06-23 22:52:33 -07:00
stateVersion = "21.11";
2021-04-11 23:31:11 -07:00
sessionVariables = {
EDITOR = "nvim";
VISUAL = "$EDITOR";
};
2020-10-12 00:47:07 -07:00
};
2021-04-11 11:19:06 -07:00
programs.bat = {
enable = true;
};
programs.fzf = {
enable = true;
enableFishIntegration = true;
};
programs.direnv = {
enable = true;
enableFishIntegration = true;
2021-07-03 16:40:38 -07:00
nix-direnv.enable = true;
2021-04-11 11:19:06 -07:00
};
programs.gh = {
enable = true;
editor = "nvim";
gitProtocol = "ssh";
};
2020-10-12 00:47:07 -07:00
programs.htop = {
enable = true;
};
programs.jq = {
enable = true;
};
programs.starship = {
enable = true;
settings = {
2021-06-23 22:52:33 -07:00
command_timeout = 1000;
2021-06-07 21:08:10 -07:00
character = {
success_symbol = " [λ](bold green)";
error_symbol = " [λ](bold red)";
};
2020-10-12 00:47:07 -07:00
};
};
programs.fish = {
enable = true;
plugins = [
{
name = "bass";
src = pkgs.fetchFromGitHub {
owner = "edc";
repo = "bass";
rev = "50eba266b0d8a952c7230fca1114cbc9fbbdfbd4";
sha256 = "0ppmajynpb9l58xbrcnbp41b66g7p0c9l2nlsvyjwk6d16g4p4gy";
};
}
{
name = "foreign-env";
src = pkgs.fetchFromGitHub {
owner = "oh-my-fish";
repo = "plugin-foreign-env";
rev = "dddd9213272a0ab848d474d0cbde12ad034e65bc";
sha256 = "00xqlyl3lffc5l0viin1nyp819wf81fncqyz87jx8ljjdhilmgbs";
};
}
{
name = "bobthefish";
src = pkgs.fetchFromGitHub {
owner = "oh-my-fish";
repo = "theme-bobthefish";
rev = "a2ad38aa051aaed25ae3bd6129986e7f27d42d7b";
sha256 = "1fssb5bqd2d7856gsylf93d28n3rw4rlqkhbg120j5ng27c7v7lq";
};
}
];
loginShellInit = ''
2020-11-09 14:25:57 -08:00
set -xg TERM xterm-256color
2020-10-12 00:47:07 -07:00
if test -e /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
fenv source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
end
if test -e /nix/var/nix/profiles/default/etc/profile.d/nix.sh
fenv source /nix/var/nix/profiles/default/etc/profile.d/nix.sh
end
if test -e $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh
fenv source $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh
end
2021-04-11 11:19:06 -07:00
set -xg PATH $HOME/bin $PATH
2020-10-12 00:47:07 -07:00
set -xg JAVA_HOME /Users/salar/.nix-profile/bin
2020-10-12 00:47:07 -07:00
2021-07-14 22:49:03 -07:00
set -xg JDTLS_CONFIG /Users/salar/.config/jdt-language-server/config_mac
2021-07-14 22:46:35 -07:00
2021-07-14 22:49:03 -07:00
set -xg JAR /Users/salar/.config/jdt-language-server/plugins/org.eclipse.equinox.launcher_1.6.200.v20210416-2027.jar
2021-07-14 22:46:35 -07:00
set -xg WORKSPACE /Users/salar/Projects
2020-11-09 14:25:57 -08:00
set -xg NIX_PATH $HOME/.nix-defexpr/channels $NIX_PATH
2020-10-12 08:14:13 -07:00
set -xg FZF_DEFAULT_OPTS "--preview='bat {} --color=always'" \n
2021-02-11 19:34:44 -08:00
set -xg TOOLCHAINS swift
2021-06-23 22:52:33 -07:00
set -xg XDG_CONFIG_HOME $HOME/.config
2020-10-12 00:47:07 -07:00
'';
promptInit = ''
eval (direnv hook fish)
any-nix-shell fish --info-right | source
'';
shellAliases = {
cat="bat";
du="ncdu --color dark -rr -x";
2021-06-23 22:52:33 -07:00
fzfp="fzf --preview 'bat --style=numbers --color=always --line-range :500 {}'";
2020-10-12 00:47:07 -07:00
ping="prettyping";
".." = "cd ..";
pj="python -m json.tool";
2021-02-11 19:34:44 -08:00
l="exa --long --header --git --all";
2020-10-12 00:47:07 -07:00
g="git";
gl="git log";
gc="git commit -m";
gca="git commit -am";
gws="git status";
2021-04-11 12:01:46 -07:00
ghauth="gh auth login --with-token < ~/.ghauth";
2020-10-12 00:47:07 -07:00
gforksync="git fetch upstream && git merge upstream/master && git push origin master";
grep="grep --color=auto";
new-sbt="sbt new scala/scala-seed.g8";
nixre="home-manager switch";
2021-04-11 11:19:06 -07:00
nixedit="home-manager edit";
2021-06-23 22:52:33 -07:00
nixinfo="nix-shell -p nix-info --run \"nix-info -m\"";
2020-10-12 00:47:07 -07:00
nixgc="nix-collect-garbage -d";
nixq="nix-env -qa";
nixupdate="nix-channel --update";
nixupgrade="nix upgrade-nix";
nixup="nix-env -u";
nixversion="nix eval nixpkgs.lib.version";
nixdaemon="sudo launchctl load /Library/LaunchDaemons/org.nixos.nix-daemon.plist && launchctl start org.nixos.nix-daemon";
2021-06-23 22:52:33 -07:00
rmxcodederived="rm -fr ~/Library/Developer/Xcode/DerivedData";
2020-11-09 14:25:57 -08:00
v="nvim";
2020-10-12 00:47:07 -07:00
tabninecfg="vc /Users/salar/Library/Preferences/TabNine/TabNine.toml";
sshfre1="ssh salar@fre1.softinio.net";
};
};
xdg.configFile."fish/conf.d/plugin-bobthefish.fish".text = lib.mkAfter ''
for f in $plugin_dir/*.fish
source $f
end
'';
# Neovim Configuration
2021-07-11 15:25:20 -07:00
xdg.configFile."nvim/lua/salargalaxyline.lua".source = programs/neovim/settings/salargalaxyline.lua;
xdg.configFile."nvim/init.lua".source = programs/neovim/init.lua;
2020-10-12 00:47:07 -07:00
home.packages = [
pkgs.adoptopenjdk-bin
pkgs.any-nix-shell
pkgs.asciinema
pkgs.aspell
2020-10-12 00:47:07 -07:00
pkgs.awscli
2021-07-31 10:30:02 -07:00
pkgs.bloop
pkgs.cabal-install
pkgs.cmake
pkgs.coursier
2020-10-12 00:47:07 -07:00
pkgs.curlFull
pkgs.direnv
pkgs.dust
2020-10-12 00:47:07 -07:00
pkgs.exa
pkgs.fd
pkgs.ffmpeg
pkgs.ghcid
2020-10-12 00:47:07 -07:00
pkgs.gitAndTools.diff-so-fancy
pkgs.global
2020-10-12 00:47:07 -07:00
pkgs.gnupg
pkgs.gradle
pkgs.graphviz
2020-10-12 00:47:07 -07:00
pkgs.hlint
pkgs.httpie
pkgs.hugo
pkgs.hyperfine
pkgs.jansson
2021-07-15 22:33:10 -07:00
pkgs.luajit
pkgs.luajitPackages.luarocks
pkgs.maven
2020-10-12 00:47:07 -07:00
pkgs.multimarkdown
pkgs.ncdu
pkgs.neofetch
pkgs.neovim
pkgs.niv
pkgs.nixFlakes
pkgs.nixfmt
pkgs.nodePackages.pyright
pkgs.openssl
pkgs.pandoc
pkgs.pgcli
2020-10-12 00:47:07 -07:00
pkgs.prettyping
pkgs.procs
pkgs.procs
pkgs.ranger
pkgs.readline
pkgs.ripgrep
pkgs.rnix-lsp
2021-07-31 10:30:02 -07:00
pkgs.sbt
pkgs.shellcheck
2021-07-15 08:19:22 -07:00
pkgs.stylua
2021-07-11 22:50:49 -07:00
pkgs.sumneko-lua-language-server
pkgs.tealdeer
pkgs.tig
pkgs.tokei
pkgs.tree
pkgs.universal-ctags
2021-04-11 11:19:06 -07:00
pkgs.vscodium
pkgs.wget
pkgs.xz
2021-07-15 22:19:17 -07:00
pkgs.yq
2020-10-12 00:47:07 -07:00
];
}