summaryrefslogtreecommitdiffstats
path: root/tv
diff options
context:
space:
mode:
Diffstat (limited to 'tv')
-rw-r--r--tv/1systems/nomic.nix3
-rw-r--r--tv/1systems/xu.nix3
-rw-r--r--tv/2configs/pulse.nix3
-rw-r--r--tv/2configs/vim.nix56
-rw-r--r--tv/5pkgs/default.nix3
5 files changed, 39 insertions, 29 deletions
diff --git a/tv/1systems/nomic.nix b/tv/1systems/nomic.nix
index fed67a105..3696bcdfc 100644
--- a/tv/1systems/nomic.nix
+++ b/tv/1systems/nomic.nix
@@ -47,8 +47,7 @@ with config.krebs.lib;
boot.tmpOnTmpfs = true;
environment.systemPackages = with pkgs; [
- (writeScriptBin "play" ''
- #! /bin/sh
+ (writeDashBin "play" ''
set -euf
mpv() { exec ${mpv}/bin/mpv "$@"; }
case $1 in
diff --git a/tv/1systems/xu.nix b/tv/1systems/xu.nix
index a79ae498b..6ba7ab327 100644
--- a/tv/1systems/xu.nix
+++ b/tv/1systems/xu.nix
@@ -26,8 +26,7 @@ with config.krebs.lib;
hashPassword
haskellPackages.lentil
parallel
- (pkgs.writeScriptBin "im" ''
- #! ${pkgs.bash}/bin/bash
+ (pkgs.writeBashBin "im" ''
export PATH=${makeSearchPath "bin" (with pkgs; [
tmux
gnugrep
diff --git a/tv/2configs/pulse.nix b/tv/2configs/pulse.nix
index 8e611f21e..512919759 100644
--- a/tv/2configs/pulse.nix
+++ b/tv/2configs/pulse.nix
@@ -67,8 +67,7 @@ in
};
serviceConfig = {
ExecStart = "${pkg}/bin/pulseaudio";
- ExecStartPre = pkgs.writeScript "pulse-start" ''
- #! /bin/sh
+ ExecStartPre = pkgs.writeDash "pulse-start" ''
install -o pulse -g pulse -m 0750 -d ${runDir}
install -o pulse -g pulse -m 0700 -d ${runDir}/home
'';
diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix
index 826c2d4ca..85045332f 100644
--- a/tv/2configs/vim.nix
+++ b/tv/2configs/vim.nix
@@ -211,9 +211,8 @@ let
nix.vim = pkgs.writeText "nix.vim" ''
setf nix
- syn match NixCode /./
-
" Ref <nix/src/libexpr/lexer.l>
+ syn match NixID /[a-zA-Z\_][a-zA-Z0-9\_\'\-]*/
syn match NixINT /\<[0-9]\+\>/
syn match NixPATH /[a-zA-Z0-9\.\_\-\+]*\(\/[a-zA-Z0-9\.\_\-\+]\+\)\+/
syn match NixHPATH /\~\(\/[a-zA-Z0-9\.\_\-\+]\+\)\+/
@@ -230,7 +229,7 @@ let
\ skip="'''\('\|[$]\|\\[nrt]\)"
\ end="'''"
- syn cluster NixStrings contains=NixSTRING,NixIND_STRING
+ syn match NixOther /[():/;=.,?\[\]]/
syn match NixCommentMatch /\(^\|\s\)#.*/
syn region NixCommentRegion start="/\*" end="\*/"
@@ -241,6 +240,7 @@ let
hi link NixCommentMatch NixComment
hi link NixCommentRegion NixComment
+ hi link NixID NixCode
hi link NixINT NixData
hi link NixPATH NixData
hi link NixHPATH NixData
@@ -250,12 +250,12 @@ let
hi link NixIND_STRING NixData
hi link NixEnter NixCode
- hi link NixExit NixData
+ hi link NixOther NixCode
hi link NixQuote NixData
- hi link NixQuote2 NixQuote
- hi link NixQuote3 NixQuote
- syn cluster NixSubLangs contains=NONE
+ syn cluster nix_has_dollar_curly contains=@nix_ind_strings,@nix_strings
+ syn cluster nix_ind_strings contains=NixIND_STRING
+ syn cluster nix_strings contains=NixSTRING
${concatStringsSep "\n" (mapAttrsToList (lang: { extraStart ? null }: let
startAlts = filter isString [
@@ -269,27 +269,35 @@ let
syn match nix_${lang}_sigil
\ X${replaceStrings ["X"] ["\\X"] sigil}\ze\('''\|"\)X
- \ nextgroup=nix_${lang}_region
+ \ nextgroup=nix_${lang}_region_IND_STRING,nix_${lang}_region_STRING
\ transparent
- syn region nix_${lang}_region
+ syn region nix_${lang}_region_STRING
\ matchgroup=NixSTRING
\ start='"'
\ skip='\\"'
\ end='"'
\ contained
\ contains=@nix_${lang}_syntax
+ \ transparent
- syn region nix_${lang}_region
+ syn region nix_${lang}_region_IND_STRING
\ matchgroup=NixIND_STRING
\ start="'''"
\ skip="'''\('\|[$]\|\\[nrt]\)"
\ end="'''"
\ contained
\ contains=@nix_${lang}_syntax
+ \ transparent
- syn cluster NixSubLangs
- \ add=nix_${lang}_region,@nix_${lang}_syntax
+ syn cluster nix_ind_strings
+ \ add=nix_${lang}_region_IND_STRING
+
+ syn cluster nix_strings
+ \ add=nix_${lang}_region_STRING
+
+ syn cluster nix_has_dollar_curly
+ \ add=@nix_${lang}_syntax
'') {
c = {};
cabal = {};
@@ -299,26 +307,32 @@ let
''write[^ \t\r\n]*[ \t\r\n]*"\(\([^"]*\.\)\?vimrc\|[^"]*\.vim\)"'';
})}
- " Clear syntax that interferes with NixBlock.
- " TODO redefine NixBlock so syntax don't have to be cleared
- syn clear shOperator shSetList shVarAssign
+ " Clear syntax that interferes with nixINSIDE_DOLLAR_CURLY.
+ syn clear shVarAssign
- syn region NixBlock
+ syn region nixINSIDE_DOLLAR_CURLY
\ matchgroup=NixEnter
\ start="[$]{"
\ end="}"
\ contains=TOP
- \ containedin=@NixSubLangs,@NixStrings
+ \ containedin=@nix_has_dollar_curly
+ \ transparent
- syn region NixBlockHack
+ syn region nix_inside_curly
\ matchgroup=NixEnter
\ start="{"
\ end="}"
\ contains=TOP
+ \ containedin=nixINSIDE_DOLLAR_CURLY,nix_inside_curly
+ \ transparent
+
+ syn match NixQuote /'''\([''$']\|\\.\)/he=s+2
+ \ containedin=@nix_ind_strings
+ \ contained
- syn match NixQuote "'''[$]"he=e-1 contained containedin=@NixSubLangs
- syn match NixQuote2 "''''"he=s+1 contained containedin=@NixSubLangs
- syn match NixQuote3 "'''\\[nrt]" contained containedin=@NixSubLangs
+ syn match NixQuote /\\./he=s+1
+ \ containedin=@nix_strings
+ \ contained
syn sync fromstart
diff --git a/tv/5pkgs/default.nix b/tv/5pkgs/default.nix
index da3c914b8..607980807 100644
--- a/tv/5pkgs/default.nix
+++ b/tv/5pkgs/default.nix
@@ -3,8 +3,7 @@
{
nixpkgs.config.packageOverrides = {
# TODO use XDG_RUNTIME_DIR?
- cr = pkgs.writeScriptBin "cr" ''
- #! /bin/sh
+ cr = pkgs.writeDashBin "cr" ''
set -efu
export LC_TIME=de_DE.utf8
exec ${pkgs.chromium}/bin/chromium \