summaryrefslogtreecommitdiffstats
path: root/tv
diff options
context:
space:
mode:
Diffstat (limited to 'tv')
-rw-r--r--tv/1systems/mu/config.nix7
-rw-r--r--tv/2configs/default.nix1
-rw-r--r--tv/2configs/sshd.nix6
-rw-r--r--tv/2configs/urlwatch.nix10
-rw-r--r--tv/5pkgs/simple/field.nix6
-rw-r--r--tv/5pkgs/vim/nix.nix44
6 files changed, 44 insertions, 30 deletions
diff --git a/tv/1systems/mu/config.nix b/tv/1systems/mu/config.nix
index f1cd7d673..98332b2d6 100644
--- a/tv/1systems/mu/config.nix
+++ b/tv/1systems/mu/config.nix
@@ -49,6 +49,13 @@ with import <stockholm/lib>;
networking.networkmanager.enable = true;
+ # XXX reload to work around occasional "Failed to load firmware chunk!"
+ # TODO only do this if firmware is actually broken(?)
+ system.activationScripts.reload-iwlwifi = /* sh */ ''
+ ${pkgs.kmod}/bin/modprobe -vr iwlwifi
+ ${pkgs.kmod}/bin/modprobe -v iwlwifi
+ '';
+
environment.systemPackages = with pkgs; [
chromium
firefoxWrapper
diff --git a/tv/2configs/default.nix b/tv/2configs/default.nix
index 4fc755c43..72c48da2c 100644
--- a/tv/2configs/default.nix
+++ b/tv/2configs/default.nix
@@ -120,6 +120,7 @@ with import <stockholm/lib>;
{
environment.systemPackages = [
+ pkgs.field
pkgs.get
pkgs.git
pkgs.git-crypt
diff --git a/tv/2configs/sshd.nix b/tv/2configs/sshd.nix
index 1749b552d..25468f23e 100644
--- a/tv/2configs/sshd.nix
+++ b/tv/2configs/sshd.nix
@@ -5,12 +5,6 @@ with import <stockholm/lib>;
{
services.openssh = {
enable = true;
- hostKeys = [
- {
- type = "ed25519";
- path = "/etc/ssh/ssh_host_ed25519_key";
- }
- ];
};
tv.iptables.input-internet-accept-tcp = singleton "ssh";
}
diff --git a/tv/2configs/urlwatch.nix b/tv/2configs/urlwatch.nix
index 40dc7d237..378b5d167 100644
--- a/tv/2configs/urlwatch.nix
+++ b/tv/2configs/urlwatch.nix
@@ -1,9 +1,15 @@
with import <stockholm/lib>;
{ config, pkgs, ... }: let
- json = url: {
+ exec = filename: args: url: {
inherit url;
- filter = "system:${pkgs.jq}/bin/jq .";
+ filter = "system:${
+ concatMapStringsSep " " shell.escape ([filename] ++ toList args)
+ }";
};
+ json = json' ["."];
+ json' = exec "${pkgs.jq}/bin/jq";
+ xml = xml' ["--format" "-"];
+ xml' = exec "${pkgs.libxml2}/bin/xmllint";
in {
krebs.urlwatch = {
enable = true;
diff --git a/tv/5pkgs/simple/field.nix b/tv/5pkgs/simple/field.nix
new file mode 100644
index 000000000..71362398d
--- /dev/null
+++ b/tv/5pkgs/simple/field.nix
@@ -0,0 +1,6 @@
+{ gawk, writeDashBin }:
+
+writeDashBin "field" ''
+ set -u
+ exec ${gawk}/bin/awk -v n="$1" '{print$n}'
+''
diff --git a/tv/5pkgs/vim/nix.nix b/tv/5pkgs/vim/nix.nix
index 747ab0bc0..4f3f83aaa 100644
--- a/tv/5pkgs/vim/nix.nix
+++ b/tv/5pkgs/vim/nix.nix
@@ -63,16 +63,28 @@ with import <stockholm/lib>;
syn cluster nix_ind_strings contains=NixIND_STRING
syn cluster nix_strings contains=NixSTRING
- ${concatStringsSep "\n" (mapAttrsToList (name: {
+ ${concatStringsSep "\n" (let
+ alts = xs: ''\(${concatStringsSep ''\|'' xs}\)'';
+ capitalize = s: let
+ xs = stringToCharacters s;
+ in
+ toUpper (head xs) + concatStrings (tail xs);
+ comment = k: ''/\* ${k} \*/'';
+ def = k: ''${k}[ \t\r\n]*='';
+ writer = k: ''write${k}[^ \t\r\n]*[ \t\r\n]*\("[^"]*"\|[a-z]\+\)'';
+ writerExt = k: writerName ''[^"]*\.${k}'';
+ writerName = k:
+ ''${alts [''toFile'' ''write[^ \t\r\n]*'']}*[ \t\r\n]*"${k}"'';
+ in mapAttrsToList (name: {
extraStart ? null,
lang ? name
}:
let
startAlts = filter isString [
- ''/\* ${name} \*/''
+ (comment name)
extraStart
];
- sigil = ''\(${concatStringsSep ''\|'' startAlts}\)[ \t\r\n]*'';
+ sigil = ''${alts startAlts}[ \t\r\n]*'';
in /* vim */ ''
syn include @nix_${lang}_syntax syntax/${lang}.vim
if exists("b:current_syntax")
@@ -111,22 +123,7 @@ with import <stockholm/lib>;
" This is required because containedin isn't transitive.
syn cluster nix_has_dollar_curly
\ add=@nix_${lang}_syntax
- '') (let
-
- # TODO move this higher
- 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]\+\)'';
-
- writerExt = k: writerName ''[^"]*\.${k}'';
- writerName = k: ''write[^ \t\r\n]*[ \t\r\n]*"${k}"'';
-
- in {
+ '') {
c = {};
cabal = {};
diff = {};
@@ -136,10 +133,13 @@ with import <stockholm/lib>;
(writer "Jq")
(writerExt "jq")
];
- javascript.extraStart = ''/\* js \*/'';
+ javascript.extraStart = comment "jq";
lua = {};
#nginx = {};
- python.extraStart = ''/\* py \*/'';
+ python.extraStart = alts [
+ (comment "py")
+ (writerExt "py")
+ ];
sed.extraStart = writer "Sed";
sh.extraStart = let
phases = [
@@ -172,7 +172,7 @@ with import <stockholm/lib>;
];
xdefaults = {};
xmodmap = {};
- }))}
+ })}
" Clear syntax that interferes with nixINSIDE_DOLLAR_CURLY.
syn clear shVarAssign