From 93c497961a5f4717ee3e41485c4dce88425f4338 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kier=C3=A1n=20Meinhardt?= Date: Wed, 31 Oct 2018 00:48:32 +0100 Subject: [PATCH] VPN ~ move ghci dotfile + vim: black as python formatter + openvpn + wpa_supplicant_gui + dot2tex + graphviz + hlint ~ nix-shell: use zsh ~ zsh: show whether in nix-shell ~ ghci: hoogle with haddock links ~ ssh: login with hu id (no passphrase) ~ terminal: Source Code Pro --- config.nix | 2 +- configs/editors.nix | 3 ++- configs/networks.nix | 15 +++++++++++++++ configs/packages.nix | 5 +++++ configs/shells.nix | 4 ++-- dot/ghci.nix | 5 ++--- dot/ssh.nix | 1 + theme.nix | 8 ++++---- 8 files changed, 32 insertions(+), 11 deletions(-) diff --git a/config.nix b/config.nix index 97e34a5..ab20347 100644 --- a/config.nix +++ b/config.nix @@ -187,7 +187,7 @@ in { ".config/mpv/input.conf".text = import ./dot/mpv.nix; ".config/xfce4/terminal/terminalrc".text = import ./dot/terminal.nix; ".config/zathura/zathurarc".text = "set selection-clipboard clipboard"; - ".ghci".text = import ./dot/ghci.nix { inherit pkgs; }; + ".ghc/ghci.conf".text = import ./dot/ghci.nix { inherit pkgs; }; ".ssh/config".text = import ./dot/ssh.nix { inherit lib; }; ".stack/config.yaml".text = import ./dot/stack.nix { user = config.constants.user; }; ".zshrc".text = "# nothing to see here"; diff --git a/configs/editors.nix b/configs/editors.nix index a227682..0cc2bfe 100644 --- a/configs/editors.nix +++ b/configs/editors.nix @@ -96,10 +96,11 @@ let vim_conf = '' autocmd bufnewfile,bufread *.rust :packadd rust-vim deoplete-rust autocmd bufnewfile,bufread *.tex :packadd vimtex | set filetype=tex autocmd bufnewfile,bufread *.ts :packadd vim-typescript - autocmd bufnewfile,bufread *.graphql :packadd vim-graphql | set filetype=graphql + autocmd bufnewfile,bufread *.graphql :packadd vim-graphql autocmd bufnewfile,bufread config set filetype=conf autocmd filetype haskell :packadd Hoogle autocmd filetype haskell set formatprg=hindent + autocmd filetype python set formatprg=black autocmd filetype javascript *.js :packadd vim-javascript autocmd filetype make setlocal noexpandtab autocmd filetype markdown,text set formatoptions+=t diff --git a/configs/networks.nix b/configs/networks.nix index 4be88b3..dd0a459 100644 --- a/configs/networks.nix +++ b/configs/networks.nix @@ -33,4 +33,19 @@ in { "FlixBus" = {}; "FlixBus Wi-Fi" = {}; }; + + services.openvpn.servers = { + hu-berlin = { + config = ''config ${pkgs.fetchurl { + url = https://www.cms.hu-berlin.de/de/dl/netze/vpn/openvpn/hu-berlin.ovpn; + sha256 = "d61a644b1e8bd313a8c4bdf1024d8445d56d1fb4a85d2574d597fc020c4901dc"; + }} + route-nopull + route 141.20.0.0 255.255.0.0''; + authUserPass = { + username = eduroam.identity; + password = eduroam.password; + }; + }; + }; } diff --git a/configs/packages.nix b/configs/packages.nix index 0c08994..b3a56f9 100644 --- a/configs/packages.nix +++ b/configs/packages.nix @@ -59,6 +59,7 @@ with pkgs; xorg.xbacklight xorg.xcursorthemes xorg.xkill + wpa_supplicant_gui youtubeDL zathura ]; @@ -75,11 +76,13 @@ with pkgs; cloc clojure ctags + dot2tex dropbox-cli fsharp gcc ghc gnuplot + graphviz grive2 haskellPackages.ghcid haskellPackages.hakyll @@ -88,6 +91,7 @@ with pkgs; haskellPackages.hoogle haskellPackages.pandoc haskellPackages.pandoc-citeproc + hlint idris inkscape jo @@ -101,6 +105,7 @@ with pkgs; par perl python3 + python36Packages.black python36Packages.flake8 racket-minimal ruby diff --git a/configs/shells.nix b/configs/shells.nix index 4575055..8499211 100644 --- a/configs/shells.nix +++ b/configs/shells.nix @@ -5,7 +5,7 @@ in { let rlwrap = cmd: "${pkgs.rlwrap}/bin/rlwrap ${cmd}"; in { o = "xdg-open"; - n = "nix-shell"; + n = "nix-shell --command zsh"; ":r" = ''echo "You stupid!"''; clipboard = "${pkgs.xclip}/bin/xclip -se c"; external-ip = "${pkgs.dnsutils}/bin/dig +short myip.opendns.com @resolver1.opendns.com"; @@ -29,7 +29,7 @@ in { setopt PUSHD_MINUS PUSHD_TO_HOME AUTO_PUSHD ''; promptInit = '' - PROMPT="%{$fg_bold[white]%}%~ \$([[ \$? == 0 ]] && echo \"%{$fg_bold[green]%}\" || echo \"%{$fg_bold[red]%}\")%#%{$reset_color%} " + PROMPT="%{$fg_bold[white]%}%~ \$([[ \$? == 0 ]] && echo \"%{$fg_bold[green]%}\" || echo \"%{$fg_bold[red]%}\")\$(test $IN_NIX_SHELL && echo λ || echo %#)%{$reset_color%} " RPROMPT='$(git_prompt_info)' ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[cyan]%}" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" diff --git a/dot/ghci.nix b/dot/ghci.nix index b6a56a6..594fcf6 100644 --- a/dot/ghci.nix +++ b/dot/ghci.nix @@ -1,9 +1,8 @@ { pkgs }: '' :set editor vim -:def hoogle \x -> return $ ":!${pkgs.haskellPackages.hoogle}/bin/hoogle --color \"" ++ x ++ "\" " -:def doc \x -> return $ ":!${pkgs.haskellPackages.hoogle}/bin/hoogle --info --color \"" ++ x ++ "\"" -:def search \x -> return $ ":!${pkgs.haskellPackages.hoogle}/bin/hoogle --color \"" ++ x ++ "\" | head" +:def hoogle \s -> return $ ":!${pkgs.haskellPackages.hoogle}/bin/hoogle search --color -l --count=15 \"" ++ s ++ "\"" +:def doc \s -> return $ ":!${pkgs.haskellPackages.hoogle}/bin/hoogle search --color -l --info \"" ++ s ++ "\"" :def pl \x -> return $ ":!${pkgs.haskellPackages.pointfree}/bin/pointfree -v \"" ++ x ++ "\"" :def unpl \x -> return $ ":!${pkgs.haskellPackages.pointful}/bin/pointful \"" ++ x ++ "\"" :set prompt "\o033[1m%s\o033[1;34m λ\o033[0m " diff --git a/dot/ssh.nix b/dot/ssh.nix index 7236dfd..613a0d9 100644 --- a/dot/ssh.nix +++ b/dot/ssh.nix @@ -4,6 +4,7 @@ let huServer = name: '' Host ${name} User ${(import ../secrets.nix).eduroam.identity} HostName ${name}.informatik.hu-berlin.de + IdentityFile ~/.ssh/hu ''; in '' Host github diff --git a/theme.nix b/theme.nix index 7e4f485..bec73a1 100644 --- a/theme.nix +++ b/theme.nix @@ -1,10 +1,10 @@ rec { uiFont = { name = "Roboto"; size = 10; }; terminalFont = { - regular = { name = "Roboto Mono for Powerline"; }; - bold = { name = "Roboto Mono Bold for Powerline"; }; - italic = { name = "Roboto Mono Italic for Powerline"; }; - boldItalic = { name = "Roboto Mono Bold Italic for Powerline"; }; + regular = { name = "Source Code Pro for Powerline"; }; + bold = { name = "Source Code Pro Bold for Powerline"; }; + italic = { name = "Source Code Pro Italic for Powerline"; }; + boldItalic = { name = "Source Code Pro Bold Italic for Powerline"; }; size = 10; };