Skip to content

Instantly share code, notes, and snippets.

@wfaler
Last active April 13, 2021 19:59
Show Gist options
  • Save wfaler/b292a90b4df6882a1eda2cb18a102488 to your computer and use it in GitHub Desktop.
Save wfaler/b292a90b4df6882a1eda2cb18a102488 to your computer and use it in GitHub Desktop.
Home manager setup
{ config, pkgs, ... }:
{
nixpkgs.overlays = [ (self: super: {
jre = super.jdk11;
}) ];
nixpkgs.config.allowUnfree = true;
home.packages = [
pkgs.kubectl
pkgs.kubeval
pkgs.kubectx
pkgs.kubernetes-helm
pkgs.zsh
pkgs.oh-my-zsh
pkgs.python38
pkgs.vscode
pkgs.cloc
pkgs.direnv
pkgs.terraform_0_14
pkgs.packer
pkgs.git
pkgs.google-cloud-sdk
pkgs.awscli
pkgs.go
pkgs.cloc
pkgs.yarn
pkgs.nodejs
pkgs.sbt
];
programs.tmux = {
enable = true;
terminal = "screen";
shell = "$HOME/.nix-profile/bin/zsh";
};
programs.git = {
enable = true;
userName = "[name]";
userEmail = "[email]";
};
programs.neovim = {
enable = true;
plugins = with pkgs.vimPlugins; [
direnv-vim
vim-nix
vim-yaml
vim-json
python-mode
vim-go
vim-javascript
typescript-vim
vim-scala
nerdtree
coc-nvim
coc-metals
];
};
programs.direnv = {
enable = true;
enableZshIntegration = true;
};
programs.zsh = {
enable = true;
enableCompletion = true;
plugins = [
{
name = "zsh-nix-shell";
file = "nix-shell.plugin.zsh";
src = pkgs.fetchFromGitHub {
owner = "chisui";
repo = "zsh-nix-shell";
rev = "v0.1.0";
sha256 = "0snhch9hfy83d4amkyxx33izvkhbwmindy0zjjk28hih1a9l2jmx";
};
}
];
sessionVariables = {
NIX_PATH = "$HOME/.nix-defexpr/channels";
GOPATH = "$HOME/apps/go";
PATH = "$PATH:$HOME/.nix-profile/bin:$GOPATH/bin:$HOME/apps/bin:$HOME/apps/google-cloud-sdk";
EDITOR = "nvim";
NIXPKGS_ALLOW_UNFREE = 1;
};
shellAliases = {
vi = "nvim";
vim = "nvim";
};
initExtra = "mkdir -p $HOME/apps/go/bin && . $HOME/.nix-profile/etc/profile.d/nix.sh";
};
programs.zsh.oh-my-zsh = {
enable = true;
plugins = [ "git" "sudo" "docker" "kubectl" ];
theme = "agnoster";
};
programs.vscode = {
enable = true;
package = pkgs.vscode;
extensions = with pkgs.vscode-extensions; [
bbenoist.Nix
redhat.vscode-yaml
ms-azuretools.vscode-docker
eamodio.gitlens
golang.Go
hashicorp.terraform
davidanson.vscode-markdownlint
ms-python.vscode-pylance
ms-vscode-remote.remote-ssh
scalameta.metals
scala-lang.scala
ms-kubernetes-tools.vscode-kubernetes-tools
];
userSettings = {
"go.formatTool" = "goimports";
"go.useLanguageServer" = true;
"go.autocompleteUnimportedPackages" = true;
"editor.suggestSelection" = "first";
"vsintellicode.modify.editor.suggestSelection" = "automaticallyOverrodeDefaultValue";
"java.semanticHighlighting.enabled" = true;
"telemetry.enableTelemetry" = false;
"terminal.external.osxExec" = "iTerm.app";
"terminal.integrated.fontFamily" = "Menlo for Powerline";
"python.languageServer" = "Pylance";
"editor.columnSelection" = false;
"editor.codeActionsOnSave" = null;
"terminal.explorerKind" = "external";
"editor.tabSize" = 2;
"go.toolsManagement.autoUpdate" = true;
"terminal.integrated.shell.osx" = "/bin/zsh";
"files.exclude" = {
"**/.classpath" = true;
"**/.project" = true;
"**/.settings" = true;
"**/.factorypath" = true;
};
"files.watcherExclude" = {
"**/.bloop" = true;
"**/.metals" = true;
"**/.ammonite" = true;
};
};
keybindings = [
{
"key" = "alt+enter";
"command" = "editor.action.quickFix";
"when" = "editorHasCodeActionsProvider && editorTextFocus && !editorReadonly";
}
];
};
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
# Home Manager needs a bit of information about you and the
# paths it should manage.
home.username = "[username]";
home.homeDirectory = "[home dir path]";
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage
# when a new Home Manager release introduces backwards
# incompatible changes.
#
# You can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version
# changes in each release.
home.stateVersion = "21.05";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment