From f15434475faf17795bd296fc3570bc7dca34591a Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 30 Jul 2019 19:20:32 +0200 Subject: tv sshd: drop default generated host key Fixes an issue with 222160fc3a195415e859048bdef21f703154b3ee which caused the generated ed25519 host key to be preferred over the one defined in krebs/3modules/*/default.nix --- tv/2configs/sshd.nix | 6 ------ 1 file changed, 6 deletions(-) (limited to 'tv') 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 ; { services.openssh = { enable = true; - hostKeys = [ - { - type = "ed25519"; - path = "/etc/ssh/ssh_host_ed25519_key"; - } - ]; }; tv.iptables.input-internet-accept-tcp = singleton "ssh"; } -- cgit v1.2.3 From b92610eacb6c88fe28f46a91ee8697cb542ab6aa Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 2 Aug 2019 17:03:12 +0200 Subject: tv mu: reload iwlwifi on activation --- tv/1systems/mu/config.nix | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tv') 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 ; 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 -- cgit v1.2.3 From daf7c2d05d207d876f0383955e3f1c8c3f0c0822 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 5 Aug 2019 14:08:31 +0200 Subject: tv field: init --- tv/5pkgs/simple/field.nix | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 tv/5pkgs/simple/field.nix (limited to 'tv') 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}' +'' -- cgit v1.2.3 From 5f22fbed30828d6e297554060744f57cd2af556e Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 5 Aug 2019 14:09:03 +0200 Subject: tv: add field to systemPackages --- tv/2configs/default.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'tv') 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 ; { environment.systemPackages = [ + pkgs.field pkgs.get pkgs.git pkgs.git-crypt -- cgit v1.2.3 From 4258ff5c0c5e287c986b7199158dee1b4c49f1d9 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 12 Aug 2019 23:51:23 +0200 Subject: tv urlwatch: add json' --- tv/2configs/urlwatch.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'tv') diff --git a/tv/2configs/urlwatch.nix b/tv/2configs/urlwatch.nix index 40dc7d237..4fb111063 100644 --- a/tv/2configs/urlwatch.nix +++ b/tv/2configs/urlwatch.nix @@ -1,8 +1,11 @@ with import ; { config, pkgs, ... }: let - json = url: { + json = json' ["."]; + json' = args: url: { inherit url; - filter = "system:${pkgs.jq}/bin/jq ."; + filter = "system:${pkgs.jq}/bin/jq ${ + concatMapStringsSep " " shell.escape (toList args) + }"; }; in { krebs.urlwatch = { -- cgit v1.2.3 From f319d31e3641ec4b9e235cb77933d5c98f0cd6a4 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 12 Aug 2019 23:51:43 +0200 Subject: tv urlwatch: add xml and xml' --- tv/2configs/urlwatch.nix | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tv') diff --git a/tv/2configs/urlwatch.nix b/tv/2configs/urlwatch.nix index 4fb111063..b2364e6e6 100644 --- a/tv/2configs/urlwatch.nix +++ b/tv/2configs/urlwatch.nix @@ -7,6 +7,13 @@ with import ; concatMapStringsSep " " shell.escape (toList args) }"; }; + xml = xml' ["--format" "-"]; + xml' = args: url: { + inherit url; + filter = "system:${pkgs.libxml2}/bin/xmllint ${ + concatMapStringsSep " " shell.escape (toList args) + }"; + }; in { krebs.urlwatch = { enable = true; -- cgit v1.2.3 From 8527caef164fe872dd9c77772d1e6ed7a0a85b77 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 13 Aug 2019 00:02:54 +0200 Subject: tv urlwatch: add exec --- tv/2configs/urlwatch.nix | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'tv') diff --git a/tv/2configs/urlwatch.nix b/tv/2configs/urlwatch.nix index b2364e6e6..378b5d167 100644 --- a/tv/2configs/urlwatch.nix +++ b/tv/2configs/urlwatch.nix @@ -1,19 +1,15 @@ with import ; { config, pkgs, ... }: let - json = json' ["."]; - json' = args: url: { + exec = filename: args: url: { inherit url; - filter = "system:${pkgs.jq}/bin/jq ${ - concatMapStringsSep " " shell.escape (toList args) + filter = "system:${ + concatMapStringsSep " " shell.escape ([filename] ++ toList args) }"; }; + json = json' ["."]; + json' = exec "${pkgs.jq}/bin/jq"; xml = xml' ["--format" "-"]; - xml' = args: url: { - inherit url; - filter = "system:${pkgs.libxml2}/bin/xmllint ${ - concatMapStringsSep " " shell.escape (toList args) - }"; - }; + xml' = exec "${pkgs.libxml2}/bin/xmllint"; in { krebs.urlwatch = { enable = true; -- cgit v1.2.3 From 9cf4d9e26f07e31cb04888c00779900c91718f1b Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 13 Aug 2019 00:15:26 +0200 Subject: tv vim nix: add `comment` --- tv/5pkgs/vim/nix.nix | 40 ++++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 22 deletions(-) (limited to 'tv') diff --git a/tv/5pkgs/vim/nix.nix b/tv/5pkgs/vim/nix.nix index 747ab0bc0..1998f9d72 100644 --- a/tv/5pkgs/vim/nix.nix +++ b/tv/5pkgs/vim/nix.nix @@ -63,16 +63,27 @@ with import ; 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: ''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 +122,7 @@ with import ; " 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 +132,10 @@ with import ; (writer "Jq") (writerExt "jq") ]; - javascript.extraStart = ''/\* js \*/''; + javascript.extraStart = comment "jq"; lua = {}; #nginx = {}; - python.extraStart = ''/\* py \*/''; + python.extraStart = comment "py"; sed.extraStart = writer "Sed"; sh.extraStart = let phases = [ @@ -172,7 +168,7 @@ with import ; ]; xdefaults = {}; xmodmap = {}; - }))} + })} " Clear syntax that interferes with nixINSIDE_DOLLAR_CURLY. syn clear shVarAssign -- cgit v1.2.3 From af518678bf730ee540dc3d3fe922e1f8f4fa1059 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 13 Aug 2019 00:16:54 +0200 Subject: tv vim nix: recognize python by extension --- tv/5pkgs/vim/nix.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tv') diff --git a/tv/5pkgs/vim/nix.nix b/tv/5pkgs/vim/nix.nix index 1998f9d72..61323ab35 100644 --- a/tv/5pkgs/vim/nix.nix +++ b/tv/5pkgs/vim/nix.nix @@ -135,7 +135,10 @@ with import ; javascript.extraStart = comment "jq"; lua = {}; #nginx = {}; - python.extraStart = comment "py"; + python.extraStart = alts [ + (comment "py") + (writerExt "py") + ]; sed.extraStart = writer "Sed"; sh.extraStart = let phases = [ -- cgit v1.2.3 From bc7c360b80409cff1bea0fe2c187c43b0eec8269 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 13 Aug 2019 00:22:59 +0200 Subject: tv vim nix writerName: recognize toFile --- tv/5pkgs/vim/nix.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tv') diff --git a/tv/5pkgs/vim/nix.nix b/tv/5pkgs/vim/nix.nix index 61323ab35..4f3f83aaa 100644 --- a/tv/5pkgs/vim/nix.nix +++ b/tv/5pkgs/vim/nix.nix @@ -73,7 +73,8 @@ with import ; 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}"''; + writerName = k: + ''${alts [''toFile'' ''write[^ \t\r\n]*'']}*[ \t\r\n]*"${k}"''; in mapAttrsToList (name: { extraStart ? null, lang ? name -- cgit v1.2.3 From 856ee03a203722722fb646c62c36e4b6aabadaee Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 4 Sep 2019 20:17:56 +0200 Subject: treewide: use packageName --- tv/2configs/br.nix | 9 +++++---- tv/2configs/hw/AO753.nix | 2 +- tv/2configs/hw/w110er.nix | 9 +++++---- tv/2configs/xp-332.nix | 2 +- 4 files changed, 12 insertions(+), 10 deletions(-) (limited to 'tv') diff --git a/tv/2configs/br.nix b/tv/2configs/br.nix index d660ebc35..e6a46e903 100644 --- a/tv/2configs/br.nix +++ b/tv/2configs/br.nix @@ -5,10 +5,11 @@ with import ; ]; - krebs.nixpkgs.allowUnfreePredicate = pkg: any (flip hasPrefix pkg.name) [ - "brother-udev-rule-type1-" - "brscan4-" - "mfcl2700dnlpr-" + krebs.nixpkgs.allowUnfreePredicate = pkg: any (eq (packageName pkg)) [ + "brother-udev-rule-type1" + "brscan4" + "brscan4-etc-files" + "mfcl2700dnlpr" ]; hardware.sane = { diff --git a/tv/2configs/hw/AO753.nix b/tv/2configs/hw/AO753.nix index 4df5e097a..d5b755cef 100644 --- a/tv/2configs/hw/AO753.nix +++ b/tv/2configs/hw/AO753.nix @@ -39,5 +39,5 @@ with import ; HandleSuspendKey=ignore ''; - krebs.nixpkgs.allowUnfreePredicate = pkg: hasPrefix "broadcom-sta-" pkg.name; + krebs.nixpkgs.allowUnfreePredicate = pkg: packageName pkg == "broadcom-sta"; } diff --git a/tv/2configs/hw/w110er.nix b/tv/2configs/hw/w110er.nix index 55e9482d4..7d837eabc 100644 --- a/tv/2configs/hw/w110er.nix +++ b/tv/2configs/hw/w110er.nix @@ -10,10 +10,11 @@ with import ; #hardware.bumblebee.enable = true; #hardware.bumblebee.group = "video"; #hardware.enableRedistributableFirmware= true; - #krebs.nixpkgs.allowUnfreePredicate = pkg: - # hasPrefix "nvidia-x11-" pkg.name || - # hasPrefix "nvidia-persistenced-" pkg.name || - # hasPrefix "nvidia-settings-" pkg.name; + #krebs.nixpkgs.allowUnfreePredicate = pkg: any (eq (packageName pkg)) [ + # "nvidia-x11" + # "nvidia-persistenced" + # "nvidia-settings" + #]; } ]; diff --git a/tv/2configs/xp-332.nix b/tv/2configs/xp-332.nix index 4a0b0ae16..a66b884c8 100644 --- a/tv/2configs/xp-332.nix +++ b/tv/2configs/xp-332.nix @@ -16,7 +16,7 @@ with import ; }; krebs.nixpkgs.allowUnfreePredicate = pkg: - elem (parseDrvName pkg.name).name [ "imagescan-plugin-networkscan" ]; + packageName pkg == "imagescan-plugin-networkscan"; nixpkgs.overlays = singleton (self: super: { utsushi-customized = self.utsushi.override { -- cgit v1.2.3 From a1ca4c183e25b8ea97657c736e23ac71c1c23a17 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 4 Sep 2019 15:55:20 +0200 Subject: tv utsushi: use pname and version --- tv/5pkgs/simple/utsushi.nix | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'tv') diff --git a/tv/5pkgs/simple/utsushi.nix b/tv/5pkgs/simple/utsushi.nix index 0ae4ed880..9a86feddf 100644 --- a/tv/5pkgs/simple/utsushi.nix +++ b/tv/5pkgs/simple/utsushi.nix @@ -46,7 +46,8 @@ let ''; imagescan-plugin-networkscan = stdenv.mkDerivation rec { - name = "imagescan-plugin-networkscan-${meta.version}"; + pname = "imagescan-plugin-networkscan"; + version = "1.1.2"; src = if stdenv.system == "i686-linux" then @@ -65,14 +66,14 @@ let ]; sha256 = "1wp372hqhzdar6ldxy7s9js2s872x8c5nwq3608dwg9gca11ppc5"; } - else throw "${name} is not supported on ${stdenv.system} (only i686-linux and x86_64 linux are supported)"; + else throw "${pname} is not supported on ${stdenv.system} (only i686-linux and x86_64 linux are supported)"; dontBuild = true; installPhase = '' # Wildcard * stand for either i386 or amd64 ${dpkg}/bin/dpkg -x \ - plugins/imagescan-plugin-networkscan_${meta.version}-1epson4debian9_*.deb \ + plugins/imagescan-plugin-networkscan_${version}-1epson4debian9_*.deb \ tmp mv tmp/usr $out @@ -94,23 +95,23 @@ let This package provides the unfree networkscan plugin from the Epson Image Scan v3 scanner driver bundle, which can be used by Utsushi. ''; - homepage = "http://support.epson.net/linux/en/imagescanv3.php?version=${meta.version}"; + homepage = "http://support.epson.net/linux/en/imagescanv3.php?version=${version}"; license = stdenv.lib.licenses.eapl; maintainers = [ stdenv.lib.maintainers.tv ]; platforms = stdenv.lib.platforms.linux; - version = "1.1.2"; }; }; in stdenv.mkDerivation rec { - name = "utsushi-${meta.version}"; + pname = "utsushi"; + version = "3.55.0"; src = fetchurl { urls = [ - "http://support.epson.net/linux/src/scanner/imagescanv3/debian/imagescan_${meta.version}.orig.tar.gz" - "http://ni.r/~tv/mirrors/epson/imagescan_${meta.version}.orig.tar.gz" + "http://support.epson.net/linux/src/scanner/imagescanv3/debian/imagescan_${version}.orig.tar.gz" + "http://ni.r/~tv/mirrors/epson/imagescan_${version}.orig.tar.gz" ]; sha256 = "0xwl4xp07cigslbi1qc52jsjvxcyvjlx54g812mn7211p01v2h4l"; }; @@ -212,6 +213,5 @@ stdenv.mkDerivation rec { license = stdenv.lib.licenses.gpl3; maintainers = [ stdenv.lib.maintainers.tv ]; platforms = stdenv.lib.platforms.linux; - version = "3.55.0"; }; } -- cgit v1.2.3 From af6f37979cf1efd0166010c7ebee0e8933759e0b Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 4 Sep 2019 16:08:17 +0200 Subject: tv utsushi: 3.55.0 -> 3.59.2 --- tv/5pkgs/simple/utsushi.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tv') diff --git a/tv/5pkgs/simple/utsushi.nix b/tv/5pkgs/simple/utsushi.nix index 9a86feddf..045271321 100644 --- a/tv/5pkgs/simple/utsushi.nix +++ b/tv/5pkgs/simple/utsushi.nix @@ -106,14 +106,14 @@ in stdenv.mkDerivation rec { pname = "utsushi"; - version = "3.55.0"; + version = "3.59.2"; src = fetchurl { urls = [ "http://support.epson.net/linux/src/scanner/imagescanv3/debian/imagescan_${version}.orig.tar.gz" "http://ni.r/~tv/mirrors/epson/imagescan_${version}.orig.tar.gz" ]; - sha256 = "0xwl4xp07cigslbi1qc52jsjvxcyvjlx54g812mn7211p01v2h4l"; + sha256 = "1mns10mpyjprkrh2bjcg2nda9iyrnd0pf1did9py84glpapkzrdq"; }; preConfigure = '' -- cgit v1.2.3 From 099311c6d828d50238ab485b06548874ec620a31 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 4 Sep 2019 16:01:49 +0200 Subject: tv imagescan-plugin-networkscan: 1.1.2 -> 1.1.3 --- tv/5pkgs/simple/utsushi.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'tv') diff --git a/tv/5pkgs/simple/utsushi.nix b/tv/5pkgs/simple/utsushi.nix index 045271321..0414eae09 100644 --- a/tv/5pkgs/simple/utsushi.nix +++ b/tv/5pkgs/simple/utsushi.nix @@ -47,24 +47,24 @@ let imagescan-plugin-networkscan = stdenv.mkDerivation rec { pname = "imagescan-plugin-networkscan"; - version = "1.1.2"; + version = "1.1.3"; src = if stdenv.system == "i686-linux" then fetchurl { urls = [ - "https://download2.ebz.epson.net/imagescanv3/debian/latest1/deb/x86/imagescan-bundle-debian-9-3.55.0.x86.deb.tar.gz" - "http://ni.r/~tv/mirrors/epson/imagescan-bundle-debian-9-3.55.0.x86.deb.tar.gz" + "https://download2.ebz.epson.net/imagescanv3/debian/latest1/deb/x86/imagescan-bundle-debian-9-3.59.2.x86.deb.tar.gz" + "http://ni.r/~tv/mirrors/epson/imagescan-bundle-debian-9-3.59.2.x86.deb.tar.gz" ]; - sha256 = "12syk4y8z22hm9r1lgxqp81vd24jbqgmq83b7yiyqfd4wfxb6k3s"; + sha256 = "1whw96kcfj65h2jnk72xgyr9jj05fa07d0xjxpaqb0zwdag3465g"; } else if stdenv.system == "x86_64-linux" then fetchurl { urls = [ - "https://download2.ebz.epson.net/imagescanv3/debian/latest1/deb/x64/imagescan-bundle-debian-9-3.55.0.x64.deb.tar.gz" - "http://ni.r/~tv/mirrors/epson/imagescan-bundle-debian-9-3.55.0.x64.deb.tar.gz" + "https://download2.ebz.epson.net/imagescanv3/debian/latest1/deb/x64/imagescan-bundle-debian-9-3.59.2.x64.deb.tar.gz" + "http://ni.r/~tv/mirrors/epson/imagescan-bundle-debian-9-3.59.2.x64.deb.tar.gz" ]; - sha256 = "1wp372hqhzdar6ldxy7s9js2s872x8c5nwq3608dwg9gca11ppc5"; + sha256 = "0kd6mrs48wwss54gw4v9fm7ss5ma2xpn6gd1pz26cgjvp6n8hknn"; } else throw "${pname} is not supported on ${stdenv.system} (only i686-linux and x86_64 linux are supported)"; -- cgit v1.2.3