diff options
author | lassulus <lass@blue.r> | 2018-09-29 19:02:59 +0200 |
---|---|---|
committer | lassulus <lass@blue.r> | 2018-09-29 19:02:59 +0200 |
commit | b024b2e1ee80d8104f94d75360882bf340af4468 (patch) | |
tree | 30b9c4ca530aadc6c2d047dec609c33da05d43a3 | |
parent | 56f80ba7a8397c7d9c057d3d81327ee932dcf4d4 (diff) | |
parent | 0c70e8fb51ea44b9a113efcb654463b792a5789c (diff) |
Merge remote-tracking branch 'ni/master'
-rw-r--r-- | krebs/3modules/git.nix | 16 | ||||
-rw-r--r-- | tv/2configs/gitrepos.nix | 53 | ||||
-rw-r--r-- | tv/2configs/urlwatch.nix | 25 |
3 files changed, 62 insertions, 32 deletions
diff --git a/krebs/3modules/git.nix b/krebs/3modules/git.nix index 8a923efd2..f6b4e3c69 100644 --- a/krebs/3modules/git.nix +++ b/krebs/3modules/git.nix @@ -121,6 +121,10 @@ let cgit-settings = types.submodule { # A setting's value of `null` means cgit's default should be used. options = { + about-filter = mkOption { + type = types.nullOr types.package; + default = null; + }; cache-root = mkOption { type = types.absolute-pathname; default = "/tmp/cgit"; @@ -166,6 +170,10 @@ let types.nullOr (types.enum ["week" "month" "quarter" "year"]); default = "year"; }; + readme = mkOption { + type = types.listOf types.str; + default = []; + }; robots = mkOption { type = types.nullOr (types.listOf types.str); default = ["nofollow" "noindex"]; @@ -394,8 +402,14 @@ let kv-to-cgitrc = k: v: getAttr (typeOf v) { bool = kv-to-cgitrc k (if v then 1 else 0); null = []; # This will be removed by `flatten`. - list = "${k}=${concatStringsSep ", " v}"; + list = { + readme = map (x: "readme=${x}") v; + }.${k} or "${k}=${concatStringsSep ", " v}"; int = "${k}=${toString v}"; + set = + if subtypes.cgit-settings.check v + then "${k}=${v}" + else error "kv-to-cgitrc: unhandled type: set"; string = "${k}=${v}"; }; in diff --git a/tv/2configs/gitrepos.nix b/tv/2configs/gitrepos.nix index 74fb5215a..a8cbe0f1c 100644 --- a/tv/2configs/gitrepos.nix +++ b/tv/2configs/gitrepos.nix @@ -9,8 +9,19 @@ let { enable = true; cgit = { settings = { - root-title = "repositories at ${config.krebs.build.host.name}"; + about-filter = pkgs.exec "krebs.cgit.about-filter" rec { + filename = "${pkgs.pythonPackages.markdown2}/bin/markdown2"; + argv = [ + filename + "--extras=fenced-code-blocks" + ]; + envp = {}; + }; + readme = [ + ":README.md" + ]; root-desc = "mostly krebs"; + root-title = "repositories at ${config.krebs.build.host.name}"; }; }; repos = repos; @@ -30,46 +41,33 @@ let { public-repos = mapAttrs make-public-repo ({ } // mapAttrs (_: recursiveUpdate { cgit.section = "1. miscellaneous"; }) { - cac-api = { - cgit.desc = "CloudAtCost API command line interface"; - }; dic = { cgit.desc = "dict.leo.org command line interface"; }; disko = { cgit.desc = "declarative partitioning and formatting tool"; }; - get = {}; - hstool = { - cgit.desc = "Haskell Development Environment ^_^"; + fswm = { + cgit.desc = "simple full screen window manager"; }; htgen = { cgit.desc = "toy HTTP server"; }; - kirk = { - cgit.desc = "IRC tools"; - }; krops = { cgit.desc = "deployment tools"; }; - load-env = {}; - loldns = { - cgit.desc = "toy DNS server"; - }; - make-snapshot = {}; much = {}; netcup = { cgit.desc = "netcup command line interface"; }; - nix-writers = {}; + nix-writers = { + cgit.desc = "collection of package builders"; + }; populate = { cgit.desc = "source code installer"; }; q = {}; regfish = {}; - soundcloud = { - cgit.desc = "SoundCloud command line interface"; - }; stockholm = { cgit.desc = "NixOS configuration"; }; @@ -86,15 +84,32 @@ let { xintmap = {}; xmonad-stockholm = {}; } // mapAttrs (_: recursiveUpdate { cgit.section = "4. museum"; }) { + cac-api = { + cgit.desc = "CloudAtCost API command line interface"; + }; cgserver = {}; crude-mail-setup = {}; dot-xmonad = {}; hirc = {}; + hstool = { + cgit.desc = "Haskell Development Environment ^_^"; + }; + kirk = { + cgit.desc = "IRC tools"; + }; make-snapshot = {}; nixos-infest = {}; painload = {}; push = {}; with-tmpdir = {}; + get = {}; + load-env = {}; + loldns = { + cgit.desc = "toy DNS server"; + }; + soundcloud = { + cgit.desc = "SoundCloud command line interface"; + }; }); restricted-repos = mapAttrs make-restricted-repo ( diff --git a/tv/2configs/urlwatch.nix b/tv/2configs/urlwatch.nix index aa71be777..77947dafa 100644 --- a/tv/2configs/urlwatch.nix +++ b/tv/2configs/urlwatch.nix @@ -1,6 +1,10 @@ -{ config, pkgs, ... }: with import <stockholm/lib>; -{ +{ config, pkgs, ... }: let + json = url: { + inherit url; + filter = "system:${pkgs.jq}/bin/jq ."; + }; +in { krebs.urlwatch = { enable = true; mailto = config.krebs.users.tv.mail; @@ -13,18 +17,9 @@ with import <stockholm/lib>; http://www.exim.org/ - # ref src/nixpkgs/pkgs/tools/admin/sec/default.nix - { - url = https://api.github.com/repos/simple-evcorr/sec/tags; - filter = "system:${pkgs.jq}/bin/jq ."; - } - # ref src/nixpkgs/pkgs/tools/networking/urlwatch/default.nix https://thp.io/2008/urlwatch/ - # 2014-12-20 ref src/nixpkgs/pkgs/tools/networking/tlsdate/default.nix - https://api.github.com/repos/ioerror/tlsdate/tags - # 2015-02-18 # ref ~/src/nixpkgs/pkgs/tools/text/qprint/default.nix http://www.fourmilab.ch/webtools/qprint/ @@ -50,7 +45,13 @@ with import <stockholm/lib>; #http://hackage.haskell.org/package/web-page # ref <stockholm/krebs/3modules>, services.openssh.knownHosts.github* - https://api.github.com/meta + (json https://api.github.com/meta) + + # 2014-12-20 ref src/nixpkgs/pkgs/tools/networking/tlsdate/default.nix + (json https://api.github.com/repos/ioerror/tlsdate/tags) + + # ref src/nixpkgs/pkgs/tools/admin/sec/default.nix + (json https://api.github.com/repos/simple-evcorr/sec/tags) # <stockholm/tv/2configs/xserver/xserver.conf.nix> # is derived from `configFile` in: |