nix-config/home.nix

297 lines
6.4 KiB
Nix
Raw Permalink Normal View History

2024-05-18 11:31:35 -07:00
{
config,
lib,
pkgs,
...
}:
2020-10-12 00:47:07 -07:00
{
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
2021-04-11 23:31:11 -07:00
imports = (import ./programs);
2024-05-18 11:31:35 -07:00
nixpkgs.config.allowUnfreePredicate =
pkg:
builtins.elem (lib.getName pkg) [
"discord"
"slack"
"vscode"
"vscode-extension-github-copilot"
"vscode-extension-github-copilot-chat"
2024-05-18 11:31:35 -07:00
"vscode-extension-MS-python-vscode-pylance"
"zoom"
];
2022-08-08 00:37:22 -07:00
2021-04-11 23:31:11 -07:00
home = {
stateVersion = "24.05";
2021-04-11 23:31:11 -07:00
sessionVariables = {
EDITOR = "nvim";
VISUAL = "$EDITOR";
};
2022-08-07 22:50:23 -07:00
packages = with pkgs; [
2023-10-21 08:38:48 -07:00
jdk21
2022-08-07 22:50:23 -07:00
any-nix-shell
aspell
2024-09-07 11:10:17 -07:00
basedpyright
bash-language-server
2022-08-07 22:50:23 -07:00
cachix
cmake
coursier
2024-03-23 10:14:43 -07:00
curlFull
delta
2024-03-23 10:14:43 -07:00
deno
2024-04-26 12:20:53 -07:00
devenv
discord
dua
2022-08-07 22:50:23 -07:00
fd
ffmpeg
2023-10-21 08:38:48 -07:00
fishPlugins.foreign-env
fishPlugins.bobthefish
2022-09-18 15:10:19 -07:00
font-awesome
2022-08-07 22:50:23 -07:00
gitAndTools.diff-so-fancy
gnupg
go
2022-12-10 11:46:19 -08:00
graphviz
2024-09-07 11:10:17 -07:00
jq-lsp
2022-08-07 22:50:23 -07:00
luajit
luajitPackages.luarocks
luajitPackages.luasocket
2024-09-07 11:10:17 -07:00
lua-language-server
2023-02-24 18:19:14 -08:00
marksman
2022-08-07 22:50:23 -07:00
maven
2023-12-17 15:32:00 -08:00
metals
2022-08-07 22:50:23 -07:00
multimarkdown
mypy
neofetch
neovim
2024-06-07 23:26:11 -07:00
nil
2022-08-07 22:50:23 -07:00
niv
2024-09-07 11:10:17 -07:00
nixd
2022-08-07 22:50:23 -07:00
nix-index
2024-05-18 11:31:35 -07:00
nixfmt-rfc-style
2022-10-08 11:48:26 -07:00
nix-prefetch-git
nodejs
2024-02-18 21:29:00 -08:00
ollama
2022-08-07 22:50:23 -07:00
openssl
pandoc
patchelf
pngpaste
2023-01-04 18:12:50 -08:00
prettyping
2024-02-18 21:29:00 -08:00
python3Packages.huggingface-hub
2024-02-19 22:39:38 -08:00
python3Packages.jupyterlab
2024-07-07 19:22:52 -07:00
pyright
2022-08-07 22:50:23 -07:00
rclone
readline
ripgrep
ripgrep-all
2024-03-23 10:14:43 -07:00
rustup
2022-08-07 22:50:23 -07:00
sbt
scala-cli
shellcheck
2024-05-19 17:15:05 -07:00
skimpdf
slack
slides
slumber
2022-08-07 22:50:23 -07:00
sqlite
stylua
tealdeer
2022-09-18 15:10:19 -07:00
tectonic
texlab
2022-08-07 22:50:23 -07:00
tig
tokei
tree
tree-sitter
2024-09-07 11:10:17 -07:00
typescript
typescript-language-server
wget
2024-07-07 19:22:52 -07:00
vscode-langservers-extracted
2024-02-18 21:29:00 -08:00
xcodes
2022-08-07 22:50:23 -07:00
xz
2024-09-07 11:10:17 -07:00
yaml-language-server
2022-08-07 22:50:23 -07:00
yq
zoom-us
2022-08-07 22:50:23 -07:00
];
2020-10-12 00:47:07 -07:00
};
2021-04-11 11:19:06 -07:00
programs.bat = {
2024-03-23 10:14:43 -07:00
enable = true;
2021-04-11 11:19:06 -07:00
};
2024-02-18 21:29:00 -08:00
programs.btop = {
enable = true;
};
2023-04-08 16:32:46 -07:00
2023-12-06 23:03:53 -08:00
programs.darcs = {
enable = true;
2024-05-18 11:31:35 -07:00
author = [ "Salar Rahmanian <code@softinio.com>" ];
2023-12-06 23:03:53 -08:00
boring = [
"^.idea$"
"^.direnv$"
"^.envrc$"
"^.vscode$"
];
};
2021-09-07 08:04:39 -07:00
programs.direnv = {
2021-04-11 11:19:06 -07:00
enable = true;
2021-09-07 08:04:39 -07:00
nix-direnv.enable = true;
2021-04-11 11:19:06 -07:00
};
programs.eza = {
enable = true;
2024-03-23 10:14:43 -07:00
enableFishIntegration = true;
git = true;
icons = true;
extraOptions = [
"--group-directories-first"
"--long"
"--header"
"--all"
];
};
2021-09-07 08:04:39 -07:00
programs.fzf = {
2021-04-11 11:19:06 -07:00
enable = true;
enableFishIntegration = true;
};
programs.gh = {
enable = true;
2021-11-07 13:24:41 -08:00
settings = {
editor = "nvim";
git_protocol = "ssh";
2024-01-23 20:31:55 -08:00
prompt = "enabled";
aliases = {
co = "pr checkout";
pv = "pr view";
};
2021-11-07 13:24:41 -08:00
};
2021-04-11 11:19:06 -07:00
};
2023-09-23 15:30:58 -07:00
programs.gh-dash = {
enable = true;
};
2023-04-30 11:44:34 -07:00
programs.helix = {
enable = true;
settings = {
theme = "tokyonight";
};
};
2020-10-12 00:47:07 -07:00
programs.htop = {
enable = true;
};
programs.jq = {
enable = true;
};
2024-01-23 20:31:55 -08:00
programs.lazygit = {
enable = true;
};
2024-02-18 21:29:00 -08:00
programs.nix-index = {
enable = true;
enableFishIntegration = true;
};
2020-10-12 00:47:07 -07:00
programs.starship = {
enable = true;
enableFishIntegration = true;
2020-10-12 00:47:07 -07:00
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;
2021-10-04 21:32:23 -07:00
functions = {
gitignore = "curl -sL https://www.gitignore.io/api/$argv";
};
2023-10-21 08:38:48 -07:00
plugins = [ ];
2020-10-12 00:47:07 -07:00
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-11-07 13:24:41 -08:00
set -xg PATH $HOME/bin $HOME/.cargo/bin $PATH
2020-10-12 00:47:07 -07:00
2024-05-19 22:53:50 -07:00
set -xg PATH /Users/salar/.luarocks/bin:/Users/salar/bin:/Users/salar/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin $PATH
2023-01-04 18:12:50 -08:00
2021-07-14 22:46:35 -07:00
set -xg WORKSPACE /Users/salar/Projects
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
2024-03-23 10:14:43 -07:00
'';
2020-10-12 00:47:07 -07:00
2021-11-07 13:24:41 -08:00
interactiveShellInit = ''
set -xg PATH $HOME/bin $HOME/.cargo/bin $PATH
2020-10-12 00:47:07 -07:00
eval (direnv hook fish)
any-nix-shell fish --info-right | source
ssh-add ~/.ssh/id_ed25519 --apple-use-keychain --apple-load-keychain
2020-10-12 00:47:07 -07:00
'';
shellAliases = {
2024-03-23 10:14:43 -07:00
addsshmac = "ssh-add ~/.ssh/id_ed25519 --apple-use-keychain --apple-load-keychain";
cat = "bat";
du = "dua i";
2024-03-23 10:14:43 -07:00
fzfp = "fzf --preview 'bat --style=numbers --color=always --line-range :500 {}'";
ping = "prettyping";
2020-10-12 00:47:07 -07:00
".." = "cd ..";
2024-03-23 10:14:43 -07:00
pj = "python -m json.tool";
l = "ll";
g = "git";
gl = "git log";
gc = "git commit -m";
gca = "git commit -am";
gws = "git status";
gu = "gitui";
ghauth = "gh auth login --with-token < ~/.ghauth";
gitpurgemain = ''git branch --merged | grep -v "\*" | grep -v "main" | xargs -n 1 git branch -d'';
gitpurgemaster = ''git branch --merged | grep -v "\*" | grep -v "master" | xargs -n 1 git branch -d'';
giscala = "gitignore scala,vim,java,sbt > .gitignore";
gforksync = "git fetch upstream && git merge upstream/master && git push origin master";
grep = "grep --color=auto";
lg = "lazygit";
new-sbt = "sbt new scala/scala-seed.g8";
nixc = "cd ~/.config/nixpkgs";
nixre = "nix build && sudo ./result/activate";
nixinfo = "nix-shell -p nix-info --run \"nix-info -m\"";
nixgc = "nix-collect-garbage -d";
nixq = "nix-env -qa";
nixstorerepair = "nix-store --repair --verify --check-contents";
nixupgrade = "nix upgrade-nix";
rmxcodederived = "rm -fr ~/Library/Developer/Xcode/DerivedData";
v = "nvim";
wezk = "wezterm show-keys --lua";
sshhcloud1 = "ssh salar@hcloud1.softinio.net";
sshhcloud1r = "ssh root@hcloud1.softinio.net";
2020-10-12 00:47:07 -07:00
};
};
# Neovim Configuration
xdg.configFile."nvim".source = builtins.fetchGit {
url = "https://code.softinio.com/softinio/nvim-config";
2024-09-07 11:14:51 -07:00
rev = "b25a90efbc016f75393b43cf9aa9643b066be1ce";
};
2020-10-12 00:47:07 -07:00
}