summaryrefslogtreecommitdiffstats
path: root/jeschli/2configs
diff options
context:
space:
mode:
Diffstat (limited to 'jeschli/2configs')
-rw-r--r--jeschli/2configs/IM.nix56
-rw-r--r--jeschli/2configs/default.nix5
-rw-r--r--jeschli/2configs/os-templates/CentOS-7-64bit.nix16
-rw-r--r--jeschli/2configs/retiolum.nix4
-rw-r--r--jeschli/2configs/vim.nix148
-rw-r--r--jeschli/2configs/virtualbox.nix23
6 files changed, 196 insertions, 56 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 7fb240951..0ac3708bb 100644
--- a/jeschli/2configs/default.nix
+++ b/jeschli/2configs/default.nix
@@ -4,6 +4,7 @@ with import <stockholm/lib>;
imports = [
./vim.nix
./retiolum.nix
+ <stockholm/lass/2configs/security-workarounds.nix>
{
environment.variables = {
NIX_PATH = mkForce "secrets=/var/src/stockholm/null:/var/src";
@@ -22,6 +23,9 @@ with import <stockholm/lib>;
proot
populate
+ # aliases
+ (writeDashBin "irc" "ssh chat@enklave -t tmux a")
+
#style
most
rxvt_unicode.terminfo
@@ -63,4 +67,5 @@ with import <stockholm/lib>;
];
krebs.enable = true;
+ networking.hostName = config.krebs.build.host.name;
}
diff --git a/jeschli/2configs/os-templates/CentOS-7-64bit.nix b/jeschli/2configs/os-templates/CentOS-7-64bit.nix
new file mode 100644
index 000000000..fb34e94e2
--- /dev/null
+++ b/jeschli/2configs/os-templates/CentOS-7-64bit.nix
@@ -0,0 +1,16 @@
+_:
+
+{
+ imports = [ <nixpkgs/nixos/modules/profiles/qemu-guest.nix> ];
+
+ boot.loader.grub = {
+ device = "/dev/sda";
+ splashImage = null;
+ };
+ boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "sd_mod" "sr_mod" ];
+
+ fileSystems."/" = {
+ device = "/dev/sda1";
+ fsType = "ext4";
+ };
+}
diff --git a/jeschli/2configs/retiolum.nix b/jeschli/2configs/retiolum.nix
index 403300b30..b611cbe7d 100644
--- a/jeschli/2configs/retiolum.nix
+++ b/jeschli/2configs/retiolum.nix
@@ -9,6 +9,7 @@
"gum"
"ni"
"dishfire"
+ "enklave"
];
};
@@ -16,6 +17,9 @@
tinc = pkgs.tinc_pre;
};
+ networking.firewall.allowedTCPPorts = [ 655 ];
+ networking.firewall.allowedUDPPorts = [ 655 ];
+
environment.systemPackages = [
pkgs.tinc
];
diff --git a/jeschli/2configs/vim.nix b/jeschli/2configs/vim.nix
index 1a2231a86..65ce7dfa4 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";
@@ -16,72 +17,76 @@ let
owner = "mxw";
repo = "vim-jsx";
rev = "5b968dfa512c57c38ad7fe420f3e8ab75a73949a";
- sha256 = "1z3yhhbmbzfw68qjzyvpbmlyv2a1p814sy5q2knn04kcl30vx94a";
+ sha256 = "1z3yhhbmbzfw68qjzyvpbmlyv2a1p814sy5q2knn04kcl30vx94a";
};
};
in {
-# {
environment.systemPackages = [
(pkgs.vim_configurable.customize {
name = "vim";
-
- vimrcConfig.customRC = ''
- set nocompatible
-
- :imap jk <Esc>
- :vmap v v
- :map gr :GoRun<Enter>
- :nnoremap <S-TAB> :bnext<CR>
- :nnoremap <C-TAB> <c-w><c-w>
- :map nf :NERDTreeToggle<CR>
- set autowrite
- set number
- set ruler
- set path+=**
- set wildmenu
-
- noremap x "_x
- set clipboard=unnamedplus
-
- let g:jsx_ext_required = 0
-
- let g:go_list_type = "quickfix"
- let g:go_test_timeout = '10s'
- let g:go_fmt_command = "goimports"
- let g:go_snippet_case_type = "camelcase"
- let g:go_highlight_types = 1
- let g:go_highlight_fields = 1
- let g:go_highlight_functions = 1
- let g:go_highlight_methods = 1
- let g:go_highlight_extra_types = 1
- autocmd BufNewFile,BufRead *.go setlocal noexpandtab tabstop=4 shiftwidth=4
- let g:rehash256 = 1
- let g:molokai_original = 1
- colorscheme molokai
- let g:go_metalinter_enabled = ['vet', 'golint', 'errcheck']
- let g:go_metalinter_autosave = 1
- " let g:go_metalinter_autosave_enabled = ['vet', 'golint']
- " let g:go_def_mode = 'godef'
- " let g:go_decls_includes = "func,type"
-
-
- " Trigger configuration. Do not use <tab> if you use https://github.com/Valloric/YouCompleteMe.
- let g:UltiSnipsExpandTrigger="<c-e>"
- let g:UltiSnipsJumpForwardTrigger="<c-t>"
- let g:UltiSnipsJumpBackwardTrigger="<c-q>"
-
- " If you want :UltiSnipsEdit to split your window.
- let g:UltiSnipsEditSplit="vertical"
-
- if has('persistent_undo') "check if your vim version supports it
- set undofile "turn on the feature
- set undodir=$HOME/.vim/undo "directory where the undo files will be stored
- endif
+ vimrcConfig.customRC = let
+ colorscheme = ''colorscheme molokai'';
+ setStatements = ''
+ set autowrite
+ set clipboard=unnamedplus
+ set nocompatible
+ set path+=**
+ set ruler
+ set undodir=$HOME/.vim/undo "directory where the undo files will be stored
+ set undofile "turn on the feature
+ set wildignore+=*.o,*.class,*.hi,*.dyn_hi,*.dyn_o
+ set wildmenu
+ set listchars=trail:ΒΆ
+ '';
+ remapStatements = ''
+ imap jk <Esc>
+ map gr :GoRun<Enter> " Map gr to execute go run
+ map nf :NERDTreeToggle<CR>
+ nnoremap <C-TAB> <c-w><c-w>
+ nnoremap <S-TAB> :bnext<CR>
+ noremap x "_x
+ vmap v v
+ '';
+ settingsForGo = ''
+ let g:go_decls_includes = "func,type"
+ let g:go_def_mode = 'godef'
+ let g:go_fmt_command = "goimports"
+ let g:go_highlight_extra_types = 1
+ let g:go_highlight_fields = 1
+ let g:go_highlight_functions = 1
+ let g:go_highlight_methods = 1
+ let g:go_highlight_types = 1
+ let g:go_list_type = "quickfix"
+ let g:go_metalinter_autosave = 1
+ let g:go_metalinter_enabled = ['vet', 'golint', 'errcheck']
+ let g:go_snippet_case_type = "camelcase"
+ let g:go_test_timeout = '10s'
+ let g:jsx_ext_required = 0
+ let g:molokai_original = 1
+ let g:rehash256 = 1
'';
+ in ''
+ ${colorscheme}
+ ${remapStatements}
+ ${setStatements}
+ ${settingsForGo}
+ " I dont know what this line is about
+ autocmd BufNewFile,BufRead *.go setlocal noexpandtab tabstop=4 shiftwidth=4
+ '';
vimrcConfig.vam.knownPlugins = pkgs.vimPlugins // customPlugins;
vimrcConfig.vam.pluginDictionaries = [
- { names = [ "undotree" "molokai" "Syntastic" "ctrlp" "surround" "snipmate" "nerdtree" "easymotion"]; }
+ { names = [
+ "ctrlp"
+ "easymotion"
+ "molokai"
+ "nerdtree"
+ "snipmate"
+ "surround"
+ "Syntastic"
+ "undotree"
+ ];
+ }
{ names = [ "vim-addon-nix" ]; ft_regex = "^nix\$"; }
{ names = [ "vim-go" ]; ft_regex = "^go\$"; } # wanted: nsf/gocode
{ names = [ "vim-javascript" ]; ft_regex = "^js\$"; }
@@ -89,4 +94,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
+ '';
+}