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
|
2022-12-05 07:42:20 +00:00
|
|
|
, lib
|
2022-11-09 11:35:28 +00:00
|
|
|
, pkgs
|
2022-12-05 07:42:20 +00:00
|
|
|
, my-pkgs ? []
|
|
|
|
, myLib ? []
|
|
|
|
, extraPackages ? []
|
|
|
|
, shellInitExtra ? ""
|
|
|
|
, shellAliases ? {}
|
2022-11-09 11:35:28 +00:00
|
|
|
, ...
|
|
|
|
}:
|
2022-12-03 06:43:44 +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
|
|
|
|
# pkgs.sumneko-lua-language-server
|
|
|
|
pkgs.ripgrep
|
|
|
|
pkgs.zk
|
|
|
|
pkgs.fd
|
|
|
|
pkgs.stdenv.cc.cc.lib
|
|
|
|
# Python3 as alternative to bash scripts :^)
|
|
|
|
# (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
|
2022-12-03 10:08:54 +00:00
|
|
|
# pypkgs.ujson # pylsp seems to rely on this. satisfy it lol
|
2022-12-03 06:43:44 +00:00
|
|
|
# ]))
|
|
|
|
];
|
|
|
|
proj_root = builtins.toString ./../..;
|
2022-12-05 07:42:20 +00:00
|
|
|
_my-pkgs = import my-pkgs { inherit pkgs; lib = pkgs.lib // my-pkgs.lib // myLib; };
|
2022-12-03 06:43:44 +00:00
|
|
|
in
|
2022-11-06 20:23:10 +00:00
|
|
|
{
|
2022-12-05 07:42:20 +00:00
|
|
|
# config = {
|
|
|
|
# # my-pkgs = mkOption {
|
|
|
|
# # type = ;
|
|
|
|
# # default = {};
|
|
|
|
# # example = {};
|
|
|
|
# # description = "TODO: complete the type to get every other fields";
|
|
|
|
# # };
|
|
|
|
# };
|
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-12-05 07:42:20 +00:00
|
|
|
] ++ (extraPackages) ++ nvim_pkgs);
|
2022-11-06 20:23:10 +00:00
|
|
|
|
2022-11-06 22:22:09 +00:00
|
|
|
## Configs ##
|
2022-12-03 06:43:44 +00:00
|
|
|
xdg.configFile."nvim/init.lua".text = builtins.readFile "${proj_root}//neovim/init.lua";
|
|
|
|
xdg.configFile."starship.toml".text = builtins.readFile "${proj_root}//starship/starship.toml";
|
2022-12-03 10:08:54 +00:00
|
|
|
xdg.configFile."zk/config.toml".text = builtins.readFile "${proj_root}//zk/config.toml";
|
2022-11-06 22:22:09 +00:00
|
|
|
|
|
|
|
## Programs ##
|
2022-11-09 13:00:23 +00:00
|
|
|
programs.jq = {
|
|
|
|
enable = true;
|
|
|
|
};
|
2022-12-05 07:42:20 +00:00
|
|
|
programs.alacritty = {
|
2022-11-07 15:23:25 +00:00
|
|
|
enable = true;
|
2022-12-05 07:42:20 +00:00
|
|
|
# settings = builtins.fromJSON (builtins.readFile "${_my-pkgs.dot-hwtr}/alacritty/alacritty.json");
|
2022-12-03 06:43:44 +00:00
|
|
|
# settings = myLib.fromYaml (builtins.readFile "${proj_root}/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-12-03 06:43:44 +00:00
|
|
|
extraConfig = builtins.readFile "${proj_root}/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;
|
2022-12-03 10:08:54 +00:00
|
|
|
extraPackages = nvim_pkgs;
|
2022-12-01 08:18:39 +00:00
|
|
|
# extraPython3Packages = (pypkgs: [
|
2022-12-03 10:08:54 +00:00
|
|
|
# # pypkgs.python-lsp-server
|
2022-12-01 08:18:39 +00:00
|
|
|
# pypkgs.ujson
|
|
|
|
# ]);
|
2022-12-01 02:17:06 +00:00
|
|
|
# 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
|
2022-12-03 06:43:44 +00:00
|
|
|
# extraConfig = builtins.readFile "${proj_root}/neovim/init.lua";
|
2022-12-01 02:17:06 +00:00
|
|
|
};
|
2022-11-10 18:42:35 +00:00
|
|
|
programs.bash = {
|
|
|
|
enable = true;
|
|
|
|
enableCompletion = true;
|
2022-12-05 07:42:20 +00:00
|
|
|
initExtra = shellInitExtra;
|
2022-11-10 18:42:35 +00:00
|
|
|
};
|
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-12-05 07:42:20 +00:00
|
|
|
} // (shellAliases);
|
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-12-05 07:42:20 +00:00
|
|
|
initExtra = shellInitExtra;
|
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";
|
2022-12-02 23:42:48 +00:00
|
|
|
ca = "commit --amend";
|
2022-11-09 11:35:28 +00:00
|
|
|
cm = "commit -m";
|
|
|
|
lol = "log --graph --decorate --pretty=oneline --abbrev-commit";
|
|
|
|
lola = "log --graph --decorate --pretty=oneline --abbrev-commit --all";
|
|
|
|
sts = "status";
|
2022-12-02 23:42:48 +00:00
|
|
|
co = "checkout";
|
|
|
|
b = "branch";
|
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 = {
|
2022-12-01 08:34:27 +00:00
|
|
|
# cache credential for 50 minutes (a pomodoro session)
|
|
|
|
credential.helper = "cache --timeout=3000";
|
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;
|
2022-12-03 06:43:44 +00:00
|
|
|
extraConfig = builtins.readFile "${proj_root}/ssh/config";
|
2022-11-07 18:15:34 +00:00
|
|
|
};
|
2022-11-06 20:23:10 +00:00
|
|
|
}
|