From 94a09258ad3202cfba1bcba8cdbf99b51f5aae86 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 30 Nov 2018 09:03:52 +0100 Subject: tv xmonad: move to haskell packages --- tv/2configs/xserver/default.nix | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'tv/2configs') diff --git a/tv/2configs/xserver/default.nix b/tv/2configs/xserver/default.nix index a44ece8b1..9cb487254 100644 --- a/tv/2configs/xserver/default.nix +++ b/tv/2configs/xserver/default.nix @@ -57,7 +57,9 @@ in { systemd.services.display-manager.enable = false; - systemd.services.xmonad = { + systemd.services.xmonad = let + xmonad = "${pkgs.haskellPackages.xmonad-tv}/bin/xmonad"; + in { wantedBy = [ "graphical.target" ]; requires = [ "xserver.service" ]; environment = { @@ -93,6 +95,11 @@ in { "za" "zh" "zj" "zs" ]); }; + path = [ + pkgs.alsaUtils + pkgs.fzmenu + pkgs.rxvt_unicode + ]; serviceConfig = { SyslogIdentifier = "xmonad"; ExecStartPre = "${pkgs.coreutils}/bin/mkdir -p ${toString [ @@ -100,8 +107,8 @@ in { "\${XMONAD_CONFIG_DIR}" "\${XMONAD_DATA_DIR}" ]}"; - ExecStart = "${pkgs.xmonad-tv}/bin/xmonad-${currentSystem}"; - ExecStop = "${pkgs.xmonad-tv}/bin/xmonad-${currentSystem} --shutdown"; + ExecStart = "@${xmonad} xmonad-${currentSystem} "; + ExecStop = "@${xmonad} xmonad-${currentSystem} --shutdown"; User = cfg.user.name; WorkingDirectory = cfg.user.home; }; -- cgit v1.2.3 From 220969d4d3d435b59c6f121cdc7eb86719dcfd80 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 30 Nov 2018 13:15:49 +0100 Subject: tv: remove systemd aliases --- tv/2configs/default.nix | 5 ----- 1 file changed, 5 deletions(-) (limited to 'tv/2configs') diff --git a/tv/2configs/default.nix b/tv/2configs/default.nix index d9ddc90d0..484a337b7 100644 --- a/tv/2configs/default.nix +++ b/tv/2configs/default.nix @@ -87,11 +87,6 @@ with import ; export SYSTEM="$1" exec nix-shell -I stockholm="$PWD" --run 'deploy --system="$SYSTEM"' ''; - reload = "systemctl reload"; - restart = "systemctl restart"; - start = "systemctl start"; - status = "systemctl status"; - stop = "systemctl stop"; }; environment.variables = { -- cgit v1.2.3 From ed44b2dacdb33156921a859733991295dc4c2502 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 30 Nov 2018 14:04:42 +0100 Subject: tv bash: use XMONAD_SPAWN_WORKSPACE only for tv change directory only for interactivetv user --- tv/2configs/bash/default.nix | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'tv/2configs') diff --git a/tv/2configs/bash/default.nix b/tv/2configs/bash/default.nix index b75ad8bfc..3b4a4aadb 100644 --- a/tv/2configs/bash/default.nix +++ b/tv/2configs/bash/default.nix @@ -13,6 +13,18 @@ with import ; shopt -s histappend histreedit histverify shopt -s no_empty_cmd_completion complete -d cd + + case $UID in + ${shell.escape (toString config.krebs.users.tv.uid)}) + if test ''${SHLVL-1} = 1; then + case ''${XMONAD_SPAWN_WORKSPACE-} in + stockholm) + cd ~/stockholm + ;; + esac + fi + ;; + esac ''; promptInit = /* sh */ '' case $UID in @@ -32,14 +44,6 @@ with import ; if test -n "$SSH_AGENT_PID"; then PS1="ssh-agent[$SSH_AGENT_PID] $PS1" fi - - if test ''${SHLVL-1} = 1; then - case ''${XMONAD_SPAWN_WORKSPACE-} in - stockholm) - cd ~/stockholm - ;; - esac - fi ''; }; } -- cgit v1.2.3 From 8a17b6fb1750b3f11b3f1b12fe12317b916026fe Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 30 Nov 2018 14:07:58 +0100 Subject: tv bash: redefine for tv --- tv/2configs/bash/default.nix | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tv/2configs') diff --git a/tv/2configs/bash/default.nix b/tv/2configs/bash/default.nix index 3b4a4aadb..d7673931c 100644 --- a/tv/2configs/bash/default.nix +++ b/tv/2configs/bash/default.nix @@ -23,6 +23,8 @@ with import ; ;; esac fi + + export NIX_PATH="stockholm=$HOME/stockholm:$NIX_PATH" ;; esac ''; -- cgit v1.2.3 From 08849bbb4e731a4b655fa2456bad6925e7a70e8d Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 30 Nov 2018 16:17:32 +0100 Subject: tv xmonad: amixer -> pactl --- tv/2configs/xserver/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tv/2configs') diff --git a/tv/2configs/xserver/default.nix b/tv/2configs/xserver/default.nix index 9cb487254..22c94f7b1 100644 --- a/tv/2configs/xserver/default.nix +++ b/tv/2configs/xserver/default.nix @@ -96,8 +96,8 @@ in { ]); }; path = [ - pkgs.alsaUtils pkgs.fzmenu + pkgs.pulseaudioLight.out pkgs.rxvt_unicode ]; serviceConfig = { -- cgit v1.2.3 From b9bd7a08b8aab6c0a7b4df5bad2ac7d40474633a Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 2 Dec 2018 14:52:25 +0100 Subject: tv xmonad: find all paths --- tv/2configs/xserver/default.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'tv/2configs') diff --git a/tv/2configs/xserver/default.nix b/tv/2configs/xserver/default.nix index 22c94f7b1..480295565 100644 --- a/tv/2configs/xserver/default.nix +++ b/tv/2configs/xserver/default.nix @@ -99,6 +99,7 @@ in { pkgs.fzmenu pkgs.pulseaudioLight.out pkgs.rxvt_unicode + "/run/wrappers" # for slock, and su ]; serviceConfig = { SyslogIdentifier = "xmonad"; -- cgit v1.2.3 From 46dc547bbe9edbb2a314145482e220287ab4c70a Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 2 Dec 2018 15:36:55 +0100 Subject: tv xmonad: use slock service --- tv/2configs/xserver/default.nix | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'tv/2configs') diff --git a/tv/2configs/xserver/default.nix b/tv/2configs/xserver/default.nix index 480295565..b513dabbe 100644 --- a/tv/2configs/xserver/default.nix +++ b/tv/2configs/xserver/default.nix @@ -24,17 +24,6 @@ in { pkgs.xlibs.fontschumachermisc ]; - # TODO dedicated group, i.e. with a single user [per-user-setuid] - # TODO krebs.setuid.slock.path vs /run/wrappers/bin - krebs.setuid.slock = { - filename = "${pkgs.slock}/bin/slock"; - group = "wheel"; - envp = { - DISPLAY = ":${toString config.services.xserver.display}"; - USER = cfg.user.name; - }; - }; - services.xserver = { # Don't install feh into systemPackages @@ -96,10 +85,11 @@ in { ]); }; path = [ + config.tv.slock.package pkgs.fzmenu pkgs.pulseaudioLight.out pkgs.rxvt_unicode - "/run/wrappers" # for slock, and su + "/run/wrappers" # for su ]; serviceConfig = { SyslogIdentifier = "xmonad"; @@ -155,4 +145,9 @@ in { User = cfg.user.name; }; }; + + tv.slock = { + enable = true; + user = cfg.user; + }; } -- cgit v1.2.3 From a58628d1c3c8fb4d730ee77ce3fae6130271962f Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 2 Dec 2018 15:43:49 +0100 Subject: tv xmonad: add xcalib --- tv/2configs/xserver/default.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'tv/2configs') diff --git a/tv/2configs/xserver/default.nix b/tv/2configs/xserver/default.nix index b513dabbe..8d4b13fad 100644 --- a/tv/2configs/xserver/default.nix +++ b/tv/2configs/xserver/default.nix @@ -89,6 +89,7 @@ in { pkgs.fzmenu pkgs.pulseaudioLight.out pkgs.rxvt_unicode + pkgs.xcalib "/run/wrappers" # for su ]; serviceConfig = { -- cgit v1.2.3 From a3e47e6788b568cf04d5103ad8a918ed902df9ce Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 2 Dec 2018 16:03:36 +0100 Subject: tv: rename vim-tv to vim-syntax-nix-nested --- tv/2configs/vim.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tv/2configs') diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index a5641f094..c6364c223 100644 --- a/tv/2configs/vim.nix +++ b/tv/2configs/vim.nix @@ -129,7 +129,7 @@ let { command! -n=0 -bar ShowSyntax :call ShowSyntax() ''; }))) - ((rtp: rtp // { inherit rtp; }) (pkgs.write "vim-tv" { + ((rtp: rtp // { inherit rtp; }) (pkgs.write "vim-syntax-nix-nested" { "/syntax/haskell.vim".text = /* vim */ '' syn region String start=+\[[[:alnum:]]*|+ end=+|]+ -- cgit v1.2.3 From e847d935ade4b36aecf8588faffb3dd61e3ebdfe Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 2 Dec 2018 15:48:01 +0100 Subject: tv vim-syntax-nix-nested: simplify regexes --- tv/2configs/vim.nix | 46 ++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 8 deletions(-) (limited to 'tv/2configs') diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index c6364c223..009280815 100644 --- a/tv/2configs/vim.nix +++ b/tv/2configs/vim.nix @@ -239,26 +239,56 @@ let { " This is required because containedin isn't transitive. syn cluster nix_has_dollar_curly \ add=@nix_${lang}_syntax - '') { + '') (let + + capitalize = s: let + xs = stringToCharacters s; + in + toUpper (head xs) + concatStrings (tail xs); + + alts = xs: ''\(${concatStringsSep ''\|'' xs}\)''; + def = k: ''${k}[ \t\r\n]*=''; + writer = k: ''write${k}[^ \t\r\n]*[ \t\r\n]*\("[^"]*"\|[a-z]\+\)''; + + in { c = {}; cabal = {}; diff = {}; haskell = {}; - jq.extraStart = concatStringsSep ''\|'' [ - ''writeJq.*'' + jq.extraStart = alts [ + (writer "Jq") ''write[^ \t\r\n]*[ \t\r\n]*"[^"]*\.jq"'' ]; lua = {}; - sed.extraStart = ''writeSed[^ \t\r\n]*[ \t\r\n]*"[^"]*"''; - sh.extraStart = concatStringsSep ''\|'' [ - ''write\(A\|Ba\|Da\)sh[^ \t\r\n]*[ \t\r\n]*\("[^"]*"\|[a-z]\+\)'' - ''[a-z]*Phase[ \t\r\n]*='' + sed.extraStart = writer "Sed"; + sh.extraStart = let + phases = [ + "unpack" + "patch" + "configure" + "build" + "check" + "install" + "fixup" + "installCheck" + "dist" + ]; + shells = [ + "ash" + "bash" + "dash" + ]; + in alts [ + (def "shellHook") + (def "${alts phases}Phase") + (def "${alts ["pre" "post"]}${alts (map capitalize phases)}") + (writer (alts (map capitalize shells))) ]; yaml = {}; vim.extraStart = ''write[^ \t\r\n]*[ \t\r\n]*"\(\([^"]*\.\)\?vimrc\|[^"]*\.vim\)"''; xdefaults = {}; - })} + }))} " Clear syntax that interferes with nixINSIDE_DOLLAR_CURLY. syn clear shVarAssign -- cgit v1.2.3 From c544596952c7ed42479616cea6904b061085e2f0 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 2 Dec 2018 16:07:53 +0100 Subject: tv vim-syntax-nix-nested: add js, and py --- tv/2configs/vim.nix | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tv/2configs') diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index 009280815..3794628c1 100644 --- a/tv/2configs/vim.nix +++ b/tv/2configs/vim.nix @@ -259,7 +259,9 @@ let { (writer "Jq") ''write[^ \t\r\n]*[ \t\r\n]*"[^"]*\.jq"'' ]; + javascript.extraStart = ''/\* js \*/''; lua = {}; + python.extraStart = ''/\* py \*/''; sed.extraStart = writer "Sed"; sh.extraStart = let phases = [ -- cgit v1.2.3 From 145723a8e4d8cb51386cec51b871e3056fb62372 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 2 Dec 2018 19:25:56 +0100 Subject: tv pulse: use genid_uint31 Refs https://github.com/systemd/systemd/issues/11026 --- tv/2configs/pulse.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tv/2configs') diff --git a/tv/2configs/pulse.nix b/tv/2configs/pulse.nix index c051b4261..2e679bd14 100644 --- a/tv/2configs/pulse.nix +++ b/tv/2configs/pulse.nix @@ -95,7 +95,7 @@ in users = { groups.pulse.gid = config.users.users.pulse.uid; users.pulse = { - uid = genid "pulse"; + uid = genid_uint31 "pulse"; group = "pulse"; extraGroups = [ "audio" ]; home = "${runDir}/home"; -- cgit v1.2.3