From fd41443c9047b91e8ca1952881a096a2270f8643 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 29 Jan 2019 01:28:36 +0100 Subject: tv rxvt_unicode: finish running selection --- tv/5pkgs/override/default.nix | 6 ++++ tv/5pkgs/override/rxvt_unicode/default.nix | 6 ++++ .../rxvt_unicode/finish-running-selection.patch | 41 ++++++++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 tv/5pkgs/override/default.nix create mode 100644 tv/5pkgs/override/rxvt_unicode/default.nix create mode 100644 tv/5pkgs/override/rxvt_unicode/finish-running-selection.patch diff --git a/tv/5pkgs/override/default.nix b/tv/5pkgs/override/default.nix new file mode 100644 index 000000000..cd7c5645b --- /dev/null +++ b/tv/5pkgs/override/default.nix @@ -0,0 +1,6 @@ +with import ; +self: super: { + rxvt_unicode = self.callPackage ./rxvt_unicode { + rxvt_unicode = super.rxvt_unicode; + }; +} diff --git a/tv/5pkgs/override/rxvt_unicode/default.nix b/tv/5pkgs/override/rxvt_unicode/default.nix new file mode 100644 index 000000000..858a46be6 --- /dev/null +++ b/tv/5pkgs/override/rxvt_unicode/default.nix @@ -0,0 +1,6 @@ +{ rxvt_unicode }: +rxvt_unicode.overrideAttrs (old: { + patches = old.patches ++ [ + ./finish-running-selection.patch + ]; +}) diff --git a/tv/5pkgs/override/rxvt_unicode/finish-running-selection.patch b/tv/5pkgs/override/rxvt_unicode/finish-running-selection.patch new file mode 100644 index 000000000..a342ccf5c --- /dev/null +++ b/tv/5pkgs/override/rxvt_unicode/finish-running-selection.patch @@ -0,0 +1,41 @@ +diff --git a/src/rxvttoolkit.h b/src/rxvttoolkit.h +index 56c9a3f..429055d 100644 +--- a/src/rxvttoolkit.h ++++ b/src/rxvttoolkit.h +@@ -384,6 +384,7 @@ struct rxvt_selection + { + rxvt_selection (rxvt_display *disp, int selnum, Time tm, Window win, Atom prop, rxvt_term *term); + void run (); ++ void finish (char *data = 0, unsigned int len = 0); + ~rxvt_selection (); + + rxvt_term *term; // terminal to paste to, may be 0 +@@ -404,7 +405,6 @@ private: + void timer_cb (ev::timer &w, int revents); ev::timer timer_ev; + void x_cb (XEvent &xev); xevent_watcher x_ev; + +- void finish (char *data = 0, unsigned int len = 0); + void stop (); + bool request (Atom target, int selnum); + void handle_selection (Window win, Atom prop, bool delete_prop); +diff --git a/src/screen.C b/src/screen.C +index 9eb375a..77e7109 100644 +--- a/src/screen.C ++++ b/src/screen.C +@@ -2736,11 +2736,11 @@ rxvt_term::paste (char *data, unsigned int len) NOTHROW + void + rxvt_term::selection_request (Time tm, int selnum) NOTHROW + { +- if (!selection_req) +- { +- selection_req = new rxvt_selection (display, selnum, tm, vt, xa[XA_VT_SELECTION], this); +- selection_req->run (); +- } ++ if (selection_req) ++ selection_req->finish (); ++ ++ selection_req = new rxvt_selection (display, selnum, tm, vt, xa[XA_VT_SELECTION], this); ++ selection_req->run (); + } + + /* ------------------------------------------------------------------------- */ -- cgit v1.2.3 From 773db3ae47ff212c40f0cd22f9e47f66b7fe93ff Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 29 Jan 2019 20:51:11 +0100 Subject: reaktor2: 0.2.1 -> 0.2.2 --- krebs/5pkgs/haskell/reaktor2.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/krebs/5pkgs/haskell/reaktor2.nix b/krebs/5pkgs/haskell/reaktor2.nix index 40c628802..f06e79121 100644 --- a/krebs/5pkgs/haskell/reaktor2.nix +++ b/krebs/5pkgs/haskell/reaktor2.nix @@ -7,11 +7,11 @@ }: mkDerivation { pname = "reaktor2"; - version = "0.2.1"; + version = "0.2.2"; src = fetchgit { url = "https://cgit.krebsco.de/reaktor2"; - sha256 = "0wg76wlzfi893rl0lzhfs6bkpdcvwvgl6mpnz6w7r8f7znr4a9vr"; - rev = "0e199f7a357a4c5973e5837ec67699cf224ca69c"; + sha256 = "1kyr5i5zdzvc7fcyac1i1yvi88kcxafrgp8p79c1b9l4g9sjnv78"; + rev = "9f4e2644188f985d7cd806c13e2c0dee1688b9f0"; fetchSubmodules = true; }; isLibrary = false; -- cgit v1.2.3 From 79cad8349bf8bb20d13d23a498935277d779ef21 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 29 Jan 2019 21:39:16 +0100 Subject: bier bal: fix regex --- krebs/2configs/reaktor2.nix | 3 ++- krebs/3modules/reaktor2.nix | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/krebs/2configs/reaktor2.nix b/krebs/2configs/reaktor2.nix index ff6b539ba..4d90ae3d5 100644 --- a/krebs/2configs/reaktor2.nix +++ b/krebs/2configs/reaktor2.nix @@ -61,7 +61,7 @@ let ]; hooks.PRIVMSG = [ { - pattern = "^bier bal(ance)*$"; + pattern = "^bier bal(an(ce)?)?$"; activate = "match"; command = { env = { @@ -134,6 +134,7 @@ in { }; r = { nick = "reaktor2|krebs"; + sendDelaySec = null; plugins = [ { plugin = "register"; diff --git a/krebs/3modules/reaktor2.nix b/krebs/3modules/reaktor2.nix index e3e6ddf4f..9ab207d88 100644 --- a/krebs/3modules/reaktor2.nix +++ b/krebs/3modules/reaktor2.nix @@ -33,6 +33,10 @@ with import ; default = "reaktor2${optionalString (name != "default") "-${name}"}"; type = types.filename; }; + sendDelaySec = mkOption { + default = 0.7; + type = types.nullOr types.float; + }; username = mkOption { default = self.config.systemd-service-name; type = types.username; -- cgit v1.2.3 From 54517574ddb2f5ae10bba02f0b7f547bb53fc5bd Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 31 Jan 2019 11:15:58 +0100 Subject: tv rxvt_unicode: fetch patch --- tv/5pkgs/override/default.nix | 2 +- tv/5pkgs/override/rxvt_unicode.nix | 9 +++++ tv/5pkgs/override/rxvt_unicode/default.nix | 6 ---- .../rxvt_unicode/finish-running-selection.patch | 41 ---------------------- 4 files changed, 10 insertions(+), 48 deletions(-) create mode 100644 tv/5pkgs/override/rxvt_unicode.nix delete mode 100644 tv/5pkgs/override/rxvt_unicode/default.nix delete mode 100644 tv/5pkgs/override/rxvt_unicode/finish-running-selection.patch diff --git a/tv/5pkgs/override/default.nix b/tv/5pkgs/override/default.nix index cd7c5645b..99c1b3ec9 100644 --- a/tv/5pkgs/override/default.nix +++ b/tv/5pkgs/override/default.nix @@ -1,6 +1,6 @@ with import ; self: super: { - rxvt_unicode = self.callPackage ./rxvt_unicode { + rxvt_unicode = self.callPackage ./rxvt_unicode.nix { rxvt_unicode = super.rxvt_unicode; }; } diff --git a/tv/5pkgs/override/rxvt_unicode.nix b/tv/5pkgs/override/rxvt_unicode.nix new file mode 100644 index 000000000..da657fb20 --- /dev/null +++ b/tv/5pkgs/override/rxvt_unicode.nix @@ -0,0 +1,9 @@ +{ fetchurl, rxvt_unicode }: +rxvt_unicode.overrideAttrs (old: { + patches = old.patches ++ [ + (fetchurl { + url = https://cgit.krebsco.de/rxvt-unicode/patch/?id=15f3f94; + sha256 = "12vldwsds27c9l15ffc6svk9mj17jhypcz736pvpmpqbsymlkz2p"; + }) + ]; +}) diff --git a/tv/5pkgs/override/rxvt_unicode/default.nix b/tv/5pkgs/override/rxvt_unicode/default.nix deleted file mode 100644 index 858a46be6..000000000 --- a/tv/5pkgs/override/rxvt_unicode/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ rxvt_unicode }: -rxvt_unicode.overrideAttrs (old: { - patches = old.patches ++ [ - ./finish-running-selection.patch - ]; -}) diff --git a/tv/5pkgs/override/rxvt_unicode/finish-running-selection.patch b/tv/5pkgs/override/rxvt_unicode/finish-running-selection.patch deleted file mode 100644 index a342ccf5c..000000000 --- a/tv/5pkgs/override/rxvt_unicode/finish-running-selection.patch +++ /dev/null @@ -1,41 +0,0 @@ -diff --git a/src/rxvttoolkit.h b/src/rxvttoolkit.h -index 56c9a3f..429055d 100644 ---- a/src/rxvttoolkit.h -+++ b/src/rxvttoolkit.h -@@ -384,6 +384,7 @@ struct rxvt_selection - { - rxvt_selection (rxvt_display *disp, int selnum, Time tm, Window win, Atom prop, rxvt_term *term); - void run (); -+ void finish (char *data = 0, unsigned int len = 0); - ~rxvt_selection (); - - rxvt_term *term; // terminal to paste to, may be 0 -@@ -404,7 +405,6 @@ private: - void timer_cb (ev::timer &w, int revents); ev::timer timer_ev; - void x_cb (XEvent &xev); xevent_watcher x_ev; - -- void finish (char *data = 0, unsigned int len = 0); - void stop (); - bool request (Atom target, int selnum); - void handle_selection (Window win, Atom prop, bool delete_prop); -diff --git a/src/screen.C b/src/screen.C -index 9eb375a..77e7109 100644 ---- a/src/screen.C -+++ b/src/screen.C -@@ -2736,11 +2736,11 @@ rxvt_term::paste (char *data, unsigned int len) NOTHROW - void - rxvt_term::selection_request (Time tm, int selnum) NOTHROW - { -- if (!selection_req) -- { -- selection_req = new rxvt_selection (display, selnum, tm, vt, xa[XA_VT_SELECTION], this); -- selection_req->run (); -- } -+ if (selection_req) -+ selection_req->finish (); -+ -+ selection_req = new rxvt_selection (display, selnum, tm, vt, xa[XA_VT_SELECTION], this); -+ selection_req->run (); - } - - /* ------------------------------------------------------------------------- */ -- cgit v1.2.3 From 478b45cf97007e3aa846a30360de2b1c9833bf85 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 31 Jan 2019 14:39:02 +0100 Subject: krebs-hosts-*: generate from krebs.hosts --- krebs/3modules/hosts.nix | 57 ++++++++++++++++++++++++++++++++++++++- krebs/3modules/retiolum-hosts.nix | 26 +++--------------- 2 files changed, 59 insertions(+), 24 deletions(-) diff --git a/krebs/3modules/hosts.nix b/krebs/3modules/hosts.nix index 0985bb539..eb7fd2283 100644 --- a/krebs/3modules/hosts.nix +++ b/krebs/3modules/hosts.nix @@ -1,6 +1,5 @@ with import ; { config, ... }: let - # TODO dedup functions with ./retiolum-hosts.nix check = hostname: any (domain: hasSuffix ".${domain}" hostname) domains; domains = attrNames (filterAttrs (_: eq "hosts") config.krebs.dns.providers); in { @@ -30,6 +29,62 @@ in { map (addr: { ${addr} = aliases; }) net.addrs) (attrValues host.nets)) (attrValues config.krebs.hosts))); + + nixpkgs.config.packageOverrides = super: let + # nameValuePair name value : { "name" : name, "value" : value } + + # addr : str + # aliase : str + # hostname : str + # netname : str + + # addrAliases : nameValuePair addr [alias] + + # hostNetAliases : host -> { ${netname} : [addrAliases] } + hostNetAliases = host: + mapAttrs (_: net: filter (x: x.name != null) [ + { name = net.ip4.addr or null; value = net.aliases; } + { name = net.ip6.addr or null; value = net.aliases; } + ]) host.nets; + + # netAliases : { ${netname} : [addrAliases] } + netAliases = + foldl' + (result: host: + foldl' + # λ netAliases -> [addrAliases] -> netAliases + (result: { name, value }: result // { + ${name} = result.${name} or [] ++ value; + }) + result + (mapAttrsToList nameValuePair (hostNetAliases host)) + ) + {} + (attrValues config.krebs.hosts); + + # allAddrAliases : [addrAliases] + allAddrAliases = + flatten + (map + (host: attrValues (hostNetAliases host)) + (attrValues config.krebs.hosts)); + + # writeHosts : str -> [addrAliases] -> package + writeHosts = name: addrAliases: super.writeText name '' + ${concatMapStringsSep + "\n" + ({ name, value }: "${name} ${toString value}") + addrAliases} + ''; + in + { + krebs-hosts = writeHosts "krebs-hosts" allAddrAliases; + } + // + genAttrs' (attrNames netAliases) (netname: rec { + name = "krebs-hosts-${netname}"; + value = writeHosts name netAliases.${netname}; + }); }; } diff --git a/krebs/3modules/retiolum-hosts.nix b/krebs/3modules/retiolum-hosts.nix index ddf85ead7..2da174bea 100644 --- a/krebs/3modules/retiolum-hosts.nix +++ b/krebs/3modules/retiolum-hosts.nix @@ -1,28 +1,8 @@ with import ; -{ config, ... }: let - # TODO dedup functions with ./hosts.nix - check = hostname: any (domain: hasSuffix ".${domain}" hostname) domains; - domains = attrNames (filterAttrs (_: eq "hosts") config.krebs.dns.providers); -in { +{ config, pkgs, ... }: { nixpkgs.config.packageOverrides = super: { retiolum-hosts = - super.writeText "retiolum-hosts" '' - ${ - concatStringsSep - "\n" - (flatten - (map - (host: let - net = host.nets.retiolum; - aliases = longs; - longs = filter check net.aliases; - in - optionals - (aliases != []) - (map (addr: "${addr} ${toString aliases}") net.addrs)) - (filter (host: hasAttr "retiolum" host.nets) - (attrValues config.krebs.hosts)))) - } - ''; + trace "pkgs.retiolum-hosts is deprecated, use pkgs.krebs-hosts-retiolum instead" + pkgs.krebs-hosts-retiolum; }; } -- cgit v1.2.3 From 5c076d9f37dc495b7a61cae84c5600b1ff7a5d09 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 31 Jan 2019 14:40:57 +0100 Subject: retiolum-hosts: RIP --- krebs/3modules/default.nix | 1 - krebs/3modules/retiolum-hosts.nix | 8 -------- lass/2configs/websites/lassulus.nix | 2 +- 3 files changed, 1 insertion(+), 10 deletions(-) delete mode 100644 krebs/3modules/retiolum-hosts.nix diff --git a/krebs/3modules/default.nix b/krebs/3modules/default.nix index 9303a81fb..c72215e79 100644 --- a/krebs/3modules/default.nix +++ b/krebs/3modules/default.nix @@ -45,7 +45,6 @@ let ./reaktor2.nix ./realwallpaper.nix ./retiolum-bootstrap.nix - ./retiolum-hosts.nix ./rtorrent.nix ./secret.nix ./setuid.nix diff --git a/krebs/3modules/retiolum-hosts.nix b/krebs/3modules/retiolum-hosts.nix deleted file mode 100644 index 2da174bea..000000000 --- a/krebs/3modules/retiolum-hosts.nix +++ /dev/null @@ -1,8 +0,0 @@ -with import ; -{ config, pkgs, ... }: { - nixpkgs.config.packageOverrides = super: { - retiolum-hosts = - trace "pkgs.retiolum-hosts is deprecated, use pkgs.krebs-hosts-retiolum instead" - pkgs.krebs-hosts-retiolum; - }; -} diff --git a/lass/2configs/websites/lassulus.nix b/lass/2configs/websites/lassulus.nix index 27cadd100..526909e8a 100644 --- a/lass/2configs/websites/lassulus.nix +++ b/lass/2configs/websites/lassulus.nix @@ -61,7 +61,7 @@ in { alias ${config.krebs.tinc.retiolum.hostsArchive}; ''; locations."= /retiolum.hosts".extraConfig = '' - alias ${pkgs.retiolum-hosts}; + alias ${pkgs.krebs-hosts-retiolum}; ''; locations."= /wireguard-key".extraConfig = '' alias ${pkgs.writeText "prism.wg" config.krebs.hosts.prism.nets.wiregrill.wireguard.pubkey}; -- cgit v1.2.3 From a09bf933da2d31645872f1e2332507da98fb6a00 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 31 Jan 2019 15:02:05 +0100 Subject: krebs-hosts_combined: init --- krebs/3modules/hosts.nix | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/krebs/3modules/hosts.nix b/krebs/3modules/hosts.nix index eb7fd2283..3d572c04d 100644 --- a/krebs/3modules/hosts.nix +++ b/krebs/3modules/hosts.nix @@ -62,13 +62,6 @@ in { {} (attrValues config.krebs.hosts); - # allAddrAliases : [addrAliases] - allAddrAliases = - flatten - (map - (host: attrValues (hostNetAliases host)) - (attrValues config.krebs.hosts)); - # writeHosts : str -> [addrAliases] -> package writeHosts = name: addrAliases: super.writeText name '' ${concatMapStringsSep @@ -78,7 +71,18 @@ in { ''; in { - krebs-hosts = writeHosts "krebs-hosts" allAddrAliases; + # hosts file for all krebs networks + krebs-hosts = + writeHosts "krebs-hosts" (concatLists [ + netAliases.internet + netAliases.retiolum + netAliases.wiregrill + ]); + + # combined hosts file for all networks (even custom ones) + krebs-hosts_combined = + writeHosts "krebs-hosts_combined" + (concatLists (attrValues netAliases)); } // genAttrs' (attrNames netAliases) (netname: rec { -- cgit v1.2.3 From 936bf9f7b2a7cf99d48fe4cdf1e8cffd0140240f Mon Sep 17 00:00:00 2001 From: lassulus Date: Fri, 1 Feb 2019 21:15:27 +0100 Subject: remove kruck.r, add pepe.r --- krebs/3modules/external/default.nix | 37 +++++++++++------------------------ krebs/3modules/external/tinc/pepe.pub | 13 ++++++++++++ 2 files changed, 24 insertions(+), 26 deletions(-) create mode 100644 krebs/3modules/external/tinc/pepe.pub diff --git a/krebs/3modules/external/default.nix b/krebs/3modules/external/default.nix index 089113ac6..e19ac6755 100644 --- a/krebs/3modules/external/default.nix +++ b/krebs/3modules/external/default.nix @@ -176,32 +176,6 @@ in { }; }; }; - kruck = { - owner = config.krebs.users.palo; - nets = { - retiolum = { - ip4.addr = "10.243.29.201"; - aliases = [ - "kruck.r" - ]; - tinc.pubkey = '' - -----BEGIN RSA PUBLIC KEY----- - MIICCgKCAgEAxcui2sirT5YY9HrSauj9nSF3AxUnfd2CCEGyzmzbi5+qw8T9jdNh - QcIG3s+eC3uEy6leL/eeR4NjVtQRt8CDmhGul95Vs3I1jx9gdvYR+HOatPgK0YQA - EFwk0jv8Z8tOc87X1qwA00Gb+25+kAzsf+8+4HQuh/szSGje3RBmBFkUyNHh8R0U - uzs8NSTRdN+edvYtzjnYcE1sq59HFBPkVcJNp5I3qYTp6m9SxGHMvsq6vRpNnjq/ - /RZVBhnPDBlgxia/aVfVQKeEOHZV3svLvsJzGDrUWsJCEvF0YwW4bvohY19myTNR - 9lXo/VFx86qAkY09il2OloE7iu5cA2RV+FWwLeajE9vIDA06AD7nECVgthNoZd1s - qsDfuu3WqlpyBmr6XhRkYOFFE4xVLrZ0vItGYlgR2UPp9TjHrzfsedoyJoJAbhMH - gDlFgiHlAy1fhG1sCX5883XmSjWn0eJwmZ2O9sZNBP5dxfGUXg/x8NWfQj7E1lqj - jQ59UC6yiz7bFtObKvpdn1D4tPbqBvndZzn19U/3wKo+cCBRjtLmUD7HQHC65dCs - fAiCFvUTVMM3SNDvYChm0U/KGjZZFwQ+cCLj1JNVPet2C+CJ0qI2muXOnCuv/0o5 - TBZrrHMpj6Th8AiOgeMVuxzjX1FsmAThWj9Qp/jQu6O0qvnkUNaU7I8CAwEAAQ== - -----END RSA PUBLIC KEY----- - ''; - }; - }; - }; qubasa = { owner = config.krebs.users.qubasa; nets = { @@ -251,6 +225,17 @@ in { }; }; }; + pepe = { + owner = config.krebs.users.palo; + nets = { + retiolum = { + ip4.addr = "10.243.123.4"; + tinc.port = 720; + aliases = [ "pepe.r" ]; + tinc.pubkey = tinc-for "pepe"; + }; + }; + }; scardanelli = { owner = config.krebs.users.kmein; nets = { diff --git a/krebs/3modules/external/tinc/pepe.pub b/krebs/3modules/external/tinc/pepe.pub new file mode 100644 index 000000000..65284d51d --- /dev/null +++ b/krebs/3modules/external/tinc/pepe.pub @@ -0,0 +1,13 @@ +-----BEGIN RSA PUBLIC KEY----- +MIICCgKCAgEA2ACttoosnRZ99o+OyMrxBdUWPqsT5btzSIQ5dU1XWqGjO4nRchCE +8tO0b/4jqVgJVTRZVIUJQESZRlSmclsCAjdM8tsGj74CJrm7tBvgbBn2IObSs5+4 +oJWe57VsQaeHPuI2JZuGqv8Z3Esw+B07bQS5VTaC1ISo7vnLG/q5XLCbKHB9JZc/ +ztYbk4bEQHwbulfoPjD9FY3heLnTzqPw9Xr3ixao5gbAXfWNJM+iCluMq+Q2g1BD +ozSnyYvaGLQ6h4yksDp+xuK8YCqiRj174EkXySI8Jee1CBMuI8ciX/5Q7yzvzscQ +ZQ/MLVdx3MRW+VeT0ctaRzoA9E09ILqPe+56DjpsKzt4Ne8qeMG5HdpzO9UdNzTu +MuibsCL7CJy5Ytl38PK+LAXHQr3Os1Z4OHjeTZ38vTAZcOUJZEkl6w9nO1XjcyBL +rIaG+20Nx0ZU79MlJZFiG7ovlUiDfIEKNygng8v/yoTMaqMYLxQZ/leQwLMNLujo +sku8+oV4Jvx4SyUjuAS6jgG9CnejLCnHP/yyDGdaMQSzmlzYXacLMfnPZE3r7bj1 +EjA6yQbkPixm7xLCyMm5u2leWtqtbg1oRA6Mw3UyYkNy3hiTU+jTvztEI3SCliDH +yjGlESH4/edryKjLNjmYP77VFbM9ZSQ+QGlbMGPvjcn6XCdJGdxm3PUCAwEAAQ== +-----END RSA PUBLIC KEY----- -- cgit v1.2.3 From db9163a6005ad7e6f78a67c6a306cb4fa183698f Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 1 Feb 2019 22:31:43 +0100 Subject: ma nixpkgs: 1258730 -> 30a126c --- makefu/nixpkgs.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/makefu/nixpkgs.json b/makefu/nixpkgs.json index d62fd65ca..1788a17fb 100644 --- a/makefu/nixpkgs.json +++ b/makefu/nixpkgs.json @@ -1,7 +1,7 @@ { "url": "https://github.com/makefu/nixpkgs", - "rev": "125873064a6eabd2896833d00aede7778a453fdf", - "date": "2019-01-11T14:24:21+01:00", - "sha256": "1ki50426m9simqvxdzckfgycibz5rdhwl6hzi31i72dqiafl8j6s", + "rev": "30a126c41eb81e96474d7f8488635fc36d78dd25", + "date": "2019-02-01T22:09:16+01:00", + "sha256": "1s5y22fs08wyw1izmaqd5dcnflw3rvkm3880vmlwv20g1phwhhi2", "fetchSubmodules": false } -- cgit v1.2.3 From e2ae92445cc439203427a58720fc394cf1ca4b44 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 2 Feb 2019 09:13:53 +0100 Subject: external: add palo.nix --- krebs/3modules/external/default.nix | 14 +----- krebs/3modules/external/palo.nix | 81 +++++++++++++++++++++++++++++++++++ krebs/3modules/external/tinc/palo.pub | 13 ++++++ krebs/3modules/external/tinc/pepe.pub | 13 ------ 4 files changed, 95 insertions(+), 26 deletions(-) create mode 100644 krebs/3modules/external/palo.nix create mode 100644 krebs/3modules/external/tinc/palo.pub delete mode 100644 krebs/3modules/external/tinc/pepe.pub diff --git a/krebs/3modules/external/default.nix b/krebs/3modules/external/default.nix index e19ac6755..16cc84651 100644 --- a/krebs/3modules/external/default.nix +++ b/krebs/3modules/external/default.nix @@ -16,6 +16,7 @@ with import ; tinc-for = name: builtins.readFile (./tinc + "/${name}.pub"); in { + hosts = mapAttrs hostDefaults { dpdkm = { owner = config.krebs.users.Mic92; @@ -225,17 +226,6 @@ in { }; }; }; - pepe = { - owner = config.krebs.users.palo; - nets = { - retiolum = { - ip4.addr = "10.243.123.4"; - tinc.port = 720; - aliases = [ "pepe.r" ]; - tinc.pubkey = tinc-for "pepe"; - }; - }; - }; scardanelli = { owner = config.krebs.users.kmein; nets = { @@ -404,8 +394,6 @@ in { mail = "joerg@thalheim.io"; pubkey = ssh-for "Mic92"; }; - palo = { - }; qubasa = { mail = "luis.nixos@gmail.com"; }; diff --git a/krebs/3modules/external/palo.nix b/krebs/3modules/external/palo.nix new file mode 100644 index 000000000..e151ad358 --- /dev/null +++ b/krebs/3modules/external/palo.nix @@ -0,0 +1,81 @@ +with import ; +{ config, ... }: let + + hostDefaults = hostName: host: flip recursiveUpdate host ({ + ci = false; + external = true; + monitoring = false; + } // optionalAttrs (host.nets?retiolum) { + nets.retiolum.ip6.addr = + (krebs.genipv6 "retiolum" "external" { inherit hostName; }).address; + } // optionalAttrs (host.nets?wiregrill) { + nets.wiregrill.ip6.addr = + (krebs.genipv6 "wiregrill" "external" { inherit hostName; }).address; + }); + ssh-for = name: builtins.readFile (./ssh + "/${name}.pub"); + tinc-for = name: builtins.readFile (./tinc + "/${name}.pub"); + +in { + hosts = mapAttrs hostDefaults { + pepe = { + owner = config.krebs.users.palo; + nets = { + retiolum = { + ip4.addr = "10.243.23.1"; + tinc.port = 720; + aliases = [ "pepe.r" ]; + tinc.pubkey = tinc-for "palo"; + }; + }; + }; + kruck = { + owner = config.krebs.users.palo; + nets = { + retiolum = { + ip4.addr = "10.243.23.3"; + tinc.port = 720; + aliases = [ "kruck.r" ]; + tinc.pubkey = tinc-for "palo"; + }; + }; + }; + schasch = { + owner = config.krebs.users.palo; + nets = { + retiolum = { + ip4.addr = "10.243.23.2"; + tinc.port = 720; + aliases = [ "schasch.r" ]; + tinc.pubkey = tinc-for "palo"; + }; + }; + }; + workhorse = { + owner = config.krebs.users.palo; + nets = { + retiolum = { + ip4.addr = "10.243.23.5"; + tinc.port = 720; + aliases = [ "workhorse.r" ]; + tinc.pubkey = tinc-for "palo"; + }; + }; + }; + workout = { + owner = config.krebs.users.palo; + nets = { + retiolum = { + ip4.addr = "10.243.23.4"; + tinc.port = 720; + aliases = [ "workout.r" ]; + tinc.pubkey = tinc-for "palo"; + }; + }; + }; + }; + users = { + palo = { + }; + }; +} + diff --git a/krebs/3modules/external/tinc/palo.pub b/krebs/3modules/external/tinc/palo.pub new file mode 100644 index 000000000..65284d51d --- /dev/null +++ b/krebs/3modules/external/tinc/palo.pub @@ -0,0 +1,13 @@ +-----BEGIN RSA PUBLIC KEY----- +MIICCgKCAgEA2ACttoosnRZ99o+OyMrxBdUWPqsT5btzSIQ5dU1XWqGjO4nRchCE +8tO0b/4jqVgJVTRZVIUJQESZRlSmclsCAjdM8tsGj74CJrm7tBvgbBn2IObSs5+4 +oJWe57VsQaeHPuI2JZuGqv8Z3Esw+B07bQS5VTaC1ISo7vnLG/q5XLCbKHB9JZc/ +ztYbk4bEQHwbulfoPjD9FY3heLnTzqPw9Xr3ixao5gbAXfWNJM+iCluMq+Q2g1BD +ozSnyYvaGLQ6h4yksDp+xuK8YCqiRj174EkXySI8Jee1CBMuI8ciX/5Q7yzvzscQ +ZQ/MLVdx3MRW+VeT0ctaRzoA9E09ILqPe+56DjpsKzt4Ne8qeMG5HdpzO9UdNzTu +MuibsCL7CJy5Ytl38PK+LAXHQr3Os1Z4OHjeTZ38vTAZcOUJZEkl6w9nO1XjcyBL +rIaG+20Nx0ZU79MlJZFiG7ovlUiDfIEKNygng8v/yoTMaqMYLxQZ/leQwLMNLujo +sku8+oV4Jvx4SyUjuAS6jgG9CnejLCnHP/yyDGdaMQSzmlzYXacLMfnPZE3r7bj1 +EjA6yQbkPixm7xLCyMm5u2leWtqtbg1oRA6Mw3UyYkNy3hiTU+jTvztEI3SCliDH +yjGlESH4/edryKjLNjmYP77VFbM9ZSQ+QGlbMGPvjcn6XCdJGdxm3PUCAwEAAQ== +-----END RSA PUBLIC KEY----- diff --git a/krebs/3modules/external/tinc/pepe.pub b/krebs/3modules/external/tinc/pepe.pub deleted file mode 100644 index 65284d51d..000000000 --- a/krebs/3modules/external/tinc/pepe.pub +++ /dev/null @@ -1,13 +0,0 @@ ------BEGIN RSA PUBLIC KEY----- -MIICCgKCAgEA2ACttoosnRZ99o+OyMrxBdUWPqsT5btzSIQ5dU1XWqGjO4nRchCE -8tO0b/4jqVgJVTRZVIUJQESZRlSmclsCAjdM8tsGj74CJrm7tBvgbBn2IObSs5+4 -oJWe57VsQaeHPuI2JZuGqv8Z3Esw+B07bQS5VTaC1ISo7vnLG/q5XLCbKHB9JZc/ -ztYbk4bEQHwbulfoPjD9FY3heLnTzqPw9Xr3ixao5gbAXfWNJM+iCluMq+Q2g1BD -ozSnyYvaGLQ6h4yksDp+xuK8YCqiRj174EkXySI8Jee1CBMuI8ciX/5Q7yzvzscQ -ZQ/MLVdx3MRW+VeT0ctaRzoA9E09ILqPe+56DjpsKzt4Ne8qeMG5HdpzO9UdNzTu -MuibsCL7CJy5Ytl38PK+LAXHQr3Os1Z4OHjeTZ38vTAZcOUJZEkl6w9nO1XjcyBL -rIaG+20Nx0ZU79MlJZFiG7ovlUiDfIEKNygng8v/yoTMaqMYLxQZ/leQwLMNLujo -sku8+oV4Jvx4SyUjuAS6jgG9CnejLCnHP/yyDGdaMQSzmlzYXacLMfnPZE3r7bj1 -EjA6yQbkPixm7xLCyMm5u2leWtqtbg1oRA6Mw3UyYkNy3hiTU+jTvztEI3SCliDH -yjGlESH4/edryKjLNjmYP77VFbM9ZSQ+QGlbMGPvjcn6XCdJGdxm3PUCAwEAAQ== ------END RSA PUBLIC KEY----- -- cgit v1.2.3 From 1242c7e25520580e00a2fabf695fb895657144f0 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 2 Feb 2019 09:22:06 +0100 Subject: krebs-hosts-*: don't add lines without alias --- krebs/3modules/hosts.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/krebs/3modules/hosts.nix b/krebs/3modules/hosts.nix index 3d572c04d..7fe01a769 100644 --- a/krebs/3modules/hosts.nix +++ b/krebs/3modules/hosts.nix @@ -42,7 +42,7 @@ in { # hostNetAliases : host -> { ${netname} : [addrAliases] } hostNetAliases = host: - mapAttrs (_: net: filter (x: x.name != null) [ + mapAttrs (_: net: filter (x: x.name != null && x.value != []) [ { name = net.ip4.addr or null; value = net.aliases; } { name = net.ip6.addr or null; value = net.aliases; } ]) host.nets; -- cgit v1.2.3 From 8b6e3765de2c82929ec63843e9a782886eb0da4e Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 2 Feb 2019 20:14:29 +0100 Subject: tv vim-syntax-nix-nested: add writer{Ext,Name} --- tv/2configs/vim.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index 3794628c1..9f78d6e0b 100644 --- a/tv/2configs/vim.nix +++ b/tv/2configs/vim.nix @@ -250,6 +250,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 +260,7 @@ let { haskell = {}; jq.extraStart = alts [ (writer "Jq") - ''write[^ \t\r\n]*[ \t\r\n]*"[^"]*\.jq"'' + (writerExt "jq") ]; javascript.extraStart = ''/\* js \*/''; lua = {}; @@ -287,8 +290,10 @@ let { (writer (alts (map capitalize shells))) ]; yaml = {}; - vim.extraStart = - ''write[^ \t\r\n]*[ \t\r\n]*"\(\([^"]*\.\)\?vimrc\|[^"]*\.vim\)"''; + vim.extraStart = alts [ + (writerExt "vim") + (writerName ''\([^"]*\.\)\?vimrc'') + ]; xdefaults = {}; }))} -- cgit v1.2.3 From 5aea1da2e1e545caf8e8f41b2ce9d589562165c2 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 2 Feb 2019 20:20:44 +0100 Subject: tv vim-syntax-nix-nested: detect .vim".text --- tv/2configs/vim.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index 9f78d6e0b..7e37ef329 100644 --- a/tv/2configs/vim.nix +++ b/tv/2configs/vim.nix @@ -130,14 +130,14 @@ let { ''; }))) ((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 @@ -291,6 +291,7 @@ let { ]; yaml = {}; vim.extraStart = alts [ + (def ''"[^"]*\.vim"\.text'') (writerExt "vim") (writerName ''\([^"]*\.\)\?vimrc'') ]; @@ -334,7 +335,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=";\|$" -- cgit v1.2.3 From 9335c2616a01d3d6e21288d79bd64024578e3c38 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 2 Feb 2019 20:24:11 +0100 Subject: tv vim haskell: isk+=' --- tv/2configs/vim.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index 7e37ef329..fe1482817 100644 --- a/tv/2configs/vim.nix +++ b/tv/2configs/vim.nix @@ -129,6 +129,19 @@ 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+=' + ''; + })) ((rtp: rtp // { inherit rtp; }) (pkgs.write "vim-syntax-nix-nested" { "/syntax/haskell.vim".text = '' syn region String start=+\[[[:alnum:]]*|+ end=+|]+ -- cgit v1.2.3 From 4961c28dae4e7b3903fb6b0792960dc4f82ae24c Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 2 Feb 2019 21:21:48 +0100 Subject: tv vim: add TODO ft --- tv/2configs/vim.nix | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index fe1482817..de843a30f 100644 --- a/tv/2configs/vim.nix +++ b/tv/2configs/vim.nix @@ -141,6 +141,43 @@ let { 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-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 = '' -- cgit v1.2.3 From 4be997d42348cc05065e3439007c8a2d32feaa04 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 2 Feb 2019 23:15:16 +0100 Subject: tv vim todo: allow A-Z in tags --- tv/2configs/vim.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index de843a30f..575a3bcb0 100644 --- a/tv/2configs/vim.nix +++ b/tv/2configs/vim.nix @@ -162,7 +162,7 @@ let { \ start="." end="$\n" \ nextgroup=todoBlock - syn match todoTag /\[[a-z]\+\]/hs=s+1,he=e-1 + syn match todoTag /\[[A-Za-z]\+\]/hs=s+1,he=e-1 \ contained syn region todoBlock -- cgit v1.2.3 From db791d662c433c482e547f70443b35129de8f541 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 3 Feb 2019 13:39:30 +0100 Subject: tv vim todo: form feed ends a block --- tv/2configs/vim.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index 575a3bcb0..9942ff65b 100644 --- a/tv/2configs/vim.nix +++ b/tv/2configs/vim.nix @@ -169,7 +169,7 @@ let { \ contained \ contains=Comment \ fold - \ start="^[^1-9]" end="^[1-9]"re=s-1,he=s-1,me=s-1 + \ start="^[^1-9]" end="^[1-9 ]"re=s-1,he=s-1,me=s-1 syn sync minlines=1000 -- cgit v1.2.3 From 80c2ab739d2d51bf47b07fd6f39508a85077b0e6 Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 3 Feb 2019 23:17:52 +0100 Subject: ma dict: actually use the dict server --- makefu/2configs/dict.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/makefu/2configs/dict.nix b/makefu/2configs/dict.nix index 6db9102ba..08f1f8502 100644 --- a/makefu/2configs/dict.nix +++ b/makefu/2configs/dict.nix @@ -1,5 +1,6 @@ { pkgs, ... }: { + environment.shellAliases.dict = "dict -h 127.0.0.1"; services.dictd.enable = true; services.dictd.DBs = with pkgs.dictdDBs; [ wiktionary wordnet deu2eng eng2deu ]; } -- cgit v1.2.3 From df0d079ba03c0b2a98fbdede8322e080ffce60ed Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 5 Feb 2019 11:00:10 +0100 Subject: tv bash-fzf-history: init --- tv/5pkgs/simple/bash-fzf-history.nix | 91 ++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 tv/5pkgs/simple/bash-fzf-history.nix diff --git a/tv/5pkgs/simple/bash-fzf-history.nix b/tv/5pkgs/simple/bash-fzf-history.nix new file mode 100644 index 000000000..e9a21b95d --- /dev/null +++ b/tv/5pkgs/simple/bash-fzf-history.nix @@ -0,0 +1,91 @@ +with import ; +{ pkgs + +, edit-key ? "ctrl-e" +, exec-key ? "enter" +, edit-mark ? "${mark-prefix}${edit-key}" +, exec-mark ? "${mark-prefix}${exec-key}" +, edit-command ? "\"\"" +, exec-command ? "accept-line" +, mark-prefix ? " #FZFKEY:" +, finish-keyseq ? "\\C-x\\C-p" +, rebind-keyseq ? "\\C-x\\C-o" + +, start-keyseq ? "\\C-f" +, load-keyseq ? start-keyseq +}: let + script = pkgs.writeBash "bash-fzf-history.sh" '' + if ! command -v fzf >/dev/null; then + # Alternatively rewrite ${pkgs.fzf}/share/fzf/* to use absolute paths. + fzf() { + ${pkgs.fzf}/bin/fzf "$@" + } + fi + + . ${pkgs.fzf}/share/fzf/key-bindings.bash + . ${pkgs.fzf}/share/fzf/completion.bash + + FZF_DEFAULT_OPTS='${toString [ + /* sh */ "--height=40%" + /* sh */ "--inline-info" + /* sh */ "--min-height=4" + /* sh */ "--reverse" + ]}' + + __fzf_history__() ( + result=$( + HISTTIMEFORMAT= history | + FZF_DEFAULT_OPTS="${toString [ + /* sh */ "--tac" + /* sh */ "--sync" + /* sh */ "-n2..,.." + /* sh */ "--tiebreak=index" + /* sh */ "--bind=ctrl-r:toggle-sort" + /* sh */ "--expect=${edit-key},${exec-key}" + /* sh */ "$FZF_DEFAULT_OPTS" + /* sh */ "+m" + ]}" \ + ${pkgs.fzf}/bin/fzf + ) + if test -n "$result"; then + shopt -s extglob + + key=''${result%%$'\n'*} + line=''${result##*([^0-9])} + index=''${line%%[^0-9]*} + command=''${line##*([0-9 ])} + + echo "$command${mark-prefix}$key" + else + # Ensure no empty new line gets produced when fzf was aborted. + echo '${edit-mark}' + fi + ) + + __fzf_rebind_finish_keyseq__() { + local suffix= + case $READLINE_LINE in + *'${edit-mark}') + suffix='${edit-mark}' + bind '"${finish-keyseq}": ${edit-command}' + ;; + *'${exec-mark}') + suffix='${exec-mark}' + bind '"${finish-keyseq}": ${exec-command}' + ;; + esac + READLINE_LINE=${"\${READLINE_LINE:0:-\${#suffix}}"} + } + bind -x '"${rebind-keyseq}": __fzf_rebind_finish_keyseq__' + + bind '"\C-r": reverse-search-history' + bind '"${start-keyseq}": " \C-e\C-u\C-y\ey\C-u`__fzf_history__`\e\C-e\er\e^${rebind-keyseq}${finish-keyseq}"' + + echo '# fzf key bindings loaded:' >&2 + bind -s | ${pkgs.gnugrep}/bin/grep __fzf_ >&2 + ''; +in + script // + rec { + bind = /* sh */ ''bind -x '"${load-keyseq}": . ${script}' ''; + } -- cgit v1.2.3 From 5ddac6d53dd1ad6ae0767ef6a99b0ac7de695e23 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 5 Feb 2019 11:00:57 +0100 Subject: tv bash: use fzf-history --- tv/2configs/bash/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tv/2configs/bash/default.nix b/tv/2configs/bash/default.nix index d7673931c..86e5598bb 100644 --- a/tv/2configs/bash/default.nix +++ b/tv/2configs/bash/default.nix @@ -27,6 +27,8 @@ with import ; export NIX_PATH="stockholm=$HOME/stockholm:$NIX_PATH" ;; esac + + ${pkgs.bash-fzf-history.bind} ''; promptInit = /* sh */ '' case $UID in -- cgit v1.2.3 From b7ced221a53c2fc95f630348cf5c7befd0c4a904 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 5 Feb 2019 11:06:17 +0100 Subject: tv bash: add timestamps to histfile --- tv/2configs/bash/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/tv/2configs/bash/default.nix b/tv/2configs/bash/default.nix index 86e5598bb..42914e060 100644 --- a/tv/2configs/bash/default.nix +++ b/tv/2configs/bash/default.nix @@ -8,6 +8,7 @@ with import ; HISTCONTROL='erasedups:ignorespace' HISTSIZE=65536 HISTFILESIZE=$HISTSIZE + HISTTIMEFORMAT= shopt -s checkhash shopt -s histappend histreedit histverify -- cgit v1.2.3 From 56d8366cfd011a0079ad731438f48280edfcbdca Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 5 Feb 2019 11:53:31 +0100 Subject: tv bash-fzf-history: use array instead of extglob --- tv/5pkgs/simple/bash-fzf-history.nix | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/tv/5pkgs/simple/bash-fzf-history.nix b/tv/5pkgs/simple/bash-fzf-history.nix index e9a21b95d..8b3fe9e58 100644 --- a/tv/5pkgs/simple/bash-fzf-history.nix +++ b/tv/5pkgs/simple/bash-fzf-history.nix @@ -33,7 +33,8 @@ with import ; ]}' __fzf_history__() ( - result=$( + IFS=$'\n' + result=( $( HISTTIMEFORMAT= history | FZF_DEFAULT_OPTS="${toString [ /* sh */ "--tac" @@ -45,15 +46,18 @@ with import ; /* sh */ "$FZF_DEFAULT_OPTS" /* sh */ "+m" ]}" \ - ${pkgs.fzf}/bin/fzf - ) + ${pkgs.fzf}/bin/fzf | + ${pkgs.gnused}/bin/sed ' + /^ *[0-9]/{ + s/^ *// + s/ \+/\n/;# index + } + ' + ) ) if test -n "$result"; then - shopt -s extglob - - key=''${result%%$'\n'*} - line=''${result##*([^0-9])} - index=''${line%%[^0-9]*} - command=''${line##*([0-9 ])} + key=''${result[0]} + index=''${result[1]} + command=''${result[2]} echo "$command${mark-prefix}$key" else -- cgit v1.2.3 From 79267b99a05a94df40c33ff5f7c651f83ed9334e Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 5 Feb 2019 11:54:03 +0100 Subject: tv bash-fzf-history: show timestamp --- tv/5pkgs/simple/bash-fzf-history.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tv/5pkgs/simple/bash-fzf-history.nix b/tv/5pkgs/simple/bash-fzf-history.nix index 8b3fe9e58..7b92ea0cd 100644 --- a/tv/5pkgs/simple/bash-fzf-history.nix +++ b/tv/5pkgs/simple/bash-fzf-history.nix @@ -35,8 +35,9 @@ with import ; __fzf_history__() ( IFS=$'\n' result=( $( - HISTTIMEFORMAT= history | + HISTTIMEFORMAT=$'\e[38;5;244m%Y-%m-%dT%H:%M:%S\e[m ' history | FZF_DEFAULT_OPTS="${toString [ + /* sh */ "--ansi" /* sh */ "--tac" /* sh */ "--sync" /* sh */ "-n2..,.." @@ -51,13 +52,15 @@ with import ; /^ *[0-9]/{ s/^ *// s/ \+/\n/;# index + s/ \+/\n/;# date } ' ) ) if test -n "$result"; then key=''${result[0]} index=''${result[1]} - command=''${result[2]} + date=''${result[2]} + command=''${result[3]} echo "$command${mark-prefix}$key" else -- cgit v1.2.3 From 9d6875b02e05ebf9bb56247438a3386b1415eb52 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 5 Feb 2019 13:11:46 +0100 Subject: tv bash-fzf-history: support unknown timestamps --- tv/5pkgs/simple/bash-fzf-history.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tv/5pkgs/simple/bash-fzf-history.nix b/tv/5pkgs/simple/bash-fzf-history.nix index 7b92ea0cd..b603dedd9 100644 --- a/tv/5pkgs/simple/bash-fzf-history.nix +++ b/tv/5pkgs/simple/bash-fzf-history.nix @@ -35,7 +35,12 @@ with import ; __fzf_history__() ( IFS=$'\n' result=( $( + # To add "unknown timestamps" to each line of the history: + # sed -i '/^#[0-9]/{n;b};s/^/#1\n/' "$HISTFILE" HISTTIMEFORMAT=$'\e[38;5;244m%Y-%m-%dT%H:%M:%S\e[m ' history | + ${pkgs.gnused}/bin/sed ' + s/\(\x1b\[[0-9;]*\)244m1970-[0-9T:-]*/\1237m????-??-??T??:??:??/ + ' | FZF_DEFAULT_OPTS="${toString [ /* sh */ "--ansi" /* sh */ "--tac" -- cgit v1.2.3 From 932d11ed9346fbef640604d1107be39e7c11be85 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 5 Feb 2019 20:14:55 +0100 Subject: external: add catullus.r --- krebs/3modules/external/default.nix | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/krebs/3modules/external/default.nix b/krebs/3modules/external/default.nix index 16cc84651..1f80906f8 100644 --- a/krebs/3modules/external/default.nix +++ b/krebs/3modules/external/default.nix @@ -18,6 +18,31 @@ with import ; in { hosts = mapAttrs hostDefaults { + catullus = { + owner = config.krebs.users.kmein; + nets = { + retiolum = { + ip4.addr = "10.243.2.3"; + aliases = [ "catullus.r" ]; + tinc.pubkey = '' + -----BEGIN PUBLIC KEY----- + MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA2tRtskPP6391+ZX9xzsx + CUotXuqYucYmnUbrRSIlxASVqTmAf3nDOE5EDBBcTdSwnb02JcJW4Zh7+BGgMxjF + GxDPs6ETI28mHK+6rp8TOkMnyDb5mtSGVZPvKJU9fFOt6aAX1J1BzTfwtHtVQq7K + WBzdpeKXlw4dIQ6K6SGmPIPpEh9pE1Xb+GuVljCXKxGJFbW40dmh2ZdadO7umBDu + vRk08jT9/BUnUP6KrZlvyePnG38z6srMrVU+XAHu5D2qZ9y+QIp3kw7Y5JUrNXc7 + 9q9P9TYx15GiIz2mSJKcLVmkLRebsaqdV7dBibPbfdGE+NB+F1FYPGDdW4cnonon + DzzjGm/FDfOCXEnSkYGQDBWpfd/8AWum1xGJxJCPNBJElGE2o5jDWo4Y1b9gHP0M + vARm8AOK8R1pQ7BP+pNMO0gGw2NDrtWiWpTeZ7SqXmZAZ/Gmyen9X+/fowcbTyDH + b9joIuMQeOtxbUV2JprZIdit9NBFSZq/7Re/GBUwjGBm3LabIXFNGKZovx/f9lf8 + r5tVs4SPauiKzZS0K1Gz1NSq+3OXaY5EwVrBUXptYqRT7uyhVloOPRUsqRFeB0Fn + Y5xOpDJ0UiJxgFbdH5Vb81D/VjNO9Q4nZib8wSEuLrYLHGoceQPX4+Ov9IdhIL4B + BMTCaF+VCWC5PCLr0e61KqMCAwEAAQ== + -----END PUBLIC KEY----- + ''; + }; + }; + }; dpdkm = { owner = config.krebs.users.Mic92; nets = rec { -- cgit v1.2.3 From 8de748b28738c3f4033a68dab8a01fcbeb691afb Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 5 Feb 2019 21:11:09 +0100 Subject: blessings: 2.1.0 -> 2.2.0 --- krebs/5pkgs/haskell/blessings.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/krebs/5pkgs/haskell/blessings.nix b/krebs/5pkgs/haskell/blessings.nix index 97e4a717c..f730cc72b 100644 --- a/krebs/5pkgs/haskell/blessings.nix +++ b/krebs/5pkgs/haskell/blessings.nix @@ -1,5 +1,5 @@ with import ; -{ mkDerivation, base, fetchgit, stdenv }: let +{ mkDerivation, base, fetchgit, hspec, QuickCheck, stdenv, text }: let cfg = { "18.03" = { @@ -7,8 +7,8 @@ with import ; sha256 = "1k908zap3694fcxdk4bb29s54b0lhdh557y10ybjskfwnym7szn1"; }; "18.09" = { - version = "2.1.0"; - sha256 = "0wc8v48bb0bkvypc0j6imvnf8xc8572hykk9sgjhzf2w0ggqxv5d"; + version = "2.2.0"; + sha256 = "1pb56dgf3jj2kq3cbbppwzyg3ccgqy9xara62hkjwyxzdx20clk1"; }; }.${versions.majorMinor nixpkgsVersion}; @@ -20,7 +20,8 @@ in mkDerivation { rev = "refs/tags/v${cfg.version}"; sha256 = cfg.sha256; }; - libraryHaskellDepends = [ base ]; + libraryHaskellDepends = [ base text ]; + testHaskellDepends = [ base hspec QuickCheck ]; doHaddock = false; # WTFPL is the true license, which is unknown to cabal. license = stdenv.lib.licenses.wtfpl; -- cgit v1.2.3 From 0b668099468313b4547e1044efdc380d58e1d43e Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 5 Feb 2019 22:32:28 +0100 Subject: ma flameshot: init --- makefu/2configs/home-manager/desktop.nix | 9 +++++++++ makefu/5pkgs/awesomecfg/default.nix | 3 ++- makefu/5pkgs/awesomecfg/full.cfg | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/makefu/2configs/home-manager/desktop.nix b/makefu/2configs/home-manager/desktop.nix index 3be020faa..63a5cdbef 100644 --- a/makefu/2configs/home-manager/desktop.nix +++ b/makefu/2configs/home-manager/desktop.nix @@ -11,6 +11,15 @@ services.network-manager-applet.enable = true; services.blueman-applet.enable = true; services.pasystray.enable = true; + services.flameshot.enable = true; + home.file.".config/Dharkael/flameshot.ini".text = '' + [General] + disabledTrayIcon=false + drawColor=@Variant(\0\0\0\x43\x1\xff\xff\0\0\0\0\xff\xff\0\0) + drawThickness=0 + filenamePattern=%F_%T_shot + ''; + systemd.user.services.pasystray.Service.Environment = "PATH=" + (lib.makeBinPath (with pkgs;[ pavucontrol paprefs /* pavumeter */ /* paman */ ]) ); programs.chromium = { enable = true; diff --git a/makefu/5pkgs/awesomecfg/default.nix b/makefu/5pkgs/awesomecfg/default.nix index 486c0ddf6..1ae2f50d9 100644 --- a/makefu/5pkgs/awesomecfg/default.nix +++ b/makefu/5pkgs/awesomecfg/default.nix @@ -5,6 +5,7 @@ , networkmanagerapplet , blueman , clipit +, flameshot , modkey ? "Mod4" , locker? "${pkgs.xlock}/bin/xlock -mode blank" , ... }: @@ -13,7 +14,7 @@ # replace: @alsaUtils@ @xlockmore@ @xbacklight@ @modkey@ full = lib.makeOverridable pkgs.substituteAll { name = "awesome_full_config"; - inherit alsaUtils locker xbacklight modkey networkmanagerapplet blueman clipit; + inherit alsaUtils locker xbacklight modkey networkmanagerapplet blueman clipit flameshot ; isExecutable = false; src = ./full.cfg; }; diff --git a/makefu/5pkgs/awesomecfg/full.cfg b/makefu/5pkgs/awesomecfg/full.cfg index 11f9f59b8..83dd79b4d 100644 --- a/makefu/5pkgs/awesomecfg/full.cfg +++ b/makefu/5pkgs/awesomecfg/full.cfg @@ -410,6 +410,7 @@ clientkeys = awful.util.table.join( -- minimized, since minimized clients can't have the focus. c.minimized = true end), + awful.key({ }, "Print", function () awful.util.spawn("@flameshot@/bin/flameshot gui") end), awful.key({ modkey, }, "m", function (c) c.maximized = not c.maximized -- cgit v1.2.3 From d47dcb07825f548c76323143d6f3e04d6a9c773e Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 5 Feb 2019 22:32:53 +0100 Subject: ma gum: use aarch64 builder --- makefu/1systems/gum/config.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/makefu/1systems/gum/config.nix b/makefu/1systems/gum/config.nix index e274b4bf8..7bc06f833 100644 --- a/makefu/1systems/gum/config.nix +++ b/makefu/1systems/gum/config.nix @@ -84,6 +84,7 @@ in { + # services -- cgit v1.2.3 From 0132d371e6403f19bd8d188e8af836c9303db3fc Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 5 Feb 2019 22:33:09 +0100 Subject: ma zsh: revert back to TERM=xterm --- makefu/2configs/home-manager/zsh.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/makefu/2configs/home-manager/zsh.nix b/makefu/2configs/home-manager/zsh.nix index 59658e667..6c7b632e1 100644 --- a/makefu/2configs/home-manager/zsh.nix +++ b/makefu/2configs/home-manager/zsh.nix @@ -86,7 +86,8 @@ share = true; }; sessionVariables = { - TERM = "rxvt-unicode-256color"; + # TERM = "rxvt-unicode-256color"; + TERM = "xterm"; LANG = "en_US.UTF8"; LS_COLORS = ":di=1;31:"; EDITOR = "vim"; -- cgit v1.2.3 From 6dc21884dcc140922c8c2e295a2ed026becdab30 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 5 Feb 2019 22:33:26 +0100 Subject: ma homeautomation: permit Insecure homeassistant --- makefu/2configs/homeautomation/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/makefu/2configs/homeautomation/default.nix b/makefu/2configs/homeautomation/default.nix index 596d0002a..2af311c3b 100644 --- a/makefu/2configs/homeautomation/default.nix +++ b/makefu/2configs/homeautomation/default.nix @@ -257,4 +257,8 @@ in { enable = true; #configDir = "/var/lib/hass"; }; + nixpkgs.config.permittedInsecurePackages = [ + "homeassistant-0.77.2" + ]; + } -- cgit v1.2.3 From c9314cac8226da1d422ca5d3c73dab3fbb42513a Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 5 Feb 2019 22:33:54 +0100 Subject: ma tools: move at_spi2_core to gui --- makefu/2configs/tools/core-gui.nix | 1 + makefu/2configs/tools/core.nix | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/makefu/2configs/tools/core-gui.nix b/makefu/2configs/tools/core-gui.nix index 1e85da53c..582d941a6 100644 --- a/makefu/2configs/tools/core-gui.nix +++ b/makefu/2configs/tools/core-gui.nix @@ -2,6 +2,7 @@ { users.users.makefu.packages = with pkgs; [ + at_spi2_core chromium feh clipit diff --git a/makefu/2configs/tools/core.nix b/makefu/2configs/tools/core.nix index 33e896d4c..b4c3a431e 100644 --- a/makefu/2configs/tools/core.nix +++ b/makefu/2configs/tools/core.nix @@ -8,7 +8,6 @@ ( pkgs.writeScriptBin "unknow" ''#!/bin/sh ${gnused}/bin/sed -i "''${1}d" ~/.ssh/known_hosts '') - at_spi2_core acpi bc rsync @@ -17,6 +16,7 @@ ${gnused}/bin/sed -i "''${1}d" ~/.ssh/known_hosts lsof which binutils + screen # fs cifs-utils -- cgit v1.2.3 From f995e7b593b02e2194e9e0b6b2d985a2f035d83c Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 7 Feb 2019 19:04:19 +0100 Subject: tv gitrepos: add flameshot-once --- tv/2configs/gitrepos.nix | 3 +++ 1 file changed, 3 insertions(+) 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"; }; -- cgit v1.2.3 From a8fe746cc7f5471522a50d16d20c40e1a9b20369 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 7 Feb 2019 19:06:14 +0100 Subject: flameshot-once: init at 1.0.0 --- krebs/5pkgs/haskell/flameshot-once.nix | 20 ++++++++++++++++++++ krebs/5pkgs/simple/flameshot-once.nix | 14 ++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 krebs/5pkgs/haskell/flameshot-once.nix create mode 100644 krebs/5pkgs/simple/flameshot-once.nix diff --git a/krebs/5pkgs/haskell/flameshot-once.nix b/krebs/5pkgs/haskell/flameshot-once.nix new file mode 100644 index 000000000..b90dd2cb8 --- /dev/null +++ b/krebs/5pkgs/haskell/flameshot-once.nix @@ -0,0 +1,20 @@ +{ mkDerivation, async, base, blessings, dbus, fetchgit +, iso8601-time, process, stdenv, text, time, unagi-chan, unix +}: +mkDerivation { + pname = "flameshot-once"; + version = "1.0.0"; + src = fetchgit { + url = "https://cgit.krebsco.de/flameshot-once"; + sha256 = "0fjk5pgjy7r0xz4i38qb85x1z4jp8bas2mmgznp7glidz362w390"; + rev = "fb5636483871fbafe9b286b377c339c8ddf8b4f8"; + fetchSubmodules = true; + }; + isLibrary = false; + isExecutable = true; + executableHaskellDepends = [ + async base blessings dbus iso8601-time process text time unagi-chan + unix + ]; + license = stdenv.lib.licenses.mit; +} diff --git a/krebs/5pkgs/simple/flameshot-once.nix b/krebs/5pkgs/simple/flameshot-once.nix new file mode 100644 index 000000000..7550a4678 --- /dev/null +++ b/krebs/5pkgs/simple/flameshot-once.nix @@ -0,0 +1,14 @@ +{ pkgs }: + +pkgs.symlinkJoin { + name = "flameshot-once-wrapper"; + paths = [ + (pkgs.writeDashBin "flameshot-once" '' + export PATH=${pkgs.stdenv.lib.makeBinPath [ + pkgs.flameshot + ]}''${PATH:+:$PATH} + exec ${pkgs.haskellPackages.flameshot-once}/bin/flameshot-once "$@" + '') + pkgs.haskellPackages.flameshot-once + ]; +} -- cgit v1.2.3 From 853d42fd7eff64067e83e121a4e94c6af33c8ac3 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 7 Feb 2019 22:09:51 +0100 Subject: flameshot-once: 1.0.0 -> 1.0.1 --- krebs/5pkgs/haskell/flameshot-once.nix | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/krebs/5pkgs/haskell/flameshot-once.nix b/krebs/5pkgs/haskell/flameshot-once.nix index b90dd2cb8..aa0d94d8f 100644 --- a/krebs/5pkgs/haskell/flameshot-once.nix +++ b/krebs/5pkgs/haskell/flameshot-once.nix @@ -1,20 +1,21 @@ -{ mkDerivation, async, base, blessings, dbus, fetchgit -, iso8601-time, process, stdenv, text, time, unagi-chan, unix +{ mkDerivation, async, base, blessings, bytestring, dbus, fetchgit +, iso8601-time, process, random, stdenv, text, time, unagi-chan +, unix }: mkDerivation { pname = "flameshot-once"; - version = "1.0.0"; + version = "1.0.1"; src = fetchgit { url = "https://cgit.krebsco.de/flameshot-once"; - sha256 = "0fjk5pgjy7r0xz4i38qb85x1z4jp8bas2mmgznp7glidz362w390"; - rev = "fb5636483871fbafe9b286b377c339c8ddf8b4f8"; + sha256 = "01bsgadjk3y3lg19xcadlrqalr4cs028fsivgacqh31fqaq4v243"; + rev = "03623ce6c011c1e85df7d91aed4458c098ff22ff"; fetchSubmodules = true; }; isLibrary = false; isExecutable = true; executableHaskellDepends = [ - async base blessings dbus iso8601-time process text time unagi-chan - unix + async base blessings bytestring dbus iso8601-time process random + text time unagi-chan unix ]; license = stdenv.lib.licenses.mit; } -- cgit v1.2.3 From 7c8ace182566cdbca89f4d3e2203b38e6e1f23d9 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 31 Jan 2019 11:15:58 +0100 Subject: tv rxvt_unicode: fetch patch --- tv/5pkgs/override/default.nix | 2 +- tv/5pkgs/override/rxvt_unicode.nix | 9 +++++ tv/5pkgs/override/rxvt_unicode/default.nix | 6 ---- .../rxvt_unicode/finish-running-selection.patch | 41 ---------------------- 4 files changed, 10 insertions(+), 48 deletions(-) create mode 100644 tv/5pkgs/override/rxvt_unicode.nix delete mode 100644 tv/5pkgs/override/rxvt_unicode/default.nix delete mode 100644 tv/5pkgs/override/rxvt_unicode/finish-running-selection.patch diff --git a/tv/5pkgs/override/default.nix b/tv/5pkgs/override/default.nix index cd7c5645b..99c1b3ec9 100644 --- a/tv/5pkgs/override/default.nix +++ b/tv/5pkgs/override/default.nix @@ -1,6 +1,6 @@ with import ; self: super: { - rxvt_unicode = self.callPackage ./rxvt_unicode { + rxvt_unicode = self.callPackage ./rxvt_unicode.nix { rxvt_unicode = super.rxvt_unicode; }; } diff --git a/tv/5pkgs/override/rxvt_unicode.nix b/tv/5pkgs/override/rxvt_unicode.nix new file mode 100644 index 000000000..da657fb20 --- /dev/null +++ b/tv/5pkgs/override/rxvt_unicode.nix @@ -0,0 +1,9 @@ +{ fetchurl, rxvt_unicode }: +rxvt_unicode.overrideAttrs (old: { + patches = old.patches ++ [ + (fetchurl { + url = https://cgit.krebsco.de/rxvt-unicode/patch/?id=15f3f94; + sha256 = "12vldwsds27c9l15ffc6svk9mj17jhypcz736pvpmpqbsymlkz2p"; + }) + ]; +}) diff --git a/tv/5pkgs/override/rxvt_unicode/default.nix b/tv/5pkgs/override/rxvt_unicode/default.nix deleted file mode 100644 index 858a46be6..000000000 --- a/tv/5pkgs/override/rxvt_unicode/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ rxvt_unicode }: -rxvt_unicode.overrideAttrs (old: { - patches = old.patches ++ [ - ./finish-running-selection.patch - ]; -}) diff --git a/tv/5pkgs/override/rxvt_unicode/finish-running-selection.patch b/tv/5pkgs/override/rxvt_unicode/finish-running-selection.patch deleted file mode 100644 index a342ccf5c..000000000 --- a/tv/5pkgs/override/rxvt_unicode/finish-running-selection.patch +++ /dev/null @@ -1,41 +0,0 @@ -diff --git a/src/rxvttoolkit.h b/src/rxvttoolkit.h -index 56c9a3f..429055d 100644 ---- a/src/rxvttoolkit.h -+++ b/src/rxvttoolkit.h -@@ -384,6 +384,7 @@ struct rxvt_selection - { - rxvt_selection (rxvt_display *disp, int selnum, Time tm, Window win, Atom prop, rxvt_term *term); - void run (); -+ void finish (char *data = 0, unsigned int len = 0); - ~rxvt_selection (); - - rxvt_term *term; // terminal to paste to, may be 0 -@@ -404,7 +405,6 @@ private: - void timer_cb (ev::timer &w, int revents); ev::timer timer_ev; - void x_cb (XEvent &xev); xevent_watcher x_ev; - -- void finish (char *data = 0, unsigned int len = 0); - void stop (); - bool request (Atom target, int selnum); - void handle_selection (Window win, Atom prop, bool delete_prop); -diff --git a/src/screen.C b/src/screen.C -index 9eb375a..77e7109 100644 ---- a/src/screen.C -+++ b/src/screen.C -@@ -2736,11 +2736,11 @@ rxvt_term::paste (char *data, unsigned int len) NOTHROW - void - rxvt_term::selection_request (Time tm, int selnum) NOTHROW - { -- if (!selection_req) -- { -- selection_req = new rxvt_selection (display, selnum, tm, vt, xa[XA_VT_SELECTION], this); -- selection_req->run (); -- } -+ if (selection_req) -+ selection_req->finish (); -+ -+ selection_req = new rxvt_selection (display, selnum, tm, vt, xa[XA_VT_SELECTION], this); -+ selection_req->run (); - } - - /* ------------------------------------------------------------------------- */ -- cgit v1.2.3 From 6830a9b32a19d3347f005a491d7a2c8f4094090c Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 31 Jan 2019 14:39:02 +0100 Subject: krebs-hosts-*: generate from krebs.hosts --- krebs/3modules/hosts.nix | 57 ++++++++++++++++++++++++++++++++++++++- krebs/3modules/retiolum-hosts.nix | 26 +++--------------- 2 files changed, 59 insertions(+), 24 deletions(-) diff --git a/krebs/3modules/hosts.nix b/krebs/3modules/hosts.nix index 0985bb539..eb7fd2283 100644 --- a/krebs/3modules/hosts.nix +++ b/krebs/3modules/hosts.nix @@ -1,6 +1,5 @@ with import ; { config, ... }: let - # TODO dedup functions with ./retiolum-hosts.nix check = hostname: any (domain: hasSuffix ".${domain}" hostname) domains; domains = attrNames (filterAttrs (_: eq "hosts") config.krebs.dns.providers); in { @@ -30,6 +29,62 @@ in { map (addr: { ${addr} = aliases; }) net.addrs) (attrValues host.nets)) (attrValues config.krebs.hosts))); + + nixpkgs.config.packageOverrides = super: let + # nameValuePair name value : { "name" : name, "value" : value } + + # addr : str + # aliase : str + # hostname : str + # netname : str + + # addrAliases : nameValuePair addr [alias] + + # hostNetAliases : host -> { ${netname} : [addrAliases] } + hostNetAliases = host: + mapAttrs (_: net: filter (x: x.name != null) [ + { name = net.ip4.addr or null; value = net.aliases; } + { name = net.ip6.addr or null; value = net.aliases; } + ]) host.nets; + + # netAliases : { ${netname} : [addrAliases] } + netAliases = + foldl' + (result: host: + foldl' + # λ netAliases -> [addrAliases] -> netAliases + (result: { name, value }: result // { + ${name} = result.${name} or [] ++ value; + }) + result + (mapAttrsToList nameValuePair (hostNetAliases host)) + ) + {} + (attrValues config.krebs.hosts); + + # allAddrAliases : [addrAliases] + allAddrAliases = + flatten + (map + (host: attrValues (hostNetAliases host)) + (attrValues config.krebs.hosts)); + + # writeHosts : str -> [addrAliases] -> package + writeHosts = name: addrAliases: super.writeText name '' + ${concatMapStringsSep + "\n" + ({ name, value }: "${name} ${toString value}") + addrAliases} + ''; + in + { + krebs-hosts = writeHosts "krebs-hosts" allAddrAliases; + } + // + genAttrs' (attrNames netAliases) (netname: rec { + name = "krebs-hosts-${netname}"; + value = writeHosts name netAliases.${netname}; + }); }; } diff --git a/krebs/3modules/retiolum-hosts.nix b/krebs/3modules/retiolum-hosts.nix index ddf85ead7..2da174bea 100644 --- a/krebs/3modules/retiolum-hosts.nix +++ b/krebs/3modules/retiolum-hosts.nix @@ -1,28 +1,8 @@ with import ; -{ config, ... }: let - # TODO dedup functions with ./hosts.nix - check = hostname: any (domain: hasSuffix ".${domain}" hostname) domains; - domains = attrNames (filterAttrs (_: eq "hosts") config.krebs.dns.providers); -in { +{ config, pkgs, ... }: { nixpkgs.config.packageOverrides = super: { retiolum-hosts = - super.writeText "retiolum-hosts" '' - ${ - concatStringsSep - "\n" - (flatten - (map - (host: let - net = host.nets.retiolum; - aliases = longs; - longs = filter check net.aliases; - in - optionals - (aliases != []) - (map (addr: "${addr} ${toString aliases}") net.addrs)) - (filter (host: hasAttr "retiolum" host.nets) - (attrValues config.krebs.hosts)))) - } - ''; + trace "pkgs.retiolum-hosts is deprecated, use pkgs.krebs-hosts-retiolum instead" + pkgs.krebs-hosts-retiolum; }; } -- cgit v1.2.3 From bc4984c7fa6a50052436399364d2de7f76f1cd2e Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 31 Ja