summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2018-05-21 16:44:47 -0700
committerBen Sima <ben@bsima.me>2018-05-21 16:44:47 -0700
commit10af53f0094ccc74d818dc2fff101363e3da0995 (patch)
treee522ec2799740373126db62b78daf3daa0d97efc
parent6e536c4a6966b5b8c6508191d79e9574d4df44bf (diff)
Reorganize stuff into files
-rw-r--r--emacs-packages.nix64
-rw-r--r--home.nix282
-rw-r--r--packages.nix42
-rw-r--r--setpath.sh16
-rw-r--r--vim.nix43
5 files changed, 232 insertions, 215 deletions
diff --git a/emacs-packages.nix b/emacs-packages.nix
new file mode 100644
index 0000000..c57c499
--- /dev/null
+++ b/emacs-packages.nix
@@ -0,0 +1,64 @@
+{ epkgs }:
+
+with epkgs;
+
+[
+ace-window
+ag
+avy
+bbdb
+cider
+circe
+clj-refactor
+clojure-mode
+company
+counsel
+counsel-dash
+counsel-projectile
+define-word
+diminish
+dired-narrow
+editorconfig
+emojify
+#eww
+#eww-lnum
+git-gutter-plus
+git-timemachine
+haskell-mode
+#hindent-mode
+hlint-refactor
+#hoon-mode
+#ibuffer
+ibuffer-vc
+#indent-guide-mode
+ivy
+#link-hint # FIXME
+lispy
+magit
+markdown-mode
+multiple-cursors
+neotree
+nix-mode
+nix-mode
+org-bullets
+org-plus-contrib
+org-pomodoro
+org-super-agenda
+org-trello
+pass
+projectile
+racket-mode
+restclient
+s
+shakespeare-mode
+#sky-color-clock
+smart-mode-line
+solarized-theme
+swiper
+sx
+undo-tree
+wakatime-mode
+which-key
+yaml-mode
+yasnippet
+]
diff --git a/home.nix b/home.nix
index 1a45c3f..a76d01d 100644
--- a/home.nix
+++ b/home.nix
@@ -1,45 +1,7 @@
{ pkgs, ... }:
{
- home.packages = [
- pkgs.ag
- pkgs.cabal2nix
- pkgs.cloc
- pkgs.dict
- pkgs.entr
- pkgs.exercism
- pkgs.fasd
- pkgs.file
- pkgs.gimp
- pkgs.jq
- pkgs.keepassx
- pkgs.keybase
- pkgs.keybase-gui
- pkgs.mononoki
- pkgs.mplayer
- pkgs.mpv
- pkgs.offlineimap
- pkgs.pass
- pkgs.pavucontrol
- pkgs.pinentry
- pkgs.qtpass
- pkgs.racket
- pkgs.ranger
- pkgs.ripgrep
- pkgs.scrot
- pkgs.shutter
- pkgs.stack2nix
- pkgs.tdesktop
- pkgs.transmission-gtk
- pkgs.tree
- pkgs.unrar
- pkgs.vlc
- pkgs.vpnc
- pkgs.w3m
- pkgs.wakatime
- pkgs.yank
- pkgs.youtube-dl
- ];
+ home.packages = import ./packages.nix { inherit pkgs; };
fonts.fontconfig.enableProfileFonts = true;
@@ -60,6 +22,8 @@
);
};
+ services.network-manager-applet.enable = true;
+
services.polybar = {
enable = false;
script = "polybar bar &";
@@ -80,7 +44,7 @@
};
};
};
-
+
services.taffybar = {
enable = true;
};
@@ -100,185 +64,75 @@
};
};
- programs.git = {
- enable = true;
- userName = "Ben Sima";
- userEmail = "ben@bsima.me";
- extraConfig = ''
-[push]
-default = simple
-[commit]
-template = ~/.config/nixpkgs/git-commit-template
- '';
- };
+ programs = {
+ home-manager = {
+ enable = true;
+ path = https://github.com/rycee/home-manager/archive/release-18.03.tar.gz;
+ };
- programs.bash = {
- enable = true;
- shellAliases = {
- ll = "ls -l";
- a = "fasd -a"; # any
- s = "fasd -si"; # show / search / select
- d = "fasd -d"; # directory
- f = "fasd -f"; # file
- sd = "fasd -sid"; # interactive directory selection
- sf = "fasd -sif"; # interactive file selection
- #z = "fasd_cd -d"; # cd, same functionality as j in autojump
- #zz = "fasd_cd -d -i"; # cd with interactive selection
- g = "grep -in";
- rm = "rm -i";
- ddate = "date +%Y.%m.%d";
- tdate = "date +%Y.%m.%d..%H.%M";
- ttime = "date +%H.%M";
- day = "date +%a";
- dday = "date +%A";
- gl = "git pull --prune";
- glog = ''git log --graph --pretty=format:"%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset" --abbrev-commit --date=relative'';
- gp = "git push origin HEAD";
- gd = "git diff";
- gc = "git commit";
- gca = "git commit -a";
- gco = "git checkout";
- gb = "git branch";
- gs = "git status -sb";
- # super handy when working with lots of repos
- gsdir = ''for d in */; do cd $d && echo "$d" && git status -sb ; echo ; cd .. ; done'';
- pull = "git pull";
- ci = "git commit";
- st = "git status";
- fetch = "git fetch";
- push = "git push";
- # Two aliases for adding files. The first ignores delete files, the second
- # includes them.
- add = "git add --ignore-removal";
- ga = "git add -A";
+ vim = import ./vim.nix;
+
+ git = {
+ enable = true;
+ userName = "Ben Sima";
+ userEmail = "ben@bsima.me";
+ extraConfig = ''
+ [push]
+ default = simple
+ [commit]
+ template = ~/.config/nixpkgs/git-commit-template
+ '';
};
- profileExtra = ''
-OLDPATH=$PATH
-for DIR in \
- $HOME/bin \
- $HOME/me/bin \
- $HOME/.local/bin
-do
- if [ -d $DIR ]
- then
- PATH=$DIR:$PATH
- fi
-done
-[[ -f ~/.nix-profile/etc/profile.d/nix.sh ]] && . ~/.nix-profile/etc/profile.d/nix.sh
- '';
- };
- programs.emacs = {
- enable = true;
- extraPackages = epkgs: with epkgs; [
- ace-window
- ag
- avy
- bbdb
- cider
- circe
- clj-refactor
- clojure-mode
- company
- counsel
- counsel-dash
- counsel-projectile
- define-word
- diminish
- dired-narrow
- editorconfig
- emojify
- #eww
- #eww-lnum
- git-gutter-plus
- git-timemachine
- haskell-mode
- #hindent-mode
- hlint-refactor
- #hoon-mode
- #ibuffer
- ibuffer-vc
- #indent-guide-mode
- ivy
- #link-hint # FIXME
- lispy
- magit
- markdown-mode
- multiple-cursors
- neotree
- nix-mode
- nix-mode
- org-bullets
- org-plus-contrib
- org-pomodoro
- org-super-agenda
- org-trello
- pass
- projectile
- racket-mode
- restclient
- s
- shakespeare-mode
- #sky-color-clock
- smart-mode-line
- solarized-theme
- swiper
- sx
- undo-tree
- wakatime-mode
- which-key
- yaml-mode
- yasnippet
- ];
- };
+ bash = {
+ enable = true;
+ shellAliases = {
+ #z = "fasd_cd -d"; # cd, same functionality as j in autojump
+ #zz = "fasd_cd -d -i"; # cd with interactive selection
+ a = "fasd -a"; # any
+ add = "git add --ignore-removal";
+ ci = "git commit";
+ d = "fasd -d"; # directory
+ day = "date +%a";
+ ddate = "date +%Y.%m.%d";
+ dday = "date +%A";
+ f = "fasd -f"; # file
+ fetch = "git fetch";
+ g = "grep -in";
+ ga = "git add -A";
+ gb = "git branch";
+ gc = "git commit";
+ gca = "git commit -a";
+ gco = "git checkout";
+ gd = "git diff";
+ gl = "git pull --prune";
+ glog = ''git log --graph --pretty=format:"%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset" --abbrev-commit --date=relative'';
+ gp = "git push origin HEAD";
+ gs = "git status -sb";
+ gsdir = ''for d in */; do cd $d && echo "$d" && git status -sb ; echo ; cd .. ; done'';
+ ll = "ls -l";
+ pull = "git pull";
+ push = "git push";
+ rm = "rm -i";
+ s = "fasd -si"; # show / search / select
+ sd = "fasd -sid"; # interactive directory selection
+ sf = "fasd -sif"; # interactive file selection
+ st = "git status";
+ tdate = "date +%Y.%m.%d..%H.%M";
+ ttime = "date +%H.%M";
+ };
+ profileExtra = builtins.readFile (./setpath.sh);
+ };
- programs.vim = {
- enable = true;
- plugins = [
- "colors-solarized"
- "fugitive"
- ];
- settings = {
- ignorecase = true;
- expandtab = true;
- history = 1000;
- tabstop = 4;
+ emacs = {
+ enable = true;
+ extraPackages = epkgs: import ./emacs-packages.nix { inherit epkgs; };
};
- extraConfig = ''
- " Auto-switch theme
- let hour = strftime("%H")
- if 6 <= hour && hour < 18
- set background=light
- else
- set background=dark
- endif
- colorscheme solarized
- filetype plugin indent on
- set cuc cul " Crosshair
- set cc=80 " 80 column lines
- set linebreak " Break lines at word (requires Wrap lines)
- set showbreak= " Wrap-broken line prefix
- set textwidth=80 " Line wrap (number of cols)
- set showmatch " Highlight matching brace
- set visualbell " Use visual bell (no beeping)
- set hlsearch " Highlight all search results
- set smartcase " Enable smart-case search
- set incsearch " Searches for strings incrementally
- ret autoindent " Auto-indent new lines
- set shiftwidth=4 " Number of auto-indent spaces
- set smartindent " Enable smart-indent
- set smarttab " Enable smart-tabs
- set ruler " Show row and column ruler information
- set backspace=indent,eol,start " Backspace behaviour
- imap fd <Esc>
- set wildmenu " cool menu effect
- set mouse=a
- '';
- };
- programs.firefox = {
- enable = true;
- enableIcedTea = true;
+ firefox = {
+ enable = true;
+ enableIcedTea = true;
+ };
};
services.gpg-agent = {
@@ -287,6 +141,4 @@ done
enableSshSupport = true;
};
- programs.home-manager.enable = true;
- programs.home-manager.path = https://github.com/rycee/home-manager/archive/release-18.03.tar.gz;
}
diff --git a/packages.nix b/packages.nix
new file mode 100644
index 0000000..1827eb3
--- /dev/null
+++ b/packages.nix
@@ -0,0 +1,42 @@
+{ pkgs }:
+
+[
+pkgs.ag
+pkgs.cabal2nix
+pkgs.cloc
+pkgs.dict
+pkgs.entr
+pkgs.exercism
+pkgs.fasd
+pkgs.file
+pkgs.gimp
+pkgs.jq
+pkgs.keepassx
+pkgs.keybase
+pkgs.keybase-gui
+pkgs.mononoki
+pkgs.mplayer
+pkgs.mpv
+pkgs.networkmanager_vpnc
+pkgs.offlineimap
+pkgs.pass
+pkgs.pavucontrol
+pkgs.pinentry
+pkgs.qtpass
+pkgs.racket
+pkgs.ranger
+pkgs.ripgrep
+pkgs.scrot
+pkgs.shutter
+pkgs.stack2nix
+pkgs.tdesktop
+pkgs.transmission-gtk
+pkgs.tree
+pkgs.unrar
+pkgs.vlc
+pkgs.vpnc
+pkgs.w3m
+pkgs.wakatime
+pkgs.yank
+pkgs.youtube-dl
+]
diff --git a/setpath.sh b/setpath.sh
new file mode 100644
index 0000000..29b94ea
--- /dev/null
+++ b/setpath.sh
@@ -0,0 +1,16 @@
+#!/usr/bin/env sh
+
+# add some useful stuff to my path (if present)
+OLDPATH=$PATH
+for DIR in \
+ $HOME/bin \
+ $HOME/me/bin \
+ $HOME/.local/bin
+do
+ if [ -d $DIR ] then
+ PATH=$DIR:$PATH
+ fi
+done
+
+# source nix.sh if present
+[[ -f ~/.nix-profile/etc/profile.d/nix.sh ]] && . ~/.nix-profile/etc/profile.d/nix.sh
diff --git a/vim.nix b/vim.nix
new file mode 100644
index 0000000..dbb1a9c
--- /dev/null
+++ b/vim.nix
@@ -0,0 +1,43 @@
+{
+ enable = true;
+ plugins = [
+ "colors-solarized"
+ "fugitive"
+ ];
+ settings = {
+ ignorecase = true;
+ expandtab = true;
+ history = 1000;
+ tabstop = 4;
+ };
+ extraConfig = ''
+ " Auto-switch theme
+ let hour = strftime("%H")
+ if 6 <= hour && hour < 18
+ set background=light
+ else
+ set background=dark
+ endif
+ colorscheme solarized
+ filetype plugin indent on
+ set cuc cul " Crosshair
+ set cc=80 " 80 column lines
+ set linebreak " Break lines at word (requires Wrap lines)
+ set showbreak= " Wrap-broken line prefix
+ set textwidth=80 " Line wrap (number of cols)
+ set showmatch " Highlight matching brace
+ set visualbell " Use visual bell (no beeping)
+ set hlsearch " Highlight all search results
+ set smartcase " Enable smart-case search
+ set incsearch " Searches for strings incrementally
+ ret autoindent " Auto-indent new lines
+ set shiftwidth=4 " Number of auto-indent spaces
+ set smartindent " Enable smart-indent
+ set smarttab " Enable smart-tabs
+ set ruler " Show row and column ruler information
+ set backspace=indent,eol,start " Backspace behaviour
+ imap fd <Esc>
+ set wildmenu " cool menu effect
+ set mouse=a
+ '';
+}