Skip to content
This repository has been archived by the owner on Oct 12, 2021. It is now read-only.

Commit

Permalink
Add inline docs
Browse files Browse the repository at this point in the history
  • Loading branch information
lucperkins committed Jul 14, 2020
1 parent 0b706fc commit 0369d36
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 62 deletions.
8 changes: 8 additions & 0 deletions git.nix
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Git settings

{ config, lib, pkgs, ... }:

let
Expand All @@ -8,6 +10,8 @@ in {
enable = true;
userName = "Luc Perkins";
userEmail = "[email protected]";

# Replaces ~/.gitignore
ignores = [
".DS_Store"
".idea/"
Expand All @@ -16,6 +20,8 @@ in {
"dumb.rdb"
".elixir_ls/"
];

# Replaces aliases in ~/.gitconfig
aliases = {
bd = "branch -D";
br = "branch";
Expand All @@ -34,6 +40,8 @@ in {
whoops = "reset --hard";
wipe = "commit -s";
};

# Global Git config
extraConfig = {
core = {
editor = "vim";
Expand Down
127 changes: 68 additions & 59 deletions home.nix
Original file line number Diff line number Diff line change
@@ -1,86 +1,95 @@
{ config, lib, pkgs, ... }:

let
# Import other Nix files
baseImports = [
./git.nix
./neovim.nix
./shell.nix
./tmux.nix
];

# Handly shell command to view the dependency tree of Nix packages
depends = pkgs.writeScriptBin "depends" ''
dep=$1
nix-store --query --requisites $(which $dep)
'';


in {
# Allow non-free (as in beer) packages
nixpkgs.config.allowUnfree = true;

# Enable Home Manager
programs.home-manager.enable = true;

home.username = "lucasperkins";
home.homeDirectory = "/Users/lucasperkins";
home.stateVersion = "20.09";

# Enable the Lorri daemon
programs.lorri.enable = true;

# Pull in other config files
imports = baseImports;

# Miscellaneous packages
home.packages = with pkgs; [
adoptopenjdk-bin
bash
bat
bazel
cargo-edit
cargo-graph
crystal
curl
depends
dhall
direnv
doctl
elixir
erlang
exa
fd
fzf
gitAndTools.delta
gitAndTools.gh
go
graphviz
htop
httpie
hugo
jq
just
kubectl
kubectx
linkerd
lorri
mdcat
minikube
niv
nodejs
nushell
packer
python3
python38Packages.pip
ripgrep
ruby
rustup
sd
shards
skaffold
skim
spotify-tui
starship
tealdeer
terraform
tilt
tokei
tree
watchexec
wrangler
xsv
yarn
youtube-dl
adoptopenjdk-bin # Java
bash # /bin/bash
bat # cat replacement written in Rust
bazel # Polyglot build tool from Google
cargo-edit # Easy Rust dependency management
cargo-graph # Rust dependency graphs
crystal # Like Ruby but faster and with types
curl # An old classic
depends # Defined above
dhall # Exotic, Nix-like configuration language
direnv # Per-directory environment variables
doctl # DigitalOcean CLI tool
elixir # OTP with cool syntax
erlang # OTP with weird syntax
exa # ls replacement written in Rust
fd # find replacement written in Rust
fzf # Fuzzy finder
gitAndTools.delta # Print Git diffs
gitAndTools.gh # Official GitHub CLI tool
go # Pretty okay language
graphviz # dot
htop # Resource monitoring
httpie # Like curl but more user friendly
hugo # Best static site generator ever
jq # JSON parsing for the CLI
just # Intriguing new make replacement
kubectl # Kubernetes CLI tool
kubectx # kubectl context switching
linkerd # My favorite service mesh
lorri # nix-env for your projects
mdcat # Markdown converter/reader for the CLI
minikube # Local Kubernetes
niv # Nix dependency management
nodejs # node and npm
nushell # Experimental shell
packer # HashiCorp tool for building machine images
python3 # Have you upgraded yet???
python38Packages.pip # pip installer
ripgrep # grep replacement written in Rust
ruby # An old classic
rustup # Rust dev environment management
sd # Fancy sed replacement
shards # Package management tool for the Crystal language
skaffold # Local Kubernetes dev tool
skim # High-powered fuzzy finder written in Rust
spotify-tui # Spotify interface for the CLI
starship # Fancy shell that works with zsh
tealdeer # tldr for various shell tools
terraform # Declarative infrastructure management
tilt # Fast-paced Kubernetes development
tokei # Handy tool to see lines of code by language
tree # Should be included in macOS but it's not
watchexec # Fileystem watcher/executor useful for speedy development
wget # File getter
wrangler # CloudFlare Workers CLI tool
xsv # CSV file parsing utility
yarn # Node.js package manager
youtube-dl # Download videos
];
}
5 changes: 5 additions & 0 deletions neovim.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
# Neovim settings

{ config, lib, pkgs, ... }:

{
programs.neovim = {
enable = true;
# Sets alias vim=nvim
vimAlias = true;

# Neovim plugins
plugins = with pkgs.vimPlugins; [
ctrlp
editorconfig-vim
Expand Down
20 changes: 17 additions & 3 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,48 +1,58 @@
# Shell configuration for zsh (frequently used) and fish (used just for fun)

{ config, lib, pkgs, ... }:

let
# Set all shell aliases programatically
shellAliases = {
".j" = "just --justfile ~/.justfile --working-directory ~";
we = "watchexec";
find = "fd";
cloc = "tokei";
j = "just";
l = "exa";
ll = "ls -lh";
ls = "exa";
dk = "docker";
k = "kubectl";
dc = "docker-compose";
szsh = "source $HOME/.zshrc";
szsh = "source ~/.zshrc";
reload = "home-manager switch && source ~/.zshrc";
garbage = "nix-collect-garbage";
installed = "nix-env --query --installed";
};
in {
# Fancy filesystem navigator
programs.broot = {
enable = true;
enableFishIntegration = true;
enableZshIntegration = true;
};

# fish shell settings
programs.fish = {
inherit shellAliases;
enable = true;
};

# zsh settings
programs.zsh = {
inherit shellAliases;
enable = true;
enableAutosuggestions = true;
enableCompletion = true;
history.extended = true;

# Called whenever zsh is initialized
initExtra = ''
# Nix setup (environment variables, etc.)
if [ -e ~/.nix-profile/etc/profile.d/nix.sh ]; then
. ~/.nix-profile/etc/profile.d/nix.sh;
export NIX_PATH=$HOME/.nix-defexpr/channels''${NIX_PATH:+:}$NIX_PATH
fi # added by Nix installer
fi
# Load environment variables from a file; this approach allows me to not
# commit secrets like API keys
# commit secrets like API keys to Git
if [ -e ~/.env ]; then
source ~/.env
fi
Expand All @@ -55,8 +65,12 @@ in {
# direnv setup
eval "$(direnv hook zsh)"
# Load global justfile
alias .j='just --justfile ~/.justfile --working-directory ~'
'';

# Disable oh my zsh in favor of Starship shell
#oh-my-zsh = {
# enable = true;
# plugins = [
Expand Down
3 changes: 3 additions & 0 deletions tmux.nix
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# tmux settings

{ config, lib, pkgs, ... }:

{
Expand All @@ -8,6 +10,7 @@
keyMode = "vi";
shortcut = "b";

# Replaces ~/.tmux.conf
extraConfig = ''
set-option -g mouse on
set-option -g default-shell ''${SHELL}
Expand Down

0 comments on commit 0369d36

Please sign in to comment.