summaryrefslogtreecommitdiffstats
path: root/jeschli/2configs
diff options
context:
space:
mode:
authorjeschli <jeschli@gmail.com>2018-02-28 20:10:42 +0000
committerjeschli <jeschli@gmail.com>2018-02-28 20:10:42 +0000
commita7e49dd5fc590ba2ccb26d559d672767c87a7692 (patch)
tree3d0fb66d17085f1288037da1b4d9987fa402e40e /jeschli/2configs
parent4a2af184e6846f80b139357c6230558cd8785b10 (diff)
parent4c0d0f64ed21d3d7292bb5e8900d973e649375c1 (diff)
Merge branch 'staging/jeschli' of prism.i:stockholm into staging/jeschli
Diffstat (limited to 'jeschli/2configs')
-rw-r--r--jeschli/2configs/IM.nix56
-rw-r--r--jeschli/2configs/default.nix4
-rw-r--r--jeschli/2configs/urxvt.nix65
-rw-r--r--jeschli/2configs/vim.nix53
-rw-r--r--jeschli/2configs/virtualbox.nix23
-rw-r--r--jeschli/2configs/zsh.nix138
6 files changed, 304 insertions, 35 deletions
diff --git a/jeschli/2configs/IM.nix b/jeschli/2configs/IM.nix
new file mode 100644
index 000000000..171b78242
--- /dev/null
+++ b/jeschli/2configs/IM.nix
@@ -0,0 +1,56 @@
+with (import <stockholm/lib>);
+{ config, lib, pkgs, ... }:
+let
+ tmux = pkgs.writeDashBin "tmux" ''
+ export TERM=xterm-256color
+ exec ${pkgs.tmux}/bin/tmux -f ${pkgs.writeText "tmux.conf" ''
+ set-option -g default-terminal screen-256color
+ ''} "$@"
+ '';
+in {
+
+ services.bitlbee = {
+ enable = true;
+ portNumber = 6666;
+ plugins = [
+ pkgs.bitlbee-facebook
+ pkgs.bitlbee-steam
+ pkgs.bitlbee-discord
+ ];
+ libpurple_plugins = [ pkgs.telegram-purple ];
+ };
+
+ users.extraUsers.chat = {
+ home = "/home/chat";
+ uid = genid "chat";
+ useDefaultShell = true;
+ createHome = true;
+ openssh.authorizedKeys.keys = with config.krebs.users; [
+ jeschli.pubkey
+ jeschli-bln.pubkey
+ jeschli-brauerei.pubkey
+ ];
+ packages = [ tmux ];
+ };
+
+
+ systemd.services.chat = {
+ description = "chat environment setup";
+ after = [ "network.target" ];
+ wantedBy = [ "multi-user.target" ];
+
+ restartIfChanged = false;
+
+ path = [
+ pkgs.rxvt_unicode.terminfo
+ ];
+
+ serviceConfig = {
+ User = "chat";
+ RemainAfterExit = true;
+ Type = "oneshot";
+ ExecStart = "${tmux}/bin/tmux -2 new-session -d -s IM ${pkgs.weechat}/bin/weechat";
+ ExecStop = "${tmux}/bin/tmux kill-session -t IM";
+ };
+ };
+}
diff --git a/jeschli/2configs/default.nix b/jeschli/2configs/default.nix
index 6d788d283..5aaabe24b 100644
--- a/jeschli/2configs/default.nix
+++ b/jeschli/2configs/default.nix
@@ -4,6 +4,7 @@ with import <stockholm/lib>;
imports = [
./vim.nix
./retiolum.nix
+ ./zsh.nix
<stockholm/lass/2configs/security-workarounds.nix>
{
environment.variables = {
@@ -23,6 +24,9 @@ with import <stockholm/lib>;
proot
populate
+ # aliases
+ (writeDashBin "irc" "ssh chat@enklave -t tmux a")
+
#style
most
rxvt_unicode.terminfo
diff --git a/jeschli/2configs/urxvt.nix b/jeschli/2configs/urxvt.nix
index 69811eb0a..014918748 100644
--- a/jeschli/2configs/urxvt.nix
+++ b/jeschli/2configs/urxvt.nix
@@ -1,34 +1,39 @@
{ config, pkgs, ... }:
with import <stockholm/lib>;
-
{
- services.urxvtd.enable = true;
- krebs.xresources.enable = true;
- krebs.xresources.resources.urxvt = ''
- *foreground: rgb:a8/a8/a8
- *background: rgb:00/00/00
- *faceName: DejaVu Sans Mono
- *faceSize: 12
- *color0: rgb:00/00/00
- *color1: rgb:a8/00/00
- *color2: rgb:00/a8/00
- *color3: rgb:a8/54/00
- *color4: rgb:00/00/a8
- *color5: rgb:a8/00/a8
- *color6: rgb:00/a8/a8
- *color7: rgb:a8/a8/a8
- *color8: rgb:54/54/54
- *color9: rgb:fc/54/54
- *color10: rgb:54/fc/54
- *color11: rgb:fc/fc/54
- *color12: rgb:54/54/fc
- *color13: rgb:fc/54/fc
- *color14: rgb:54/fc/fc
- *color15: rgb:fc/fc/fc
-
- URxvt*scrollBar: false
- URxvt*urgentOnBell: true
- URxvt*font: xft:DejaVu Sans Mono:pixelsize=12
- URXvt*faceSize: 12
- '';
+ options.jeschliFontSize = mkOption {
+ type = types.int;
+ default = 12;
+ };
+ config = {
+ services.urxvtd.enable = true;
+ krebs.xresources.enable = true;
+ krebs.xresources.resources.urxvt = ''
+ *foreground: rgb:a8/a8/a8
+ *background: rgb:00/00/00
+ *faceName: DejaVu Sans Mono
+ *faceSize: ${toString config.jeschliFontSize}
+ *color0: rgb:00/00/00
+ *color1: rgb:a8/00/00
+ *color2: rgb:00/a8/00
+ *color3: rgb:a8/54/00
+ *color4: rgb:26/8b/d2
+ *color5: rgb:a8/00/a8
+ *color6: rgb:00/a8/a8
+ *color7: rgb:a8/a8/a8
+ *color8: rgb:54/54/54
+ *color9: rgb:fc/54/54
+ *color10: rgb:54/fc/54
+ *color11: rgb:fc/fc/54
+ *color12: rgb:54/54/fc
+ *color13: rgb:fc/54/fc
+ *color14: rgb:54/fc/fc
+ *color15: rgb:fc/fc/fc
+
+ URxvt*scrollBar: false
+ URxvt*urgentOnBell: true
+ URxvt*font: xft:DejaVu Sans Mono:pixelsize=${toString config.jeschliFontSize}
+ URXvt*faceSize: ${toString config.jeschliFontSize}
+ '';
+ };
}
diff --git a/jeschli/2configs/vim.nix b/jeschli/2configs/vim.nix
index ddf0f9195..c13113f1c 100644
--- a/jeschli/2configs/vim.nix
+++ b/jeschli/2configs/vim.nix
@@ -1,5 +1,6 @@
{ config, pkgs, ... }:
+with import <stockholm/lib>;
let
customPlugins.vim-javascript = pkgs.vimUtils.buildVimPlugin {
name = "vim-javascript";
@@ -19,12 +20,16 @@ let
sha256 = "1z3yhhbmbzfw68qjzyvpbmlyv2a1p814sy5q2knn04kcl30vx94a";
};
};
+
in {
environment.systemPackages = [
(pkgs.vim_configurable.customize {
name = "vim";
vimrcConfig.customRC = let
colorscheme = ''colorscheme molokai'';
+ highlightTrailingWhiteSpaces = ''
+ au Syntax * syn match Garbage containedin=ALL /\s\+$/
+ '';
setStatements = ''
set autowrite
set clipboard=unnamedplus
@@ -40,6 +45,7 @@ in {
remapStatements = ''
imap jk <Esc>
map gr :GoRun<Enter> " Map gr to execute go run
+ map tt :GoTest<Enter> " Map tt to execute go test
map nf :NERDTreeToggle<CR>
nnoremap <C-TAB> <c-w><c-w>
nnoremap <S-TAB> :bnext<CR>
@@ -58,7 +64,6 @@ in {
let g:go_list_type = "quickfix"
let g:go_metalinter_autosave = 1
let g:go_metalinter_enabled = ['vet', 'golint', 'errcheck']
- let g:syntastic_go_checkers = ['go', 'golint', 'errcheck']
let g:go_snippet_case_type = "camelcase"
let g:go_test_timeout = '10s'
let g:jsx_ext_required = 0
@@ -71,11 +76,19 @@ in {
let g:elm_format_autosave = 1
let g:elm_syntastic_show_warnings = 1
'';
-
+ in ''
+ ${colorscheme}
+ ${highlightTrailingWhiteSpaces}
+ ${remapStatements}
+ ${setStatements}
+ ${settingsForElm}
+ ${settingsForGo}
+ " dont expand tabs in go files and show it with four whitespaces.
+ autocmd BufNewFile,BufRead *.go setlocal noexpandtab tabstop=4 shiftwidth=4
+ '';
vimrcConfig.vam.knownPlugins = pkgs.vimPlugins // customPlugins;
vimrcConfig.vam.pluginDictionaries = [
- {
- names = [
+ { names = [
"ctrlp"
"easymotion"
"molokai"
@@ -85,7 +98,6 @@ in {
"Syntastic"
"undotree"
"elm-vim"
- "youcompleteme"
];
}
{ names = [ "vim-addon-nix" ]; ft_regex = "^nix\$"; }
@@ -95,4 +107,35 @@ in {
];
})
];
+
+ # set up the directories up if they are not there.
+# Needs to be changed.
+# vim = let
+# dirs = {
+# backupdir = "$HOME/.cache/vim/backup";
+# swapdir = "$HOME/.cache/vim/swap";
+# undodir = "$HOME/.cache/vim/undo";
+# };
+# files = {
+# viminfo = "$HOME/.cache/vim/info";
+# };
+#
+# mkdirs = let
+# dirOf = s: let out = concatStringsSep "/" (init (splitString "/" s));
+# in assert out != ""; out;
+# alldirs = attrValues dirs ++ map dirOf (attrValues files);
+# in unique (sort lessThan alldirs);
+# in
+# pkgs.symlinkJoin {
+# name = "vim";
+# paths = [
+# (pkgs.writeDashBin "vim" ''
+# set -efu
+# (umask 0077; exec ${pkgs.coreutils}/bin/mkdir -p ${toString mkdirs})
+# exec ${pkgs.vim}/bin/vim "$@"
+# '')
+# pkgs.vim
+# ];
+# };
+
}
diff --git a/jeschli/2configs/virtualbox.nix b/jeschli/2configs/virtualbox.nix
new file mode 100644
index 000000000..b2cb851a1
--- /dev/null
+++ b/jeschli/2configs/virtualbox.nix
@@ -0,0 +1,23 @@
+{ config, pkgs, ... }:
+
+let
+ mainUser = config.users.extraUsers.markus;
+
+in {
+ #services.virtualboxHost.enable = true;
+ virtualisation.virtualbox.host.enable = true;
+
+ users.extraUsers = {
+ virtual = {
+ name = "virtual";
+ description = "user for running VirtualBox";
+ home = "/home/virtual";
+ useDefaultShell = true;
+ extraGroups = [ "vboxusers" "audio" ];
+ createHome = true;
+ };
+ };
+ security.sudo.extraConfig = ''
+ ${mainUser.name} ALL=(virtual) NOPASSWD: ALL
+ '';
+}
diff --git a/jeschli/2configs/zsh.nix b/jeschli/2configs/zsh.nix
new file mode 100644
index 000000000..be5b661b4
--- /dev/null
+++ b/jeschli/2configs/zsh.nix
@@ -0,0 +1,138 @@
+{ config, lib, pkgs, ... }:
+{
+ environment.systemPackages = [ pkgs.fzf ];
+ programs.zsh = {
+ enable = true;
+ shellInit = ''
+ #disable config wizard
+ zsh-newuser-install() { :; }
+ '';
+ interactiveShellInit = ''
+ setopt autocd extendedglob
+ bindkey -e
+
+ #history magic
+ bindkey "" up-line-or-local-history
+ bindkey "" down-line-or-local-history
+
+ up-line-or-local-history() {
+ zle set-local-history 1
+ zle up-line-or-history
+ zle set-local-history 0
+ }
+ zle -N up-line-or-local-history
+ down-line-or-local-history() {
+ zle set-local-history 1
+ zle down-line-or-history
+ zle set-local-history 0
+ }
+ zle -N down-line-or-local-history
+
+ setopt share_history
+ setopt hist_ignore_dups
+ # setopt inc_append_history
+ bindkey '^R' history-incremental-search-backward
+
+ #C-x C-e open line in editor
+ autoload -z edit-command-line
+ zle -N edit-command-line
+ bindkey "^X^E" edit-command-line
+
+ #fzf inclusion
+ source ${pkgs.fzf}/share/fzf/completion.zsh
+ source ${pkgs.fzf}/share/fzf/key-bindings.zsh
+
+ #completion magic
+ autoload -Uz compinit
+ compinit
+ zstyle ':completion:*' menu select
+
+ #enable automatic rehashing of $PATH
+ zstyle ':completion:*' rehash true
+
+ eval $(dircolors -b ${pkgs.fetchFromGitHub {
+ owner = "trapd00r";
+ repo = "LS_COLORS";
+ rev = "master";
+ sha256="05lh5w3bgj9h8d8lrbbwbzw8788709cnzzkl8yh7m1dawkpf6nlp";
+ }}/LS_COLORS)
+
+ #beautiful colors
+ alias ls='ls --color'
+ # zstyle ':completion:*:default' list-colors ''${(s.:.)LS_COLORS}
+
+ #emacs bindings
+ bindkey "[7~" beginning-of-line
+ bindkey "[8~" end-of-line
+ bindkey "Oc" emacs-forward-word
+ bindkey "Od" emacs-backward-word
+
+ #aliases
+ alias ll='ls -l'
+ alias la='ls -la'
+
+ #fancy window title magic
+ '';
+ promptInit = ''
+ # TODO: figure out why we need to set this here
+ HISTSIZE=900001
+ HISTFILESIZE=$HISTSIZE
+ SAVEHIST=$HISTSIZE
+
+ autoload -U promptinit
+ promptinit
+
+ p_error='%(?..%F{red}%?%f )'
+ t_error='%(?..%? )'
+
+ case $UID in
+ 0)
+ p_username='%F{red}root%f'
+ t_username='root'
+ ;;
+ 1337)
+ p_username=""
+ t_username=""
+ ;;
+ *)
+ p_username='%F{blue}%n%f'
+ t_username='%n'
+ ;;
+ esac
+
+ if test -n "$SSH_CLIENT"; then
+ p_hostname='@%F{magenta}%M%f '
+ t_hostname='@%M '
+ else
+ p_hostname=""
+ t_hostname=""
+ fi
+
+ #check if in nix shell
+ if test -n "$buildInputs"; then
+ p_nixshell='%F{green}[s]%f '
+ t_nixshell='[s] '
+ else
+ p_nixshell=""
+ t_nixshell=""
+ fi
+
+ PROMPT="$p_error$p_username$p_hostname$p_nixshell%~ "
+ TITLE="$t_error$t_username$t_hostname$t_nixshell%~"
+ case $TERM in
+ (*xterm* | *rxvt*)
+ function precmd {
+ PROMPT_EVALED="$(print -P $TITLE)"
+ echo -ne "\033]0;$$ $PROMPT_EVALED\007"
+ }
+ # This is seen while the shell waits for a command to complete.
+ function preexec {
+ PROMPT_EVALED="$(print -P $TITLE)"
+ echo -ne "\033]0;$$ $PROMPT_EVALED $1\007"
+ }
+ ;;
+ esac
+ '';
+ };
+ users.defaultUserShell = "/run/current-system/sw/bin/zsh";
+}