dotfiles/home-nix/home.nix

148 lines
3.9 KiB
Nix
Raw Normal View History

# myHome is injected from extraSpecialArgs in flake.nix
2022-11-09 11:35:28 +00:00
{ config
, pkgs
, myHome
, ...
}:
2022-11-06 20:23:10 +00:00
{
home = {
username = myHome.username;
homeDirectory = myHome.homeDirectory;
stateVersion = myHome.stateVersion or "22.05";
};
2022-11-06 22:22:09 +00:00
home.packages = [
2022-11-09 11:35:28 +00:00
pkgs.htop
pkgs.ripgrep
pkgs.gcc
pkgs.fd
pkgs.zk
pkgs.unzip
pkgs.rust-bin.nightly.latest.default
pkgs.nodejs-18_x
pkgs.rust-analyzer
pkgs.stdenv.cc.cc.lib
2022-11-09 13:00:23 +00:00
pkgs.yq
2022-11-09 15:35:44 +00:00
pkgs.python39Full
pkgs.xorg.xclock # TODO: only include if have GL
pkgs.logseq # TODO: only include if have GL
2022-11-14 07:50:02 +00:00
pkgs.mosh
pkgs.nixops_unstable # nixops v2
2022-11-23 23:43:44 +00:00
pkgs.lynx
# pkgs.tailscale # VPC;; This should be installed in system-nix
2022-11-14 07:50:02 +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-09 11:35:28 +00:00
] ++ (myHome.packages or [ ]);
2022-11-06 20:23:10 +00:00
nixpkgs.config.allowUnfree = true;
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;
};
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
};
# nix: Propagates the environment with packages and vars when enter (children of)
# a directory with shell.nix-compatible and .envrc
programs.direnv = {
enable = true;
nix-direnv.enable = true;
};
# z <path> as smarter cd
2022-11-06 22:22:09 +00:00
programs.zoxide = {
enable = true;
enableZshIntegration = true;
};
programs.tmux = {
enable = true;
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;
programs.neovim = {
enable = true;
viAlias = true;
vimAlias = true;
2022-11-22 01:53:03 +00:00
withPython3 = true;
withNodeJs = true;
2022-11-06 20:23:10 +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
# 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
};
# No idea why this is not appearing in home-manager search
# It's in source code, though
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; };
};
programs.ssh = {
enable = true;
forwardAgent = true;
extraConfig = builtins.readFile ../ssh/config;
};
2022-11-06 20:23:10 +00:00
}