Skip to content

Instantly share code, notes, and snippets.

@mbbx6spp
Last active February 8, 2021 01:39
Show Gist options
  • Save mbbx6spp/6db422746c3c4f161f55 to your computer and use it in GitHub Desktop.
Save mbbx6spp/6db422746c3c4f161f55 to your computer and use it in GitHub Desktop.
My ${HOME}/.nixpkgs/config.nix to setup my dev and desktop environments the way I like them :)

User env setup

Setup your user environment just the way you want with Nix.

  1. Add packageOverrides to the attrset returned by your ${HOME}/.nixpkgs/config.nix (see my example above).

  2. Then with one command you can setup your whole environment: nix-env -i desktop-mbbx6spp.

Then all you need is a simple ~/.bash_profile script like so:

export EDITOR=vim-funops
export GIT_EDITOR=vim-funops
export DEFAULT_PROFILE=funops
export PROFILE=funops

alias vim="vim-${PROFILE}"
alias gvim="vim-${PROFILE} -g"

Boom.

Use the exact same vim config on all your development machines (requires Nix and nixpkgs).

{ pkgs }:
let
# Inherit utilities
inherit (pkgs) lib buildEnv vim_configurable;
homeDir = builtins.getEnv "HOME";
vimrcFile = "${homeDir}/.vim/global/global.vim";
vimFunops = vim_configurable.customize {
name = "vim-funops";
vimrcConfig.customRC = builtins.readFile vimrcFile + ''
let $PATH = $PATH . ':' . expand('${homeDir}/.nix-profile/bin')
'';
vimrcConfig.vam.knownPlugins = pkgs.vimPlugins;
vimrcConfig.vam.pluginDictionaries = [
{ names = [
"airline"
"align"
"calendar"
"colors-solarized"
"ctrlp"
"fugitive"
"ghcmod"
"gitgutter"
"Gist"
"haskellconceal"
"hasksyn"
"hoogle"
"idris-vim"
"latex-live-preview"
"neco-ghc"
"neocomplete"
"nerdtree"
"nerdcommenter"
#"pluginnames2nix"
"quickfixstatus"
"quickrun"
"rainbow_parentheses"
"tagbar"
"taglist"
"Syntastic"
"vim-addon-nix"
"vim-addon-syntax-checker"
"vim-addon-vim2nix"
"vim-hardtime"
"vim-snippets"
"vimproc"
"youcompleteme"
];
}
];
};
in {
allowUnfree = true;
#firefox.enableGeckoMediaPlayer = true;
firefox.enableGoogleTalkPlugin = true;
firefox.enableAdobeFlash = true;
jre = pkgs.oraclejre8;
jdk = pkgs.oraclejdk8;
packageOverrides = pkgs: {
mbbx6sppDesktop = lib.lowPrio (buildEnv {
name = "desktop-mbbx6spp";
ignoreCollisions = true;
paths = with pkgs; [
funopsEnv
conky
dmenu
dzen2
pavucontrol
chromium
firefox-wrapper
spotify
xmonad-with-packages
];
});
funopsEnv = lib.lowPrio (buildEnv {
name = "devenv-funops";
ignoreCollisions = true;
paths = with pkgs; [
# superior editor :)
vimFunops
# languages/compilers/REPLs
haskellPackages.idris
haskellPackages.ghc
haskellPackages.ghc-mod
haskellPackages.hoogle
haskellPackages.hlint
haskellPackages.pointfree
scala
clang
nix-repl
nix-prefetch-scripts
# command line utilities
ctags
gitAndTools.gitFull
gitAndTools.git-annex
gitAndTools.git-extras
gitAndTools.git2cl
gitAndTools.tig
gnupg
pwgen
qemu
silver-searcher
haskellPackages.ShellCheck
siege
openssh
tmux
tree
xsel
rxvt_unicode-with-plugins
urxvt_font_size
urxvt_perl
urxvt_perls
urxvt_tabbedex
# ncurses console "apps"
cadaver
calcurse
canto-curses
cherrytree
ctodo
davfs2
findbugs
gitinspector
hexcurse
khal
mailnag
mairix
mediainfo
moc
mp3gain
mpg123
mutt
newsbeuter
pianobar
remind
rlwrap
sipcalc
sup
typespeed # for my colemak learnings :)
weechat
];
});
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment