2022-11-08 19:14:47 +00:00
|
|
|
# myHome is injected from extraSpecialArgs in flake.nix
|
2022-11-09 11:35:28 +00:00
|
|
|
{ config
|
|
|
|
, pkgs
|
|
|
|
, myHome
|
|
|
|
, ...
|
|
|
|
}:
|
2022-11-29 23:36:35 +00:00
|
|
|
let nvim_pkgs = [
|
|
|
|
# Yes, I desperately want neovim to work out-of-the-box without flake.nix for now
|
|
|
|
# I want at least python LSP to work everywhere because it's basically
|
|
|
|
# an alternative to bash script when I move to OpenColo
|
|
|
|
pkgs.gccStdenv
|
|
|
|
pkgs.gcc
|
|
|
|
pkgs.tree-sitter
|
|
|
|
pkgs.ripgrep
|
|
|
|
pkgs.fzf
|
2022-11-30 11:32:24 +00:00
|
|
|
# pkgs.sumneko-lua-language-server
|
2022-11-29 23:36:35 +00:00
|
|
|
pkgs.ripgrep
|
|
|
|
pkgs.zk
|
|
|
|
pkgs.fd
|
2022-12-01 02:17:06 +00:00
|
|
|
pkgs.stdenv.cc.cc.lib
|
2022-11-29 23:36:35 +00:00
|
|
|
# Python3 as alternative to bash scripts :^)
|
2022-12-01 02:17:06 +00:00
|
|
|
# (pkgs.python310Full.withPackages (pypkgs: [
|
|
|
|
# # python-lsp-server's dependencies is absolutely astronomous
|
|
|
|
# # pypkgs.python-lsp-server # python-lsp. Now we'll have to tell mason to look for this
|
|
|
|
# pypkgs.pynvim # nvim provider
|
|
|
|
# # pypkgs.ujson # pylsp seems to rely on this. satisfy it lol
|
|
|
|
# ]))
|
2022-11-29 23:36:35 +00:00
|
|
|
]; in
|
2022-11-06 20:23:10 +00:00
|
|
|
{
|
2022-11-08 19:14:47 +00:00
|
|
|
home = {
|
|
|
|
username = myHome.username;
|
|
|
|
homeDirectory = myHome.homeDirectory;
|
|
|
|
stateVersion = myHome.stateVersion or "22.05";
|
|
|
|
};
|
2022-11-29 23:36:35 +00:00
|
|
|
home.packages = pkgs.lib.unique ([
|
2022-12-01 02:17:06 +00:00
|
|
|
pkgs.ncdu
|
2022-11-09 11:35:28 +00:00
|
|
|
pkgs.htop
|
|
|
|
pkgs.ripgrep
|
|
|
|
pkgs.unzip
|
2022-11-29 23:36:35 +00:00
|
|
|
pkgs.rust-bin.nightly.latest.default # Needed for alacritty?
|
2022-11-29 23:08:44 +00:00
|
|
|
|
2022-11-25 23:45:08 +00:00
|
|
|
# pkgs.nodejs-18_x
|
2022-11-29 23:36:35 +00:00
|
|
|
# pkgs.rust-analyzer # This should be very specific to env
|
2022-11-29 23:08:44 +00:00
|
|
|
|
2022-11-29 23:36:35 +00:00
|
|
|
|
|
|
|
# cool utilities
|
|
|
|
pkgs.yq # Yaml adaptor for jq (only pretty print, little query)
|
|
|
|
pkgs.xorg.xclock # TODO: only include if have GL # For testing GL installation
|
|
|
|
pkgs.logseq # TODO: only include if have GL # Obsidian alt
|
|
|
|
pkgs.mosh # Parsec for SSH
|
2022-11-22 05:36:18 +00:00
|
|
|
pkgs.nixops_unstable # nixops v2
|
2022-11-29 23:36:35 +00:00
|
|
|
pkgs.lynx # Web browser at your local terminal
|
|
|
|
|
2022-11-24 01:26:56 +00:00
|
|
|
# pkgs.tailscale # VPC;; This should be installed in system-nix
|
2022-12-01 02:17:06 +00:00
|
|
|
pkgs.python310 # dev packages should be in jk
|
2022-11-09 15:35:44 +00:00
|
|
|
# pkgs.python310.numpy
|
|
|
|
# pkgs.python310Packages.tensorflow
|
|
|
|
# pkgs.python310Packages.scikit-learn
|
2022-11-29 23:36:35 +00:00
|
|
|
] ++ (myHome.packages or [ ]) ++ nvim_pkgs);
|
2022-11-06 20:23:10 +00:00
|
|
|
|
2022-11-06 22:22:09 +00:00
|
|
|
## Configs ##
|
|
|
|
xdg.configFile."nvim/init.lua".text = builtins.readFile ../neovim/init.lua;
|
|
|
|
xdg.configFile."starship.toml".text = builtins.readFile ../starship/starship.toml;
|
|
|
|
|
|
|
|
## Programs ##
|
2022-11-09 13:00:23 +00:00
|
|
|
programs.jq = {
|
|
|
|
enable = true;
|
|
|
|
};
|
2022-11-08 19:14:47 +00:00
|
|
|
programs.alacritty = myHome.programs.alacritty or {
|
2022-11-07 15:23:25 +00:00
|
|
|
enable = true;
|
2022-11-09 13:00:23 +00:00
|
|
|
# settings = myLib.fromYaml (builtins.readFile ../alacritty/alacritty.yml);
|
2022-11-07 15:23:25 +00:00
|
|
|
};
|
2022-11-14 15:59:12 +00:00
|
|
|
# nix: Propagates the environment with packages and vars when enter (children of)
|
|
|
|
# a directory with shell.nix-compatible and .envrc
|
2022-11-07 18:15:34 +00:00
|
|
|
programs.direnv = {
|
|
|
|
enable = true;
|
|
|
|
nix-direnv.enable = true;
|
2022-11-28 02:04:38 +00:00
|
|
|
# nix-direnv.enableFlakes = true; # must remove. this will always be supported.
|
2022-11-07 18:15:34 +00:00
|
|
|
};
|
2022-11-14 15:59:12 +00:00
|
|
|
# z <path> as smarter cd
|
2022-11-06 22:22:09 +00:00
|
|
|
programs.zoxide = {
|
|
|
|
enable = true;
|
|
|
|
enableZshIntegration = true;
|
|
|
|
};
|
|
|
|
programs.tmux = {
|
|
|
|
enable = true;
|
2022-11-11 03:24:08 +00:00
|
|
|
extraConfig = builtins.readFile ../tmux/tmux.conf;
|
2022-11-06 22:22:09 +00:00
|
|
|
};
|
|
|
|
programs.exa = {
|
|
|
|
enable = true;
|
|
|
|
enableAliases = true;
|
|
|
|
};
|
|
|
|
programs.starship = {
|
|
|
|
enable = true;
|
|
|
|
enableZshIntegration = true;
|
|
|
|
};
|
2022-11-06 20:23:10 +00:00
|
|
|
programs.home-manager.enable = true;
|
|
|
|
programs.fzf.enable = true;
|
2022-12-01 02:17:06 +00:00
|
|
|
programs.neovim = {
|
|
|
|
enable = true;
|
|
|
|
viAlias = true;
|
|
|
|
vimAlias = true;
|
|
|
|
withPython3 = true;
|
|
|
|
withNodeJs = true;
|
|
|
|
extraPackages = nvim_pkgs;
|
|
|
|
extraPython3Packages = (pypkgs: [
|
|
|
|
pypkgs.python-lsp-server
|
|
|
|
pypkgs.ujson
|
|
|
|
]);
|
|
|
|
# I use vim-plug, so I probably don't require packaging
|
|
|
|
# extraConfig actually writes to init-home-manager.vim (not lua)
|
|
|
|
# https://github.com/nix-community/home-manager/pull/3287
|
|
|
|
# extraConfig = builtins.readFile ../neovim/init.lua;
|
|
|
|
};
|
2022-11-10 18:42:35 +00:00
|
|
|
programs.bash = {
|
|
|
|
enable = true;
|
|
|
|
enableCompletion = true;
|
|
|
|
initExtra = myHome.shellInitExtra or "";
|
|
|
|
};
|
2022-11-06 20:23:10 +00:00
|
|
|
programs.zsh = {
|
|
|
|
enable = true;
|
|
|
|
enableCompletion = true;
|
|
|
|
enableAutosuggestions = true;
|
|
|
|
shellAliases = {
|
|
|
|
nix-rebuild = "sudo nixos-rebuild switch";
|
2022-11-06 22:22:09 +00:00
|
|
|
hm-switch = "home-manager switch --flake";
|
2022-11-09 11:35:28 +00:00
|
|
|
} // (myHome.shellAliases or { });
|
2022-11-06 20:23:10 +00:00
|
|
|
history = {
|
|
|
|
size = 10000;
|
|
|
|
path = "${config.xdg.dataHome}/zsh/history";
|
|
|
|
};
|
|
|
|
oh-my-zsh = {
|
|
|
|
enable = true;
|
|
|
|
plugins = [ "git" "sudo" "command-not-found" "gitignore" "ripgrep" "rust" ];
|
|
|
|
};
|
2022-11-10 18:42:35 +00:00
|
|
|
initExtra = myHome.shellInitExtra or "";
|
2022-11-06 20:23:10 +00:00
|
|
|
};
|
|
|
|
programs.git = {
|
|
|
|
enable = true;
|
|
|
|
lfs.enable = true;
|
|
|
|
aliases = {
|
2022-11-09 11:35:28 +00:00
|
|
|
a = "add";
|
|
|
|
c = "commit";
|
|
|
|
ca = "commit --ammend";
|
|
|
|
cm = "commit -m";
|
|
|
|
lol = "log --graph --decorate --pretty=oneline --abbrev-commit";
|
|
|
|
lola = "log --graph --decorate --pretty=oneline --abbrev-commit --all";
|
|
|
|
sts = "status";
|
2022-11-06 20:23:10 +00:00
|
|
|
};
|
2022-11-23 23:40:33 +00:00
|
|
|
# No idea why this is not appearing in home-manager search
|
|
|
|
# It's in source code, though
|
2022-11-29 23:08:44 +00:00
|
|
|
userName = "pegasust";
|
|
|
|
userEmail = "pegasucksgg@gmail.com";
|
2022-11-06 20:23:10 +00:00
|
|
|
extraConfig = {
|
2022-11-09 11:35:28 +00:00
|
|
|
merge = { tool = "vimdiff"; conflictstyle = "diff3"; };
|
2022-11-06 20:23:10 +00:00
|
|
|
};
|
2022-11-22 01:24:38 +00:00
|
|
|
ignores = [
|
|
|
|
# vscode-related settings
|
|
|
|
".vscode"
|
|
|
|
# envrc cached outputs
|
|
|
|
".direnv"
|
|
|
|
];
|
|
|
|
extraConfig = {
|
|
|
|
# cache credential for 10 minutes.
|
2022-11-22 01:53:03 +00:00
|
|
|
credential.helper = "cache --timeout=600";
|
2022-11-22 01:24:38 +00:00
|
|
|
};
|
2022-11-06 20:23:10 +00:00
|
|
|
# why is this no longer valid?
|
|
|
|
# pull = { rebase=true; };
|
|
|
|
};
|
2022-11-07 18:15:34 +00:00
|
|
|
programs.ssh = {
|
|
|
|
enable = true;
|
|
|
|
forwardAgent = true;
|
|
|
|
extraConfig = builtins.readFile ../ssh/config;
|
|
|
|
};
|
2022-11-06 20:23:10 +00:00
|
|
|
}
|