diff options
author | makefu <github@syntax-fehler.de> | 2019-02-26 08:58:51 +0100 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2019-02-26 08:58:51 +0100 |
commit | e437c7d17b4accf9c18d2aa17a0ec98a171d8f3f (patch) | |
tree | bbb65961d3eaaa7f14461383290db99f391bb6cb /tv/2configs | |
parent | 6da32a5952faf38c92c7b289cc6ae0881ec4aa36 (diff) | |
parent | 2db5d56cf2e252822f38900ef9436d7b118476a9 (diff) |
Merge remote-tracking branch 'lass/master'
Diffstat (limited to 'tv/2configs')
-rw-r--r-- | tv/2configs/bash/default.nix | 3 | ||||
-rw-r--r-- | tv/2configs/gitrepos.nix | 3 | ||||
-rw-r--r-- | tv/2configs/vim.nix | 68 | ||||
-rw-r--r-- | tv/2configs/xserver/default.nix | 19 |
4 files changed, 84 insertions, 9 deletions
diff --git a/tv/2configs/bash/default.nix b/tv/2configs/bash/default.nix index d7673931c..42914e060 100644 --- a/tv/2configs/bash/default.nix +++ b/tv/2configs/bash/default.nix @@ -8,6 +8,7 @@ with import <stockholm/lib>; HISTCONTROL='erasedups:ignorespace' HISTSIZE=65536 HISTFILESIZE=$HISTSIZE + HISTTIMEFORMAT= shopt -s checkhash shopt -s histappend histreedit histverify @@ -27,6 +28,8 @@ with import <stockholm/lib>; export NIX_PATH="stockholm=$HOME/stockholm:$NIX_PATH" ;; esac + + ${pkgs.bash-fzf-history.bind} ''; promptInit = /* sh */ '' case $UID in diff --git a/tv/2configs/gitrepos.nix b/tv/2configs/gitrepos.nix index 725ddefa8..95ab75b3d 100644 --- a/tv/2configs/gitrepos.nix +++ b/tv/2configs/gitrepos.nix @@ -47,6 +47,9 @@ let { disko = { cgit.desc = "declarative partitioning and formatting tool"; }; + flameshot-once = { + cgit.desc = "flameshot runner that automatically starts/stops the daemon"; + }; fswm = { cgit.desc = "simple full screen window manager"; }; diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index 3794628c1..9942ff65b 100644 --- a/tv/2configs/vim.nix +++ b/tv/2configs/vim.nix @@ -129,15 +129,65 @@ let { command! -n=0 -bar ShowSyntax :call ShowSyntax() ''; }))) + ((rtp: rtp // { inherit rtp; }) (pkgs.write "vim-tv" { + # + # Haskell + # + "/ftplugin/haskell.vim".text = '' + if exists("g:vim_tv_ftplugin_haskell_loaded") + finish + endif + let g:vim_tv_ftplugin_haskell_loaded = 1 + + setlocal iskeyword+=' + ''; + # + # TODO + # + "/ftdetect/todo.vim".text = '' + au BufRead,BufNewFile TODO set ft=todo + ''; + "/ftplugin/todo.vim".text = '' + setlocal foldmethod=syntax + ''; + "/syntax/todo.vim".text = '' + syn match Comment /#.*/ + + syn match todoDate /^[1-9]\S*/ + \ nextgroup=todoSummary + + syn region todoSummary + \ contained + \ contains=todoTag + \ start="." end="$\n" + \ nextgroup=todoBlock + + syn match todoTag /\[[A-Za-z]\+\]/hs=s+1,he=e-1 + \ contained + + syn region todoBlock + \ contained + \ contains=Comment + \ fold + \ start="^[^1-9]" end="^[1-9]"re=s-1,he=s-1,me=s-1 + + syn sync minlines=1000 + + hi todoDate ctermfg=255 + hi todoSummary ctermfg=229 + hi todoBlock ctermfg=248 + hi todoTag ctermfg=217 + ''; + })) ((rtp: rtp // { inherit rtp; }) (pkgs.write "vim-syntax-nix-nested" { - "/syntax/haskell.vim".text = /* vim */ '' + "/syntax/haskell.vim".text = '' syn region String start=+\[[[:alnum:]]*|+ end=+|]+ hi link ConId Identifier hi link VarId Identifier hi link hsDelimiter Delimiter ''; - "/syntax/nix.vim".text = /* vim */ '' + "/syntax/nix.vim".text = '' "" Quit when a (custom) syntax file was already loaded "if exists("b:current_syntax") " finish @@ -250,6 +300,9 @@ let { def = k: ''${k}[ \t\r\n]*=''; writer = k: ''write${k}[^ \t\r\n]*[ \t\r\n]*\("[^"]*"\|[a-z]\+\)''; + writerExt = k: writerName ''[^"]*\.${k}''; + writerName = k: ''write[^ \t\r\n]*[ \t\r\n]*"${k}"''; + in { c = {}; cabal = {}; @@ -257,7 +310,7 @@ let { haskell = {}; jq.extraStart = alts [ (writer "Jq") - ''write[^ \t\r\n]*[ \t\r\n]*"[^"]*\.jq"'' + (writerExt "jq") ]; javascript.extraStart = ''/\* js \*/''; lua = {}; @@ -287,8 +340,11 @@ let { (writer (alts (map capitalize shells))) ]; yaml = {}; - vim.extraStart = - ''write[^ \t\r\n]*[ \t\r\n]*"\(\([^"]*\.\)\?vimrc\|[^"]*\.vim\)"''; + vim.extraStart = alts [ + (def ''"[^"]*\.vim"\.text'') + (writerExt "vim") + (writerName ''\([^"]*\.\)\?vimrc'') + ]; xdefaults = {}; }))} @@ -329,7 +385,7 @@ let { set isk=@,48-57,_,192-255,-,' ''; - "/syntax/sed.vim".text = /* vim */ '' + "/syntax/sed.vim".text = '' syn region sedBranch \ matchgroup=sedFunction start="T" \ matchgroup=sedSemicolon end=";\|$" diff --git a/tv/2configs/xserver/default.nix b/tv/2configs/xserver/default.nix index f68e8e681..051e12ef0 100644 --- a/tv/2configs/xserver/default.nix +++ b/tv/2configs/xserver/default.nix @@ -48,10 +48,24 @@ in { systemd.services.xmonad = let xmonad = "${pkgs.haskellPackages.xmonad-tv}/bin/xmonad"; - xmonad-prepare = pkgs.writeDash "xmonad-prepare" '' + xmonad-start = pkgs.writeDash "xmonad-start" '' ${pkgs.coreutils}/bin/mkdir -p "$XMONAD_CACHE_DIR" ${pkgs.coreutils}/bin/mkdir -p "$XMONAD_CONFIG_DIR" ${pkgs.coreutils}/bin/mkdir -p "$XMONAD_DATA_DIR" + + f=$HOME/.dbus/session-bus/$(${pkgs.coreutils}/bin/cat /etc/machine-id)-${ + toString config.services.xserver.display + } + if test -e "$f" && + . "$f" && + ${pkgs.coreutils}/bin/kill -0 "$DBUS_SESSION_BUS_PID" + then + export DBUS_SESSION_BUS_ADDRESS + else + eval "$(${pkgs.dbus.lib}/bin/dbus-launch --sh-syntax)" + fi + + exec ${xmonad} ''; xmonad-ready = pkgs.writeDash "xmonad-ready" '' { @@ -97,8 +111,7 @@ in { "/run/wrappers" # for su ]; serviceConfig = { - ExecStartPre = "@${xmonad-prepare} xmonad-prepare"; - ExecStart = "@${xmonad} xmonad-${currentSystem}"; + ExecStart = "@${xmonad-start} xmonad-${currentSystem}"; ExecStop = "@${xmonad} xmonad-${currentSystem} --shutdown"; SyslogIdentifier = "xmonad"; User = cfg.user.name; |