From 24fd1fe6c62b7a9fc347794fde043285da272f5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Thu, 13 Dec 2018 21:25:24 +0100 Subject: Initial commit published for NUR --- overlays/bitlbee/bitlbee_long_nicks.patch | 56 ++ overlays/bitlbee/default.nix | 5 + overlays/bundix/default.nix | 7 + overlays/databases/mysql/default.nix | 12 + overlays/databases/postgresql/default.nix | 11 + .../postgresql/postgresql_run_socket_path.patch | 12 + overlays/default.nix | 31 + overlays/dwm/default.nix | 7 + overlays/dwm/dwm_config.h | 98 +++ overlays/elinks/default.nix | 14 + overlays/elinks/elinks.json | 15 + overlays/environments/default.nix | 3 + overlays/environments/immae-eu.nix | 116 +++ overlays/gitweb/default.nix | 7 + overlays/gitweb/theme/git-favicon.png | Bin 0 -> 1125 bytes overlays/gitweb/theme/git-logo.png | Bin 0 -> 2412 bytes overlays/gitweb/theme/gitweb.css | 783 +++++++++++++++++++++ overlays/gitweb/theme/gitweb.js | 27 + overlays/goaccess/default.nix | 13 + overlays/kanboard/default.nix | 18 + overlays/ldapvi/default.nix | 3 + overlays/ldapvi/ldapvi.json | 14 + overlays/lesspipe/default.nix | 5 + overlays/neomutt/default.nix | 8 + overlays/nixops/default.nix | 7 + overlays/pass/default.nix | 8 + overlays/pass/pass-fix-pass-init.patch | 42 ++ overlays/pass/pass.json | 14 + overlays/pelican/default.nix | 6 + overlays/pelican/pelican.json | 15 + overlays/profanity/default.nix | 9 + overlays/python-packages/buildbot.nix | 8 + overlays/python-packages/default.nix | 28 + overlays/sc-im/default.nix | 9 + overlays/shaarli/default.nix | 10 + overlays/shaarli/shaarli_ldap.patch | 420 +++++++++++ overlays/slrn/default.nix | 11 + overlays/taskwarrior/default.nix | 13 + overlays/vit/default.nix | 8 + overlays/vit/vit.json | 15 + overlays/weboob/default.nix | 15 + overlays/weechat/default.nix | 14 + overlays/ympd/default.nix | 5 + overlays/ympd/ympd-password-env.patch | 23 + overlays/ympd/ympd.json | 15 + 45 files changed, 1960 insertions(+) create mode 100644 overlays/bitlbee/bitlbee_long_nicks.patch create mode 100644 overlays/bitlbee/default.nix create mode 100644 overlays/bundix/default.nix create mode 100644 overlays/databases/mysql/default.nix create mode 100644 overlays/databases/postgresql/default.nix create mode 100644 overlays/databases/postgresql/postgresql_run_socket_path.patch create mode 100644 overlays/default.nix create mode 100644 overlays/dwm/default.nix create mode 100644 overlays/dwm/dwm_config.h create mode 100644 overlays/elinks/default.nix create mode 100644 overlays/elinks/elinks.json create mode 100644 overlays/environments/default.nix create mode 100644 overlays/environments/immae-eu.nix create mode 100644 overlays/gitweb/default.nix create mode 100644 overlays/gitweb/theme/git-favicon.png create mode 100644 overlays/gitweb/theme/git-logo.png create mode 100644 overlays/gitweb/theme/gitweb.css create mode 100644 overlays/gitweb/theme/gitweb.js create mode 100644 overlays/goaccess/default.nix create mode 100644 overlays/kanboard/default.nix create mode 100644 overlays/ldapvi/default.nix create mode 100644 overlays/ldapvi/ldapvi.json create mode 100644 overlays/lesspipe/default.nix create mode 100644 overlays/neomutt/default.nix create mode 100644 overlays/nixops/default.nix create mode 100644 overlays/pass/default.nix create mode 100644 overlays/pass/pass-fix-pass-init.patch create mode 100644 overlays/pass/pass.json create mode 100644 overlays/pelican/default.nix create mode 100644 overlays/pelican/pelican.json create mode 100644 overlays/profanity/default.nix create mode 100644 overlays/python-packages/buildbot.nix create mode 100644 overlays/python-packages/default.nix create mode 100644 overlays/sc-im/default.nix create mode 100644 overlays/shaarli/default.nix create mode 100644 overlays/shaarli/shaarli_ldap.patch create mode 100644 overlays/slrn/default.nix create mode 100644 overlays/taskwarrior/default.nix create mode 100644 overlays/vit/default.nix create mode 100644 overlays/vit/vit.json create mode 100644 overlays/weboob/default.nix create mode 100644 overlays/weechat/default.nix create mode 100644 overlays/ympd/default.nix create mode 100644 overlays/ympd/ympd-password-env.patch create mode 100644 overlays/ympd/ympd.json (limited to 'overlays') diff --git a/overlays/bitlbee/bitlbee_long_nicks.patch b/overlays/bitlbee/bitlbee_long_nicks.patch new file mode 100644 index 00000000..70be0925 --- /dev/null +++ b/overlays/bitlbee/bitlbee_long_nicks.patch @@ -0,0 +1,56 @@ +diff --git a/bitlbee.h b/bitlbee.h +index 17ab2979..5858277e 100644 +--- a/bitlbee.h ++++ b/bitlbee.h +@@ -121,7 +121,7 @@ extern "C" { + #define CONTROL_TOPIC "Welcome to the control channel. Type \2help\2 for help information." + #define IRCD_INFO PACKAGE " " + +-#define MAX_NICK_LENGTH 24 ++#define MAX_NICK_LENGTH 99 + + #define HELP_FILE VARDIR "help.txt" + #define CONF_FILE_DEF ETCDIR "bitlbee.conf" +diff --git a/tests/check_nick.c b/tests/check_nick.c +index ca5e5111..909fdcc9 100644 +--- a/tests/check_nick.c ++++ b/tests/check_nick.c +@@ -11,16 +11,16 @@ + START_TEST(test_nick_strip){ + int i; + const char *get[] = { "test:", "test", "test\n", +- "thisisaveryveryveryverylongnick", +- "thisisave:ryveryveryverylongnick", ++ "thisisaveryveryveryveryveryveryverylongnickthisisaveryveryveryveryveryveryverylongnickthisisaveryveryveryveryveryveryverylongnick", ++ "thisis:averyveryveryveryveryveryverylongnickthisisaveryveryveryveryveryveryverylongnickthisisaveryveryveryveryveryveryverylongnick", + "t::::est", + "test123", + "123test", + "123", + NULL }; + const char *expected[] = { "test", "test", "test", +- "thisisaveryveryveryveryl", +- "thisisaveryveryveryveryl", ++ "thisisaveryveryveryveryveryveryverylongnickthisisaveryveryveryveryveryveryverylongnickthisisaveryve", ++ "thisisaveryveryveryveryveryveryverylongnickthisisaveryveryveryveryveryveryverylongnickthisisaveryve", + "test", + "test123", + "_123test", +@@ -28,7 +28,7 @@ START_TEST(test_nick_strip){ + NULL }; + + for (i = 0; get[i]; i++) { +- char copy[60]; ++ char copy[260]; + strcpy(copy, get[i]); + nick_strip(NULL, copy); + fail_unless(strcmp(copy, expected[i]) == 0, +@@ -53,7 +53,7 @@ END_TEST + + START_TEST(test_nick_ok_notok) + { +- const char *nicks[] = { "thisisaveryveryveryveryveryveryverylongnick", ++ const char *nicks[] = { "thisisaveryveryveryveryveryveryverylongnickthisisaveryveryveryveryveryveryverylongnickthisisaveryveryveryveryveryveryverylongnick", + "\nillegalchar", "", "nick%", "123test", NULL }; + int i; + diff --git a/overlays/bitlbee/default.nix b/overlays/bitlbee/default.nix new file mode 100644 index 00000000..5183d012 --- /dev/null +++ b/overlays/bitlbee/default.nix @@ -0,0 +1,5 @@ +self: super: { + bitlbee = super.bitlbee.overrideAttrs(old: { + patches = (old.patches or []) ++ [ ./bitlbee_long_nicks.patch ]; + }); +} diff --git a/overlays/bundix/default.nix b/overlays/bundix/default.nix new file mode 100644 index 00000000..6c4046cf --- /dev/null +++ b/overlays/bundix/default.nix @@ -0,0 +1,7 @@ +self: super: { + bundix = super.bundix.overrideAttrs (old: { + preBuild = (old.preBuild or "") + '' + sed -i -e "/case obj/a\ when nil\n nil" lib/bundix/nixer.rb + ''; + }); +} diff --git a/overlays/databases/mysql/default.nix b/overlays/databases/mysql/default.nix new file mode 100644 index 00000000..5e402841 --- /dev/null +++ b/overlays/databases/mysql/default.nix @@ -0,0 +1,12 @@ +self: super: rec { + mariadb = mariadbPAM; + mariadbPAM = super.mariadb.overrideAttrs(old: { + cmakeFlags = old.cmakeFlags ++ [ "-DWITH_AUTHENTICATION_PAM=ON" ]; + buildInputs = old.buildInputs ++ [ self.pam ]; + }) // (with super.mariadb; { + inherit client; + servier = super.mariadb; + inherit connector-c; + inherit galera; + }); +} diff --git a/overlays/databases/postgresql/default.nix b/overlays/databases/postgresql/default.nix new file mode 100644 index 00000000..8d1405e3 --- /dev/null +++ b/overlays/databases/postgresql/default.nix @@ -0,0 +1,11 @@ +self: super: rec { + postgresql_11_custom = super.postgresql_11.overrideAttrs(old: { + # datadir in /var/lib/postgresql is named after psqlSchema + passthru = old.passthru // { psqlSchema = "11.0"; }; + configureFlags = old.configureFlags ++ [ "--with-pam" ]; + buildInputs = (old.buildInputs or []) ++ [ self.pam ]; + patches = old.patches ++ [ + ./postgresql_run_socket_path.patch + ]; + }); +} diff --git a/overlays/databases/postgresql/postgresql_run_socket_path.patch b/overlays/databases/postgresql/postgresql_run_socket_path.patch new file mode 100644 index 00000000..b558c7b7 --- /dev/null +++ b/overlays/databases/postgresql/postgresql_run_socket_path.patch @@ -0,0 +1,12 @@ +diff -Naur postgresql-9.2.0.sockets/src/include/pg_config_manual.h postgresql-9.2.0/src/include/pg_config_manual.h +--- postgresql-9.2.0.sockets/src/include/pg_config_manual.h 2012-09-06 17:26:17.000000000 -0400 ++++ postgresql-9.2.0/src/include/pg_config_manual.h 2012-09-06 18:13:18.183092471 -0400 +@@ -144,7 +144,7 @@ + * here's where to twiddle it. You can also override this at runtime + * with the postmaster's -k switch. + */ +-#define DEFAULT_PGSOCKET_DIR "/tmp" ++#define DEFAULT_PGSOCKET_DIR "/run/postgresql" + + /* + * The random() function is expected to yield values between 0 and diff --git a/overlays/default.nix b/overlays/default.nix new file mode 100644 index 00000000..408515ed --- /dev/null +++ b/overlays/default.nix @@ -0,0 +1,31 @@ +{ + mylibs = self: super: { mylibs = import ../libs.nix { pkgs = self; }; }; + mypkgs = self: super: import ../pkgs { pkgs = self; }; + + bitlbee = import ./bitlbee; + bundix = import ./bundix; + dwm = import ./dwm; + elinks = import ./elinks; + gitweb = import ./gitweb; + goaccess = import ./goaccess; + kanboard = import ./kanboard; + ldapvi = import ./ldapvi; + lesspipe = import ./lesspipe; + mysql = import ./databases/mysql; + neomutt = import ./neomutt; + nixops = import ./nixops; + pass = import ./pass; + pelican = import ./pelican; + postgresql = import ./databases/postgresql; + profanity = import ./profanity; + sc-im = import ./sc-im; + shaarli = import ./shaarli; + slrn = import ./slrn; + taskwarrior = import ./taskwarrior; + vit = import ./vit; + weboob = import ./weboob; + weechat = import ./weechat; + ympd = import ./ympd; +} +// import ./python-packages +// import ./environments diff --git a/overlays/dwm/default.nix b/overlays/dwm/default.nix new file mode 100644 index 00000000..96ed3ff5 --- /dev/null +++ b/overlays/dwm/default.nix @@ -0,0 +1,7 @@ +self: super: { + dwm = super.dwm.overrideAttrs(old: rec { + postPatch = '' + cp ${./dwm_config.h} ./config.h + ''; + }); +} diff --git a/overlays/dwm/dwm_config.h b/overlays/dwm/dwm_config.h new file mode 100644 index 00000000..b1587e88 --- /dev/null +++ b/overlays/dwm/dwm_config.h @@ -0,0 +1,98 @@ +/* See LICENSE file for copyright and license details. */ + +/* appearance */ +static const unsigned int borderpx = 1; /* border pixel of windows */ +static const unsigned int snap = 32; /* snap pixel */ +static const int showbar = 1; /* 0 means no bar */ +static const int topbar = 1; /* 0 means bottom bar */ +static const char *fonts[] = { "monospace:size=10" }; +static const char dmenufont[] = "monospace:size=10"; +static const char col_gray1[] = "#222222"; +static const char col_gray2[] = "#444444"; +static const char col_gray3[] = "#bbbbbb"; +static const char col_gray4[] = "#eeeeee"; +static const char col_cyan[] = "#005577"; +static const char *colors[][3] = { + /* fg bg border */ + [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, + [SchemeSel] = { col_gray4, col_cyan, col_cyan }, +}; + +/* tagging */ +static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; + +static const Rule rules[] = { + /* xprop(1): + * WM_CLASS(STRING) = instance, class + * WM_NAME(STRING) = title + */ + /* class instance title tags mask isfloating monitor */ + { "Nextcloud", NULL, NULL, 9 << 8, 0, -1 }, +}; + +/* layout(s) */ +static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */ +static const int nmaster = 1; /* number of clients in master area */ +static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */ + +static const Layout layouts[] = { + /* symbol arrange function */ + { "[M]", monocle }, /* first entry is default */ + { "[]=", tile }, + { "><>", NULL }, /* no layout function means floating behavior */ +}; + +/* key definitions */ +#define MODKEY Mod1Mask +#define TAGKEYS(KEY,TAG) \ + { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ + { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ + { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \ + { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, + +/* helper for spawning shell commands in the pre dwm-5.0 fashion */ +#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } + +/* commands */ +static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ +static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL }; +static const char *termcmd[] = { "st", NULL }; + +static Key keys[] = { + /* modifier key function argument */ + { MODKEY, XK_p, spawn, {.v = dmenucmd } }, + { MODKEY, XK_t, spawn, {.v = termcmd } }, + { MODKEY, XK_Tab, view, {0} }, + { MODKEY|ShiftMask, XK_c, killclient, {0} }, + { MODKEY, XK_j, focusstack, {.i = +1 } }, + { MODKEY, XK_k, focusstack, {.i = -1 } }, + { MODKEY, XK_Return, zoom, {0} }, + TAGKEYS( XK_1, 0) + TAGKEYS( XK_2, 1) + TAGKEYS( XK_3, 2) + TAGKEYS( XK_4, 3) + TAGKEYS( XK_5, 4) + TAGKEYS( XK_6, 5) + TAGKEYS( XK_7, 6) + TAGKEYS( XK_8, 7) + TAGKEYS( XK_9, 8) + { MODKEY|ShiftMask, XK_q, quit, {0} }, +}; + +/* button definitions */ +/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ +static Button buttons[] = { + /* click event mask button function argument */ + { ClkLtSymbol, 0, Button1, setlayout, {0} }, + { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, + { ClkWinTitle, 0, Button2, zoom, {0} }, + { ClkStatusText, 0, Button2, spawn, {.v = termcmd } }, + { ClkClientWin, MODKEY, Button1, movemouse, {0} }, + { ClkClientWin, MODKEY, Button2, togglefloating, {0} }, + { ClkClientWin, MODKEY, Button3, resizemouse, {0} }, + { ClkTagBar, 0, Button1, view, {0} }, + { ClkTagBar, 0, Button3, toggleview, {0} }, + { ClkTagBar, MODKEY, Button1, tag, {0} }, + { ClkTagBar, MODKEY, Button3, toggletag, {0} }, +}; + diff --git a/overlays/elinks/default.nix b/overlays/elinks/default.nix new file mode 100644 index 00000000..1744dc0b --- /dev/null +++ b/overlays/elinks/default.nix @@ -0,0 +1,14 @@ +self: super: { + elinks = super.elinks.overrideAttrs (old: + self.mylibs.fetchedGithub ./elinks.json // rec { + preConfigure = ''sh autogen.sh''; + buildInputs = old.buildInputs ++ (with self; [ gettext automake autoconf ]); + configureFlags = [ + "--disable-smb" "--without-x" "--enable-cgi" + "--enable-leds" "--enable-256-colors" + "--enable-html-highlight" "--with-zlib" + ]; + patches = []; + } + ); +} diff --git a/overlays/elinks/elinks.json b/overlays/elinks/elinks.json new file mode 100644 index 00000000..ea13b1fa --- /dev/null +++ b/overlays/elinks/elinks.json @@ -0,0 +1,15 @@ +{ + "tag": "f86be65-master", + "meta": { + "name": "elinks", + "url": "https://github.com/nabetaro/elinks", + "branch": "master" + }, + "github": { + "owner": "nabetaro", + "repo": "elinks", + "rev": "f86be659718c0cd0a67f88b42f07044c23d0d028", + "sha256": "1jxb7xgawcjkb3gw4gqyw26g02709wwdbhyczfckh3l4njxhy14m", + "fetchSubmodules": true + } +} diff --git a/overlays/environments/default.nix b/overlays/environments/default.nix new file mode 100644 index 00000000..630b0bd1 --- /dev/null +++ b/overlays/environments/default.nix @@ -0,0 +1,3 @@ +{ + immae-eu = import ./immae-eu.nix; +} diff --git a/overlays/environments/immae-eu.nix b/overlays/environments/immae-eu.nix new file mode 100644 index 00000000..1f27e7ca --- /dev/null +++ b/overlays/environments/immae-eu.nix @@ -0,0 +1,116 @@ +self: super: with self; +let + # https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh + # https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks + paths = [ + # archives + lzo unzip bzip2 p7zip xz + # unrar is unfree + + # backups + duply + + # calendar/contacts + abook khard khal cadaver vdirsyncer pal + + # computing + boinctui + + # cryptocurrencies + cardano sia monero + xmr-stak + solc + iota-cli-app + + # debugging + rr valgrind netcat-gnu strace + + # documentations + unicodeDoc + + # e-mails + muttprint mutt-ics + notmuch-python2 notmuch-python3 notmuch-vim + neomutt mairix notmuch + bogofilter fetchmail + + # git + vcsh gitRepo gitAndTools.stgit tig + + # graphical tools + nextcloud-client firefox + dwm dmenu st + + # images + feh imagemagick tiv graphicsmagick + + # internet browsing + w3m lynx links elinks browsh weboob urlview googler urlwatch + + # less + python3Packages.pygments lesspipe highlight sourceHighlight + + # monitoring + cnagios mtop pg_activity nagios-cli mtr + iftop htop iotop iperf + goaccess + # nagnu + + # messaging/forums/news + flrn slrn + telegram-cli telegram-history-dump telegramircd + weechat profanity + newsboat irssi + + # nix + mylibs.yarn2nixPackage.yarn2nix + nixops nix-prefetch-scripts nix-generate-from-cpan + nix-zsh-completions bundix nodePackages.bower2nix + nodePackages.node2nix + # (nixos {}).nixos-generate-config + # (nixos {}).nixos-install + # (nixos {}).nixos-enter + # (nixos {}).manual.manpages + + # note taking + note terminal-velocity jrnl + + # office + sc-im ranger + genius bc + ledger + tmux + rtorrent + ldapvi + + # password management + pass apg pwgen + + # pdf + pdftk poppler_utils + + # programming + pelican emacs26-nox ctags + wdiff + + # security + keybase + + # todolist/time management + taskwarrior vit timewarrior + + # video/music + youtube-dl ncmpc ncmpcpp ffmpeg + + # other tools + pgloader s3cmd lftp jq cpulimit libxslt + ]; +in +{ + myEnvironments.immae-eu = buildEnv { + name = "immae-eu-packages"; + inherit paths; + pathsToLink = [ "/bin" "/etc" "/include" "/lib" "/libexec" "/share"]; + extraOutputsToInstall = [ "bin" "man" "doc" "info" ]; + }; +} diff --git a/overlays/gitweb/default.nix b/overlays/gitweb/default.nix new file mode 100644 index 00000000..aa17d22f --- /dev/null +++ b/overlays/gitweb/default.nix @@ -0,0 +1,7 @@ +self: super: { + gitweb = super.gitweb.overrideAttrs(old: { + installPhase = old.installPhase + '' + cp -r ${./theme} $out/gitweb-theme; + ''; + }); +} diff --git a/overlays/gitweb/theme/git-favicon.png b/overlays/gitweb/theme/git-favicon.png new file mode 100644 index 00000000..4fa44bb0 Binary files /dev/null and b/overlays/gitweb/theme/git-favicon.png differ diff --git a/overlays/gitweb/theme/git-logo.png b/overlays/gitweb/theme/git-logo.png new file mode 100644 index 00000000..fdaf7b73 Binary files /dev/null and b/overlays/gitweb/theme/git-logo.png differ diff --git a/overlays/gitweb/theme/gitweb.css b/overlays/gitweb/theme/gitweb.css new file mode 100644 index 00000000..83e07425 --- /dev/null +++ b/overlays/gitweb/theme/gitweb.css @@ -0,0 +1,783 @@ +/* Reset +------------------------------------------------------------------------- */ + +/* Based on http://meyerweb.com/eric/tools/css/reset/ */ +/* v1.0 | 20080212 */ + +html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, +blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, +font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, +u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, +caption, tbody, tfoot, thead, tr, th, td { + margin: 0; + padding: 0; + border: 0; + outline: 0; + font-size: 100%; + vertical-align: baseline; + background: transparent; +} + +ol, ul { list-style: none; } + +blockquote, q { quotes: none; } + +blockquote:before, blockquote:after, +q:before, q:after { + content: ''; + content: none; +} + +:focus { outline: 0; } + +ins { text-decoration: none; } + +del { text-decoration: line-through; } + +table { + border-collapse: collapse; + border-spacing: 0; +} + +a { outline: none; } + +/* General +---------------------------------------------------------------------------- */ + +html { + position: relative; + min-height: 100%; +} + +body { + font: 13px Helvetica,arial,freesans,clean,sans-serif; + line-height: 1.4; + margin: 0 0 105px; + background-color: #fff; + color: #000000; +} + +/* Monospaced Fonts */ +.sha1, .mode, .diff_tree .list, .pre, .diff, .patchset { + font-family: 'Consolas','Bitstream Vera Sans Mono',monospace; +} + +a:link, a:visited { + color: #4183C4; + text-decoration: none; +} + +a:hover { + text-decoration: underline; +} + +td.list a[href*='tree'], td.list a[href*='blob'] { + padding-left: 20px; + display: block; + float: left; + height: 16px; + line-height: 16px; +} + +td.list a[href*='tree'] { + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABq0lEQVQ4y8WTu4oUQRSGv+rtGVuxhwVFdFEEE2c3d0HYTEMTn8DEVxADQTDUF9DMwMxQMBMx8AEWzRQ3cBHd9TI91+2urjq/QbczY2IygSep4nD+79yqnCRWsYQVbWVACvDh5ZXdrLe15dwyT1TjT/sxFFeB6i+VA2B6+cb7kAI4Jf0LO087zjlQI8Y5Qvnj0sHug321XoC1bk+K9eHk6+s7wPMUgKAS88eqb4+Jfg2SHs7lZBvX2Nh+2EUCDGSAcMnJsx9f7NxfAGqXyDzRd5EJO/pMPT1gcviGTnYOVIN5pAAE8v7dLrKL8xnglFk4ws9Afko9HpH3b5Gd2mwb/lOBmgrSdYhJugDUCenxM6xv3p4HCsP8F0LxCsUhCkMURihOyM7fg0osASTFEpu9a4LjGIUCqwcoDiEUrX+E4hRUQb20RiokC1j9vckUhygU7X3QZh7NAVKYL7YBeMkRUfjVCotF2XGIwnghtrJpMywB5G0QZj9P1JNujuWJ1AHLQadRrACPkuZ0SSSWpeStWgDK6tHek5vbiOs48n++XQHurcf0rFng//6NvwG+iB9/4duaTgAAAABJRU5ErkJgggo=) center left no-repeat; +} + +td.list a[href*='blob'] { + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAA6ElEQVQoFQXBMW5TQRgGwNnHnoE0QbiCjoIooUmTU3AuS1BwIoTSUdJBigg3GCWOg9/++zHTop078wIAsPMrE4SL5/1aIyMjIyMjz/m0tbFECFdrPeaQQw75mz/5nZH7fN7aWILmauSYfznmmIfss8vIUx7zZWsTTXM5vpWvTk5Wq9VHQP/gtgOLa0Qpw940vAQdaG6thpOhlOkG0AEuAVGmEkAH+G4YSikxXQM6wDsAMRFAB/ihDNNUmN4DOsAbBAEAdICfpmmaAt4COoj2GgCASbIkZh1NAACznhQt2itnFgAAlF3u/gMDtJXPzQxoswAAAABJRU5ErkJgggo=) center left no-repeat; +} + +i { + font-style: normal; +} + +td, th { + padding: 5px; +} + +.page_nav br { + display: none; +} + +/* Page Header +---------------------------------------------------------------------------- */ + +.page_header { + height: 50px; + line-height: 50px; + position: relative; + padding: 0 27px; + margin-bottom: 20px; + font-size: 20px; + font-family: Helvetica, Arial, Freesans, Clean, sans-serif; + background: #FFFFFF; /* old browsers */ + background: -moz-linear-gradient(top, #FFFFFF 0%, #F5F5F5 100%); /* firefox */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#FFFFFF), color-stop(100%,#F5F5F5)); /* webkit */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#FFFFFF', endColorstr='#F5F5F5',GradientType=0 ); /* ie */ + background: -o-linear-gradient(top, #FFFFFF 0%, #F5F5F5 100%); + border-bottom: 1px solid #dfdfdf; +} + +.page_header a:link, .page_header a:visited { + color: #4183C4; + text-decoration: none; + padding: 3px; + font-weight: bold; +} + +.page_header a:hover { + font-weight: bold; + padding: 3px; + text-decoration: underline; +} + +.page_header a:first-child { + background: transparent; +} + +.page_header img.logo { + position: relative; + top: 7px; + margin-right: 5px; +} + +/* Page Footer +---------------------------------------------------------------------------- */ + +.page_footer { + position: absolute; + left: 0; + bottom: 0; + width: 100%; + height: 80px; + line-height: 80px; + margin-top: 15px; + background: #f1f1f1; + border-top: 2px solid #ddd; + border-bottom: 1px solid #ddd; +} + +.page_footer_text { + color: #666; + display: inline; + float: left; + margin-left: 25px; + width: 80%; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +a.rss_logo { + float: right; + padding: 3px 1px; + width: 35px; + line-height: 10px; + border: 1px solid; + border-color: #fcc7a5 #7d3302 #3e1a01 #ff954e; + color: #ffffff; + background-color: #ff6600; + font-weight: bold; + font-family: sans-serif; + font-size: 80%; + text-align: center; + text-decoration: none; + margin-top: 30px; + margin-left: 5px; +} + +a.rss_logo:hover { + background-color: #ee5500; +} + +.rss_logo { + margin-right: 25px; + background: yellow; +} + +.rss_logo:last-child { + margin-right: 5px; +} + +/* Index include +---------------------------------------------------------------------------- */ + +.index_include { + width: 95%; + margin: 0 auto 15px; + background: -moz-linear-gradient(center top , #FFFFFF 0%, #F5F5F5 100%) repeat scroll 0 0 transparent; + border: 1px solid #DFDFDF; + padding: 8px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +/* Elements +---------------------------------------------------------------------------- */ + +.project_list, +.shortlog, +.tree, +.commit_search, +.history { + width: 95%; + margin: 0 auto 15px auto; + border: 1px solid #d8d8d8; + -moz-box-shadow: 0 0 3px rgba(0,0,0,0.2); + -webkit-box-shadow: 0 0 3px rgba(0,0,0,0.2); + box-shadow: 0 0 3px rgba(0,0,0,0.2); +} + +.project_list th, +.shortlog th, +.tree th, +.commit_search th { + color: #afafaf; + font-weight: normal; +} + +.project_list th { + font-weight: bold; +} + +.project_list tr, +.shortlog tr, +.tree tr, +.commit_search tr { + background: #eaeaea; + height: 2.5em; + text-align: left; + color: #545454; +} + +.project_list tr.dark, .project_list tr.light, +.shortlog tr.dark, .shortlog tr.light, +.tree tr.dark, .tree tr.light, +.commit_search tr.dark, .commit_search tr.light, +.history tr.dark, .history tr.light, +.heads tr.dark, .heads tr.light { + background: #F9F9F9; /* old browsers */ + background: -moz-linear-gradient(top, #F9F9F9 0%, #EFEFEF 100%); /* firefox */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#F9F9F9), color-stop(100%,#EFEFEF)); /* webkit */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#F9F9F9', endColorstr='#EFEFEF',GradientType=0 ); /* ie */ + background: -o-linear-gradient(top, #F9F9F9 0%, #EFEFEF 100%); + height: 2.5em; + border-bottom: 1px solid #e1e1e1; +} + +th .header { + background: transparent; + border: 0; + padding: 0; + font-weight: bold; +} + +.tree { + width: 100%; + margin: 0; +} + +.projsearch { + position: absolute; + right: 4%; + top: 15px; +} + +.projsearch a { + display: none; +} + +.commit_search { + background: #eaeaea; +} + +.page_nav, +.list_head, +.page_path, +.search { + width: 94%; + background: #eaeaea; + color: #545454; + border: 1px solid #d8d8d8; + padding: 5px; + margin: 0 auto 15px auto; +} + +.history { + background: #eaeaea; +} + +.title { + margin: 0 auto 15px auto; + padding: 5px; + width: 95%; +} + +.readme { + background: #eaf2f5; + border: 1px solid #bedce7; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; + margin: 0 auto 15px auto; + padding: 15px; + width: 95%; +} + +.readme h1 { + display: block; + font-size: 2em; + font-weight: bold; + margin-bottom: 0.67em; + margin-top: 0; +} + +.readme h2 { + font-size: 1.5em; + font-weight: bold; + margin-bottom: 0.83em; +} + + +.readme h3 { + font-size: 1.17em; + font-weight: bold; + margin-bottom: 1em; +} + +.readme p { + margin-bottom: 1em; +} + +.readme ul { + list-style: disc; + margin-bottom: 1em; + margin-left: 1.5em; +} + +.readme ul ul { + margin-bottom: 0; +} + +.readme ol { + list-style: decimal; + margin-bottom: 1em; + margin-left: 1.5em; +} + +.readme ol ol { + margin-bottom: 0; +} + +.readme pre { + font-family: monospace; + margin: 1em 0; + white-space: pre; +} + +.readme tt, .readme code, .readme kbd, .readme samp { + font-family: monospace; +} + +.readme blockquote { + margin: 1em; +} + +.projects_list, +.tags { + width: 95%; + background: #f0f0f0; + color: #545454; + border: 1px solid #d8d8d8; + padding: 5px; + margin: 0 auto 15px auto; +} + +.heads { + width: 95%; + color: #545454; + border: 1px solid #d8d8d8; + padding: 5px; + margin: 0 auto 15px auto; +} + +.header { + width: 94%; + margin: 0 auto 15px auto; + background: #eaf2f5; + border: 1px solid #bedce7; + padding: 5px; +} + +.header .age { + float: left; + color: #000; + font-weight: bold; + width: 10em; +} + +.title_text { + width: 94%; + background: #eaf2f5; + border: 1px solid #bedce7; + padding: 5px; + margin: 0 auto 0 auto; +} + +.log_body { + width: 94%; + background: #eaf2f5; + border: 1px solid #bedce7; + border-top: 0; + padding: 5px; + margin: 0 auto 15px auto; +} + +.page_body { + line-height: 1.4em; + width: 94%; + background: #f8f8f8; + border: 1px solid #d8d8d8; + padding: 5px; + margin: 15px auto 15px auto; +} + +.diff_tree { + width: 95%; + background: #f0f0f0; + border: 1px solid #d8d8d8; + padding: 5px; + margin: 0 auto 15px auto; +} + +.page_body > .list_head { + width: 98.5%; +} + +.page_body > .diff_tree { + width: 99.5%; +} + +.patch > .header { + width: 99%; +} + +.author .avatar, +.author_date .avatar { + position: relative; + top: 3px; +} + +.object_header .avatar { + border: 1px solid #D8D8D8; + float: right; +} + +.object_header td, +.object_header th { + vertical-align: top; +} + +/* Refs +---------------------------------------------------------------------------- */ + +span.refs span { + color: #707070; + display: inline-block; + margin: 0; + background-color: #eee; + border: 1px solid #ccc; + border-radius: 3px; + height: 18px; + padding: 0 6px; + text-overflow: ellipsis; +} + +span.refs span.ref { + color: #707070; + display: inline-block; + margin: 0; + background-color: #c4c4ff; + border: 1px solid #7878ff; + border-radius: 3px; + height: 18px; + padding: 0 6px; + text-overflow: ellipsis; + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gIKFSUnpolg7AAAAHJQTFRFAAAAVVWqZmbMVVXVYGDgbW3td3fuc3PzdHT0cHD1d3f6dHT6dnb7dHT7dnb8dnb8dnb9d3f9dnb+eHj+d3f+eHj+d3f+d3f+d3f+eHj+d3f+eHj+d3f+eHj+d3f+d3f+eHj+d3f+d3f+d3f+eHj/////V9oQhQAAACR0Uk5TAAIEBQcNDhMVGCotNTZAT217i5CgobvExtjZ4eLr7vP09ff7uqQ6cgAAAAFiS0dEJcMByQ8AAABUSURBVBjTpc43AoAwDENRh95bgNBM1f3PyOpslD++RSJ61YgH5M2IbIkn4GocSR1MZVBL4t2n4FgkbaxI8Sqph041WknZCWAIrcmEUbpf3lNe0N9u59YFYHnZ78gAAAAASUVORK5CYII=); + background-repeat: no-repeat; + padding-left: 18px; +} + +span.refs span.tag { + color: #707070; + display: inline-block; + margin: 0; + background-color: #ffffab; + border: 1px solid #d9d93b; + border-radius: 3px; + height: 18px; + padding: 0 6px; + text-overflow: ellipsis; + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gIKFSUZZ+h9RwAAAGZQTFRFAAAAtrYkwMBAwMBAx8c4yso11NQ71NQ51dU52Ng71tY519c719c719c62Ng719c719c62Ng72dk62Ng62Ng72Ng72dk62Ng72Ng62dk62dk72dk62Ng62dk72Ng72Ng72dk7////ou/AnQAAACB0Uk5TAAYHCxESLjRCWWlqa4uNkpissbrO19jc3ufs8vf6/f7atAU2AAAAAWJLR0QhxGwNFgAAAF1JREFUGFeNy0cOgCAABVGw94rY5d//lC7omhhn+ZIh5Gf1xPk0Zi5dAABROIQjSU/fsAXhDkCUljAv8jW2wlQpaixpo4Nj+dtatVpjkSJjLNaizRVpvhBCu/4h391jzw1lU12Z7wAAAABJRU5ErkJggg==); + background-repeat: no-repeat; + padding-left: 18px; +} + +span.refs span.head { + color: #707070; + display: inline-block; + margin: 0; + background-color: #c4ffc4; + border: 1px solid #78ff78; + border-radius: 3px; + height: 18px; + padding: 0 6px; + text-overflow: ellipsis; + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gIKFSYDsafX/gAAAUpJREFUOMvVkjFLA0EQhd/s7l06MSCihbV/wC5/QBDEIFYWprRIIQQJFqKFQi4kUbBQsFSwtrUQLQULUTBFLCzVIgimCXe7z0q5yIWcqfRVwzDzMTNvgL8mSUqWw3JOtFQJdsIwLDYyjdYgkEmkazl2oVtQWk36nn8AYBYASmFpxmizGtnoqO7Vb+M9KglEkASdpWU872nvVCiPRpuTnz2JIHGyqX3d0kZfR1G0Ht+g/do+FIhOBbLW3n/FNb/28D0puZ+dyL44ur1UoH5yzt2JyIj6UGdDgwrPhYzSagNEszJaeU/lWlylbmnaeGZZICsAppxzi6nt73HK85oQCMknOuarpno+FIjglVjZDXaCS2yDv3rIHlCb88FY0BlUl3hs7ektkhckb5DFWhoz+n12zr7ZPLpYUqLm0oBMn8NUzLhpAgjpWMS/1CcSJ3ykD7Rk1QAAAABJRU5ErkJggg==); + background-repeat: no-repeat; + padding-left: 18px; +} + +span.refs a { + color: #4e4e4e; + font: 11px "Bitstream Vera Sans Mono", "DejaVu Sans Mono", Monaco, monospace; + line-height: 18px; +} + +/* Diffs +---------------------------------------------------------------------------- */ + +div.diff.to_file a.path, +div.diff.to_file { + color: #007000; +} + +div.diff.from_file a.path, +div.diff.from_file { + color: #aa0000; +} + +.patch .header { + margin: 0; +} + +.patchset { + overflow-x: auto; + overflow-y: hidden; +} + +.chunk_header { + background: #eaf2f5; + color: #999; +} + +.rem { + background: #ffdddd; +} +.rem .marked { + background: #ffaaaa; +} +.add { + background: #ddffdd; +} +.add .marked { + background: #7dff7d; +} + +.extended_header { + width: 99.5%; +} + +div.chunk_block { + overflow: hidden; +} + +div.chunk_block div.old { + float: left; + width: 50%; + overflow: hidden; + border-right: 5px solid #EAF2F5; +} + +div.chunk_block.rem, +div.chunk_block.add { + background: transparent; +} + +div.chunk_block div.old .add, +div.chunk_block div.old .rem { + padding-right: 3px; +} + +div.chunk_block div.new .add, +div.chunk_block div.new .rem { + padding-left: 3px; +} + +div.chunk_block div.new { + margin-left: 50%; + width: 50%; + border-left: 5px solid #EAF2F5; +} + +/* Category +---------------------------------------------------------------------------- */ + +td.category { + background: #E6F1F6; /* old browsers */ + background: -moz-linear-gradient(top, #C8D8E7 0%, #E6F1F3 100%); /* firefox */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#C8D8E7), color-stop(100%,#E6F1F3)); /* webkit */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#C8D8E7', endColorstr='#E6F1F3',GradientType=0 ); /* ie */ + background: -o-linear-gradient(top, #C8D8E7 0%, #E6F1F3 100%); + font-weight: bold; + border-bottom: 1px solid #D1D1D1; + border-top: 1px solid #D1D1D1; +} + +/* Age +---------------------------------------------------------------------------- */ + +/* noage: "No commits" */ +.project_list td.noage { + color: #cdcdcd; +} + +/* age2: 60*60*24*2 <= age */ +.project_list td.age2, .blame td.age2 { + color: #545454; +} + +/* age1: 60*60*2 <= age < 60*60*24*2 */ +.project_list td.age1 { + color: #009900; +} + +/* age0: age < 60*60*2 */ +.project_list td.age0 { + color: #009900; + font-weight: bold; +} + +/* File status +---------------------------------------------------------------------------- */ + +.diff_tree span.file_status.new { + color: #008000; +} + +table.diff_tree span.file_status.deleted { + color: #c00000; +} + +table.diff_tree span.file_status.moved, +table.diff_tree span.file_status.mode_chnge { + color: #545454; +} + +table.diff_tree span.file_status.copied { + color: #70a070; +} + +span.cntrl { + border: dashed #aaaaaa; + border-width: 1px; + padding: 0px 2px 0px 2px; + margin: 0px 2px 0px 2px; +} + +span.match { + background: #aaffaa; + color: #000; +} + +td.error { + color: red; + background: yellow; +} + +/* blob view */ + +td.pre, div.pre, div.diff { + white-space: pre-wrap; +} + +/* JavaScript-based timezone manipulation */ + +.popup { /* timezone selection UI */ + position: absolute; + /* "top: 0; right: 0;" would be better, if not for bugs in browsers */ + top: 0; left: 0; + border: 1px solid #d8d8d8; + padding: 2px; + background-color: #f0f0f0; + font-style: normal; + color: #545454; + cursor: auto; +} + +.close-button { /* close timezone selection UI without selecting */ + /* float doesn't work within absolutely positioned container, + * if width of container is not set explicitly */ + /* float: right; */ + position: absolute; + top: 0px; right: 0px; + border: 1px solid #ffaaaa; + margin: 1px 1px 1px 1px; + padding-bottom: 2px; + width: 12px; + height: 10px; + font-size: 9px; + font-weight: bold; + text-align: center; + background-color: #ffdddd; + cursor: pointer; +} + +/* Style definition generated by highlight 2.4.5, http://www.andre-simon.de/ */ + +/* Highlighting theme definition: */ + +.num { color:#6ecf36; } +.esc { color:#ff00ff; } +.str { color:#ff00d3; background-color: #edc9ec } +.dstr { color:#818100; } +.slc { color:#838183; font-style:italic; } +.com { color:#838183; font-style:italic; } +.dir { color:#008200; } +.sym { color:#000000; } +.line { color:#555555; } +.kwa { color:#666666; font-weight:bold; } +.kwb { color:#6b3099; } +.kwc { color:#d4663d; } +.kwd { color:#2928ff; } + +/**** Styles supplémentaires *****/ + +.readme div.toc { + float: right; + border: 1px solid black; + background-color: white; +} +.readme div.toc span.toctitle { + display: inline-block; + width: 100%; + text-align: center; + font-weight: bold; +} + +.readme table { + background-color: white; +} + +.readme table thead tr { + background-color: #ccc; +} + +.readme table tbody tr:nth-child(2n) { + background-color: #f8f8f8; +} + +.readme table td, .readme table th { + border: 1px solid black; +} diff --git a/overlays/gitweb/theme/gitweb.js b/overlays/gitweb/theme/gitweb.js new file mode 100644 index 00000000..72f3cfa5 --- /dev/null +++ b/overlays/gitweb/theme/gitweb.js @@ -0,0 +1,27 @@ +function include(filename, onload) { + var head = document.getElementsByTagName('head')[0]; + var script = document.createElement('script'); + script.src = filename; + script.type = 'text/javascript'; + script.onload = script.onreadystatechange = function() { + if (script.readyState) { + if (script.readyState === 'complete' || script.readyState === 'loaded') { + script.onreadystatechange = null; + onload(); + } + } + else { + onload(); + } + } + head.appendChild(script); +} + +include('static/gitweb.js', function() {}); +include('//code.jquery.com/jquery-3.1.0.min.js', function() { + $("div.title").each(function(index, element) { + if ($(element).text() === "readme" || $(element).text() === " ") { + $(element).hide(); + } + }); +}); diff --git a/overlays/goaccess/default.nix b/overlays/goaccess/default.nix new file mode 100644 index 00000000..12b28f3b --- /dev/null +++ b/overlays/goaccess/default.nix @@ -0,0 +1,13 @@ +self: super: { + goaccess = super.goaccess.overrideAttrs(old: rec { + name = "goaccess-${version}"; + version = "1.3"; + src = self.fetchurl { + url = "https://tar.goaccess.io/${name}.tar.gz"; + sha256 = "16vv3pj7pbraq173wlxa89jjsd279004j4kgzlrsk1dz4if5qxwc"; + }; + configureFlags = old.configureFlags ++ [ "--enable-tcb=btree" ]; + buildInputs = old.buildInputs ++ [ self.tokyocabinet self.bzip2 ]; + }); + +} diff --git a/overlays/kanboard/default.nix b/overlays/kanboard/default.nix new file mode 100644 index 00000000..81b39fec --- /dev/null +++ b/overlays/kanboard/default.nix @@ -0,0 +1,18 @@ +self: super: { + kanboard = { kanboard_config ? "/etc/kanboard/config.php" }: + super.kanboard.overrideAttrs(old: rec { + name = "kanboard-${version}"; + version = "1.2.9"; + src = self.fetchFromGitHub { + owner = "kanboard"; + repo = "kanboard"; + rev = "c4152316b14936556edf3bcc4d11f16ba31b8ae7"; + sha256 = "18bn9zhyfc5x28hwcxss7chdq7c8rshc8jxgai65i5l68iwhvjg7"; + }; + installPhase = '' + cp -a . $out + ln -s ${kanboard_config} $out/config.php + mv $out/data $out/dataold + ''; + }); +} diff --git a/overlays/ldapvi/default.nix b/overlays/ldapvi/default.nix new file mode 100644 index 00000000..030e6769 --- /dev/null +++ b/overlays/ldapvi/default.nix @@ -0,0 +1,3 @@ +self: super: { + ldapvi = super.ldapvi.overrideAttrs (old: self.mylibs.fetchedGit ./ldapvi.json); +} diff --git a/overlays/ldapvi/ldapvi.json b/overlays/ldapvi/ldapvi.json new file mode 100644 index 00000000..ceaff712 --- /dev/null +++ b/overlays/ldapvi/ldapvi.json @@ -0,0 +1,14 @@ +{ + "tag": "f1d42ba-master", + "meta": { + "name": "ldapvi", + "url": "http://www.lichteblau.com/git/ldapvi.git", + "branch": "master" + }, + "git": { + "url": "http://www.lichteblau.com/git/ldapvi.git", + "rev": "f1d42bad66cc4623d1ff21fbd5dddbf5009d3e40", + "sha256": "0c2h4b1spp9z6a16gy9azf0wyxq397yy7001x1zlvc7c60q11wry", + "fetchSubmodules": true + } +} diff --git a/overlays/lesspipe/default.nix b/overlays/lesspipe/default.nix new file mode 100644 index 00000000..e53feae6 --- /dev/null +++ b/overlays/lesspipe/default.nix @@ -0,0 +1,5 @@ +self: super: { + lesspipe = super.lesspipe.overrideAttrs(old: { + configureFlags = (old.configureFlags or []) ++ [ "--yes" ]; + }); +} diff --git a/overlays/neomutt/default.nix b/overlays/neomutt/default.nix new file mode 100644 index 00000000..c8578c9a --- /dev/null +++ b/overlays/neomutt/default.nix @@ -0,0 +1,8 @@ +self: super: { + neomutt = super.neomutt.overrideAttrs (old: + { + buildInputs = old.buildInputs ++ [ self.gdbm ]; + configureFlags = old.configureFlags ++ [ "--gdbm" ]; + } + ); +} diff --git a/overlays/nixops/default.nix b/overlays/nixops/default.nix new file mode 100644 index 00000000..eb29ecd0 --- /dev/null +++ b/overlays/nixops/default.nix @@ -0,0 +1,7 @@ +self: super: { + nixops = super.nixops.overrideAttrs (old: { + preConfigure = (old.preConfigure or "") + '' + sed -i -e "/'keyFile'/s/'path'/'string'/" nixops/backends/__init__.py + ''; + }); +} diff --git a/overlays/pass/default.nix b/overlays/pass/default.nix new file mode 100644 index 00000000..df42cf19 --- /dev/null +++ b/overlays/pass/default.nix @@ -0,0 +1,8 @@ +self: super: { + pass = (super.pass.withExtensions (exts: [ exts.pass-otp ])).overrideAttrs (old: + self.mylibs.fetchedGit ./pass.json // { + patches = old.patches ++ [ ./pass-fix-pass-init.patch ]; + } + ); + +} diff --git a/overlays/pass/pass-fix-pass-init.patch b/overlays/pass/pass-fix-pass-init.patch new file mode 100644 index 00000000..10a76c16 --- /dev/null +++ b/overlays/pass/pass-fix-pass-init.patch @@ -0,0 +1,42 @@ +From 33e8f1cd0065639a948d7b5ba3f93d43bdf7f3be Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= +Date: Sun, 11 Nov 2018 19:47:33 +0100 +Subject: [PATCH] Fix pass init for some gpg keys + +This fixes the pass init for gpg keys which have their main key as +encryption key. This may happen for instance with RSA keys and specific +configuration. +--- + src/password-store.sh | 2 +- + tests/t0300-reencryption.sh | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/password-store.sh b/src/password-store.sh +index d89d455..44d122e 100755 +--- a/src/password-store.sh ++++ b/src/password-store.sh +@@ -124,7 +124,7 @@ reencrypt_path() { + IFS=";" eval 'GPG_RECIPIENTS+=( $group )' # http://unix.stackexchange.com/a/92190 + unset "GPG_RECIPIENTS[$index]" + done +- gpg_keys="$($GPG $PASSWORD_STORE_GPG_OPTS --list-keys --with-colons "${GPG_RECIPIENTS[@]}" | sed -n 's/^sub:[^:]*:[^:]*:[^:]*:\([^:]*\):[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[a-zA-Z]*e[a-zA-Z]*:.*/\1/p' | LC_ALL=C sort -u)" ++ gpg_keys="$($GPG $PASSWORD_STORE_GPG_OPTS --list-keys --with-colons "${GPG_RECIPIENTS[@]}" | sed -n 's/^[ps]ub:[^:]*:[^:]*:[^:]*:\([^:]*\):[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[a-zA-Z]*e[a-zA-Z]*:.*/\1/p' | LC_ALL=C sort -u)" + fi + current_keys="$(LC_ALL=C $GPG $PASSWORD_STORE_GPG_OPTS -v --no-secmem-warning --no-permission-warning --decrypt --list-only --keyid-format long "$passfile" 2>&1 | sed -n 's/^gpg: public key is \([A-F0-9]\+\)$/\1/p' | LC_ALL=C sort -u)" + +diff --git a/tests/t0300-reencryption.sh b/tests/t0300-reencryption.sh +index 3c88987..57d873f 100755 +--- a/tests/t0300-reencryption.sh ++++ b/tests/t0300-reencryption.sh +@@ -7,7 +7,7 @@ cd "$(dirname "$0")" + INITIAL_PASSWORD="will this password live? a big question indeed..." + + canonicalize_gpg_keys() { +- $GPG --list-keys --with-colons "$@" | sed -n 's/sub:[^:]*:[^:]*:[^:]*:\([^:]*\):[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[a-zA-Z]*e[a-zA-Z]*:.*/\1/p' | LC_ALL=C sort -u ++ $GPG --list-keys --with-colons "$@" | sed -n 's/[ps]ub:[^:]*:[^:]*:[^:]*:\([^:]*\):[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[a-zA-Z]*e[a-zA-Z]*:.*/\1/p' | LC_ALL=C sort -u + } + gpg_keys_from_encrypted_file() { + $GPG -v --no-secmem-warning --no-permission-warning --decrypt --list-only --keyid-format long "$1" 2>&1 | grep "public key is" | cut -d ' ' -f 5 | LC_ALL=C sort -u +-- +2.19.1 + diff --git a/overlays/pass/pass.json b/overlays/pass/pass.json new file mode 100644 index 00000000..a4638c13 --- /dev/null +++ b/overlays/pass/pass.json @@ -0,0 +1,14 @@ +{ + "tag": "d29a389-master", + "meta": { + "name": "password-store", + "url": "https://git.zx2c4.com/password-store/", + "branch": "master" + }, + "git": { + "url": "https://git.zx2c4.com/password-store/", + "rev": "d29a389a40524c684595f51bb937f66958bc14ea", + "sha256": "17g43i0if9nggcq6005iyxxy9my8s15ihc2nzwjgqzhy3svh5xvn", + "fetchSubmodules": true + } +} diff --git a/overlays/pelican/default.nix b/overlays/pelican/default.nix new file mode 100644 index 00000000..5f60b8f7 --- /dev/null +++ b/overlays/pelican/default.nix @@ -0,0 +1,6 @@ +self: super: { + pelican = with self.python3Packages; + pelican.overrideAttrs(old: self.mylibs.fetchedGithub ./pelican.json // { + propagatedBuildInputs = old.propagatedBuildInputs ++ [ pyyaml ]; + }); +} diff --git a/overlays/pelican/pelican.json b/overlays/pelican/pelican.json new file mode 100644 index 00000000..d8f4425e --- /dev/null +++ b/overlays/pelican/pelican.json @@ -0,0 +1,15 @@ +{ + "tag": "4.0.1", + "meta": { + "name": "pelican", + "url": "https://github.com/getpelican/pelican", + "branch": "refs/tags/4.0.1" + }, + "github": { + "owner": "getpelican", + "repo": "pelican", + "rev": "24d6efa9fda4ad45649ddf88c1c596193d589bf8", + "sha256": "09fcwnnfln0cl5v0qpxzrllj27znrg6dbhaksxrl0192c3mbyjvl", + "fetchSubmodules": true + } +} diff --git a/overlays/profanity/default.nix b/overlays/profanity/default.nix new file mode 100644 index 00000000..33861f1b --- /dev/null +++ b/overlays/profanity/default.nix @@ -0,0 +1,9 @@ +self: super: { + profanity = (super.profanity.override { + notifySupport = true; + inherit (self) libnotify gpgme gdk_pixbuf; + python = self.python3; + }).overrideAttrs (old: rec { + configureFlags = old.configureFlags ++ [ "--enable-plugins" ]; + }); +} diff --git a/overlays/python-packages/buildbot.nix b/overlays/python-packages/buildbot.nix new file mode 100644 index 00000000..ccf2f6a7 --- /dev/null +++ b/overlays/python-packages/buildbot.nix @@ -0,0 +1,8 @@ +self: super: { + pythonOverrides = self.buildPythonOverrides (pyself: pysuper: { + buildbot-plugins = pysuper.buildbot-plugins // { + buildslist = self.python3PackagesPlus.buildbot-plugins.buildslist; + }; + buildbot-full = pysuper.buildbot-full.withPlugins [ pyself.buildbot-plugins.buildslist ]; + }) super.pythonOverrides; +} diff --git a/overlays/python-packages/default.nix b/overlays/python-packages/default.nix new file mode 100644 index 00000000..8a9949e6 --- /dev/null +++ b/overlays/python-packages/default.nix @@ -0,0 +1,28 @@ +let + fromMyPythonPackages = name: self: super: { + pythonOverrides = self.buildPythonOverrides (pyself: pysuper: { + "${name}" = self."${pyself.python.pname}PackagesPlus"."${name}"; + }) super.pythonOverrides; + }; +in +{ + # https://github.com/NixOS/nixpkgs/issues/44426 + # needs to come before all other in alphabetical order (or make use of + # lib.mkBefore) + __pythonOverlayFix = self: super: let + pyNames = [ "python3" "python36" "python37" ]; + overriddenPython = name: [ + { inherit name; value = super.${name}.override { packageOverrides = self.pythonOverrides; }; } + { name = "${name}Packages"; value = self.recurseIntoAttrs self.${name}.pkgs; } + ]; + overriddenPythons = builtins.concatLists (map overriddenPython pyNames); + in { + pythonOverrides = pyself: pysuper: {}; + buildPythonOverrides = newOverrides: currentOverrides: super.lib.composeExtensions newOverrides currentOverrides; + } // super.lib.attrsets.listToAttrs overriddenPythons; + + + apprise = fromMyPythonPackages "apprise"; + buildbot = import ./buildbot.nix; + wokkel = fromMyPythonPackages "wokkel"; +} diff --git a/overlays/sc-im/default.nix b/overlays/sc-im/default.nix new file mode 100644 index 00000000..f7286552 --- /dev/null +++ b/overlays/sc-im/default.nix @@ -0,0 +1,9 @@ +self: super: { + sc-im = super.sc-im.overrideAttrs (old: { + buildPhase = '' + cd src + sed -i Makefile -e 's@\...name.info@.local/state/$(name)info@' + cd .. + '' + old.buildPhase; + }); +} diff --git a/overlays/shaarli/default.nix b/overlays/shaarli/default.nix new file mode 100644 index 00000000..c2fb9cce --- /dev/null +++ b/overlays/shaarli/default.nix @@ -0,0 +1,10 @@ +self: super: { + shaarli = varDir: super.shaarli.overrideAttrs (old: { + patchPhase = ""; + patches = (old.patches or []) ++ [ ./shaarli_ldap.patch ]; + installPhase = (old.installPhase or "") + '' + cp .htaccess $out/ + ln -sf ${varDir}/{cache,pagecache,tmp,data} $out/ + ''; + }); +} diff --git a/overlays/shaarli/shaarli_ldap.patch b/overlays/shaarli/shaarli_ldap.patch new file mode 100644 index 00000000..9c7315a1 --- /dev/null +++ b/overlays/shaarli/shaarli_ldap.patch @@ -0,0 +1,420 @@ +commit bc82ebfd779b8641dadd6787f51639ea9105c3e8 +Author: Ismaël Bouya +Date: Sun Feb 3 20:58:18 2019 +0100 + + Add ldap connection + +diff --git a/.htaccess b/.htaccess +index 4c00427..5acd708 100644 +--- a/.htaccess ++++ b/.htaccess +@@ -6,10 +6,23 @@ RewriteEngine On + # Prevent accessing subdirectories not managed by SCM + RewriteRule ^(.git|doxygen|vendor) - [F] + ++RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$ ++RewriteRule ^(.*) - [E=BASE:%1] ++ ++RewriteCond %{ENV:REDIRECT_BASE} (.+) ++RewriteRule .* - [E=BASE:%1] ++ + # Forward the "Authorization" HTTP header + RewriteCond %{HTTP:Authorization} ^(.*) + RewriteRule .* - [e=HTTP_AUTHORIZATION:%1] + ++RewriteCond %{REQUEST_FILENAME} !-f ++RewriteCond %{REQUEST_FILENAME} !-d ++RewriteRule ^((?!api/)[^/]*)/?(.*)$ $2?%{QUERY_STRING} [E=USERSPACE:$1] ++ ++RewriteCond %{ENV:REDIRECT_USERSPACE} (.+) ++RewriteRule .* - [E=USERSPACE:%1] ++ + # REST API + RewriteCond %{REQUEST_FILENAME} !-f + RewriteCond %{REQUEST_FILENAME} !-d +diff --git a/application/ApplicationUtils.php b/application/ApplicationUtils.php +index 911873a..f21a1ef 100644 +--- a/application/ApplicationUtils.php ++++ b/application/ApplicationUtils.php +@@ -191,6 +191,9 @@ public static function checkResourcePermissions($conf) + $conf->get('resource.page_cache'), + $conf->get('resource.raintpl_tmp'), + ) as $path) { ++ if (! is_dir($path)) { ++ mkdir($path, 0755, true); ++ } + if (! is_readable(realpath($path))) { + $errors[] = '"'.$path.'" '. t('directory is not readable'); + } +diff --git a/application/config/ConfigManager.php b/application/config/ConfigManager.php +index 32aaea4..99efc15 100644 +--- a/application/config/ConfigManager.php ++++ b/application/config/ConfigManager.php +@@ -21,6 +21,11 @@ class ConfigManager + + public static $DEFAULT_PLUGINS = array('qrcode'); + ++ /** ++ * @var string User space. ++ */ ++ protected $userSpace; ++ + /** + * @var string Config folder. + */ +@@ -41,12 +46,36 @@ class ConfigManager + * + * @param string $configFile Configuration file path without extension. + */ +- public function __construct($configFile = 'data/config') ++ public function __construct($configFile = null, $userSpace = null) + { +- $this->configFile = $configFile; ++ $this->userSpace = $this->findLDAPUser($userSpace); ++ if ($configFile !== null) { ++ $this->configFile = $configFile; ++ } else { ++ $this->configFile = ($this->userSpace === null) ? 'data/config' : 'data/' . $this->userSpace . '/config'; ++ } + $this->initialize(); + } + ++ public function findLDAPUser($login, $password = null) { ++ $connect = ldap_connect(getenv('SHAARLI_LDAP_HOST')); ++ ldap_set_option($connect, LDAP_OPT_PROTOCOL_VERSION, 3); ++ if (!$connect || !ldap_bind($connect, getenv('SHAARLI_LDAP_DN'), getenv('SHAARLI_LDAP_PASSWORD'))) { ++ return false; ++ } ++ ++ $search_query = str_replace('%login%', ldap_escape($login), getenv('SHAARLI_LDAP_FILTER')); ++ ++ $search = ldap_search($connect, getenv('SHAARLI_LDAP_BASE'), $search_query); ++ $info = ldap_get_entries($connect, $search); ++ ++ if (ldap_count_entries($connect, $search) == 1 && (is_null($password) || ldap_bind($connect, $info[0]["dn"], $password))) { ++ return $login; ++ } else { ++ return null; ++ } ++ } ++ + /** + * Reset the ConfigManager instance. + */ +@@ -269,6 +298,16 @@ public function getConfigFileExt() + return $this->configFile . $this->configIO->getExtension(); + } + ++ /** ++ * Get the current userspace. ++ * ++ * @return mixed User space. ++ */ ++ public function getUserSpace() ++ { ++ return $this->userSpace; ++ } ++ + /** + * Recursive function which find asked setting in the loaded config. + * +@@ -342,19 +381,31 @@ protected static function removeConfig($settings, &$conf) + */ + protected function setDefaultValues() + { +- $this->setEmpty('resource.data_dir', 'data'); +- $this->setEmpty('resource.config', 'data/config.php'); +- $this->setEmpty('resource.datastore', 'data/datastore.php'); +- $this->setEmpty('resource.ban_file', 'data/ipbans.php'); +- $this->setEmpty('resource.updates', 'data/updates.txt'); +- $this->setEmpty('resource.log', 'data/log.txt'); +- $this->setEmpty('resource.update_check', 'data/lastupdatecheck.txt'); +- $this->setEmpty('resource.history', 'data/history.php'); ++ if ($this->userSpace === null) { ++ $data = 'data'; ++ $tmp = 'tmp'; ++ $cache = 'cache'; ++ $pagecache = 'pagecache'; ++ } else { ++ $data = 'data/' . ($this->userSpace); ++ $tmp = 'tmp/' . ($this->userSpace); ++ $cache = 'cache/' . ($this->userSpace); ++ $pagecache = 'pagecache/' . ($this->userSpace); ++ } ++ ++ $this->setEmpty('resource.data_dir', $data); ++ $this->setEmpty('resource.config', $data . '/config.php'); ++ $this->setEmpty('resource.datastore', $data . '/datastore.php'); ++ $this->setEmpty('resource.ban_file', $data . '/ipbans.php'); ++ $this->setEmpty('resource.updates', $data . '/updates.txt'); ++ $this->setEmpty('resource.log', $data . '/log.txt'); ++ $this->setEmpty('resource.update_check', $data . '/lastupdatecheck.txt'); ++ $this->setEmpty('resource.history', $data . '/history.php'); + $this->setEmpty('resource.raintpl_tpl', 'tpl/'); + $this->setEmpty('resource.theme', 'default'); +- $this->setEmpty('resource.raintpl_tmp', 'tmp/'); +- $this->setEmpty('resource.thumbnails_cache', 'cache'); +- $this->setEmpty('resource.page_cache', 'pagecache'); ++ $this->setEmpty('resource.raintpl_tmp', $tmp); ++ $this->setEmpty('resource.thumbnails_cache', $cache); ++ $this->setEmpty('resource.page_cache', $pagecache); + + $this->setEmpty('security.ban_after', 4); + $this->setEmpty('security.ban_duration', 1800); +diff --git a/application/security/LoginManager.php b/application/security/LoginManager.php +index d6784d6..bdfaca7 100644 +--- a/application/security/LoginManager.php ++++ b/application/security/LoginManager.php +@@ -32,6 +32,9 @@ class LoginManager + /** @var string User sign-in token depending on remote IP and credentials */ + protected $staySignedInToken = ''; + ++ protected $lastErrorReason = ''; ++ protected $lastErrorIsBanishable = false; ++ + /** + * Constructor + * +@@ -83,7 +86,7 @@ public function getStaySignedInToken() + */ + public function checkLoginState($cookie, $clientIpId) + { +- if (! $this->configManager->exists('credentials.login')) { ++ if (! $this->configManager->exists('credentials.login') || (isset($_SESSION['username']) && $_SESSION['username'] && $this->configManager->get('credentials.login') !== $_SESSION['username'])) { + // Shaarli is not configured yet + $this->isLoggedIn = false; + return; +@@ -133,20 +136,40 @@ public function isLoggedIn() + */ + public function checkCredentials($remoteIp, $clientIpId, $login, $password) + { +- $hash = sha1($password . $login . $this->configManager->get('credentials.salt')); ++ $this->lastErrorIsBanishable = false; ++ ++ if ($this->configManager->getUserSpace() !== null && $this->configManager->getUserSpace() !== $login) { ++ logm($this->configManager->get('resource.log'), ++ $remoteIp, ++ 'Trying to login to wrong user space'); ++ $this->lastErrorReason = 'You’re trying to access the wrong account.'; ++ return false; ++ } + +- if ($login != $this->configManager->get('credentials.login') +- || $hash != $this->configManager->get('credentials.hash') +- ) { ++ logm($this->configManager->get('resource.log'), ++ $remoteIp, ++ 'Trying LDAP connection'); ++ $result = $this->configManager->findLDAPUser($login, $password); ++ if ($result === false) { + logm( + $this->configManager->get('resource.log'), + $remoteIp, +- 'Login failed for user ' . $login ++ 'Impossible to connect to LDAP' + ); ++ $this->lastErrorReason = 'Server error.'; ++ return false; ++ } else if (is_null($result)) { ++ logm( ++ $this->configManager->get('resource.log'), ++ $remoteIp, ++ 'Login failed for user ' . $login ++ ); ++ $this->lastErrorIsBanishable = true; ++ $this->lastErrorReason = 'Wrong login/password.'; + return false; + } + +- $this->sessionManager->storeLoginInfo($clientIpId); ++ $this->sessionManager->storeLoginInfo($clientIpId, $login); + logm( + $this->configManager->get('resource.log'), + $remoteIp, +@@ -187,6 +210,10 @@ protected function writeBanFile() + */ + public function handleFailedLogin($server) + { ++ if (!$this->lastErrorIsBanishable) { ++ return $this->lastErrorReason ?: 'Error during login.'; ++ }; ++ + $ip = $server['REMOTE_ADDR']; + $trusted = $this->configManager->get('security.trusted_proxies', []); + +@@ -215,6 +242,7 @@ public function handleFailedLogin($server) + ); + } + $this->writeBanFile(); ++ return $this->lastErrorReason ?: 'Error during login.'; + } + + /** +diff --git a/application/security/SessionManager.php b/application/security/SessionManager.php +index b8b8ab8..5eb4aac 100644 +--- a/application/security/SessionManager.php ++++ b/application/security/SessionManager.php +@@ -111,10 +111,10 @@ public static function checkId($sessionId) + * + * @param string $clientIpId Client IP address identifier + */ +- public function storeLoginInfo($clientIpId) ++ public function storeLoginInfo($clientIpId, $login = null) + { + $this->session['ip'] = $clientIpId; +- $this->session['username'] = $this->conf->get('credentials.login'); ++ $this->session['username'] = $login ?: $this->conf->get('credentials.login'); + $this->extendTimeValidityBy(self::$SHORT_TIMEOUT); + } + +diff --git a/index.php b/index.php +index 4b86a3e..85376e8 100644 +--- a/index.php ++++ b/index.php +@@ -121,7 +121,27 @@ + $_COOKIE['shaarli'] = session_id(); + } + +-$conf = new ConfigManager(); ++$folderBase = getenv("BASE"); ++ ++if (getenv("USERSPACE")) { ++ if (isset($_GET["do"]) && $_GET["do"] == "login") { ++ header("Location: $folderBase/?do=login"); ++ exit; ++ } ++ $userspace = preg_replace("/[^-_A-Za-z0-9]/", '', getenv("USERSPACE")); ++} else if (isset($_SESSION["username"]) && $_SESSION["username"]) { ++ header("Location: " . $folderBase . "/" . $_SESSION["username"] . "?"); ++ exit; ++} else if (!isset($_GET["do"]) || $_GET["do"] != "login") { ++ header("Location: $folderBase/?do=login"); ++ exit; ++} ++ ++if (isset($userspace)) { ++ $conf = new ConfigManager(null, $userspace); ++} else { ++ $conf = new ConfigManager(); ++} + $sessionManager = new SessionManager($_SESSION, $conf); + $loginManager = new LoginManager($GLOBALS, $conf, $sessionManager); + $loginManager->generateStaySignedInToken($_SERVER['REMOTE_ADDR']); +@@ -175,7 +195,7 @@ + } + + // Display the installation form if no existing config is found +- install($conf, $sessionManager, $loginManager); ++ install($conf, $sessionManager, $loginManager, $userspace); + } + + $loginManager->checkLoginState($_COOKIE, $clientIpId); +@@ -205,6 +225,7 @@ function isLoggedIn() + && $loginManager->checkCredentials($_SERVER['REMOTE_ADDR'], $clientIpId, $_POST['login'], $_POST['password']) + ) { + $loginManager->handleSuccessfulLogin($_SERVER); ++ $userspace = $_POST['login']; + + $cookiedir = ''; + if (dirname($_SERVER['SCRIPT_NAME']) != '/') { +@@ -241,25 +262,25 @@ function isLoggedIn() + $uri .= '&'.$param.'='.urlencode($_GET[$param]); + } + } +- header('Location: '. $uri); ++ header('Location: '. $userspace . $uri); + exit; + } + + if (isset($_GET['edit_link'])) { +- header('Location: ?edit_link='. escape($_GET['edit_link'])); ++ header('Location: ' . $userspace . '?edit_link='. escape($_GET['edit_link'])); + exit; + } + + if (isset($_POST['returnurl'])) { + // Prevent loops over login screen. + if (strpos($_POST['returnurl'], 'do=login') === false) { +- header('Location: '. generateLocation($_POST['returnurl'], $_SERVER['HTTP_HOST'])); ++ header('Location: ' . generateLocation($_POST['returnurl'], $_SERVER['HTTP_HOST'])); + exit; + } + } +- header('Location: ?'); exit; ++ header('Location: '. $userspace . '?'); exit; + } else { +- $loginManager->handleFailedLogin($_SERVER); ++ $errorReason = $loginManager->handleFailedLogin($_SERVER); + $redir = '&username='. urlencode($_POST['login']); + if (isset($_GET['post'])) { + $redir .= '&post=' . urlencode($_GET['post']); +@@ -270,7 +291,7 @@ function isLoggedIn() + } + } + // Redirect to login screen. +- echo ''; ++ echo ''; + exit; + } + } +@@ -1719,7 +1740,7 @@ function buildLinkList($PAGE, $LINKSDB, $conf, $pluginManager, $loginManager) + * @param SessionManager $sessionManager SessionManager instance + * @param LoginManager $loginManager LoginManager instance + */ +-function install($conf, $sessionManager, $loginManager) { ++function install($conf, $sessionManager, $loginManager, $userspace) { + // On free.fr host, make sure the /sessions directory exists, otherwise login will not work. + if (endsWith($_SERVER['HTTP_HOST'],'.free.fr') && !is_dir($_SERVER['DOCUMENT_ROOT'].'/sessions')) mkdir($_SERVER['DOCUMENT_ROOT'].'/sessions',0705); + +@@ -1755,7 +1776,7 @@ function install($conf, $sessionManager, $loginManager) { + } + + +- if (!empty($_POST['setlogin']) && !empty($_POST['setpassword'])) ++ if (true) + { + $tz = 'UTC'; + if (!empty($_POST['continent']) && !empty($_POST['city']) +@@ -1764,15 +1785,15 @@ function install($conf, $sessionManager, $loginManager) { + $tz = $_POST['continent'].'/'.$_POST['city']; + } + $conf->set('general.timezone', $tz); +- $login = $_POST['setlogin']; +- $conf->set('credentials.login', $login); ++ $conf->set('credentials.login', $userspace); + $salt = sha1(uniqid('', true) .'_'. mt_rand()); + $conf->set('credentials.salt', $salt); +- $conf->set('credentials.hash', sha1($_POST['setpassword'] . $login . $salt)); ++ $hash = sha1(uniqid('', true) .'_'. mt_rand()); ++ $conf->set('credentials.hash', $hash); + if (!empty($_POST['title'])) { + $conf->set('general.title', escape($_POST['title'])); + } else { +- $conf->set('general.title', 'Shared links on '.escape(index_url($_SERVER))); ++ $conf->set('general.title', ucwords(str_replace("_", " ", $userspace))); + } + $conf->set('translation.language', escape($_POST['language'])); + $conf->set('updates.check_updates', !empty($_POST['updateCheck'])); +@@ -1841,7 +1862,12 @@ function install($conf, $sessionManager, $loginManager) { + $app = new \Slim\App($container); + + // REST API routes +-$app->group('/api/v1', function() { ++if (isset($userspace)) { ++ $mountpoint = '/' . $userspace . '/api/v1'; ++} else { ++ $mountpoint = '/api/v1'; ++} ++$app->group($mountpoint, function() { + $this->get('/info', '\Shaarli\Api\Controllers\Info:getInfo')->setName('getInfo'); + $this->get('/links', '\Shaarli\Api\Controllers\Links:getLinks')->setName('getLinks'); + $this->get('/links/{id:[\d]+}', '\Shaarli\Api\Controllers\Links:getLink')->setName('getLink'); +@@ -1860,7 +1886,7 @@ function install($conf, $sessionManager, $loginManager) { + $response = $app->run(true); + // Hack to make Slim and Shaarli router work together: + // If a Slim route isn't found and NOT API call, we call renderPage(). +-if ($response->getStatusCode() == 404 && strpos($_SERVER['REQUEST_URI'], '/api/v1') === false) { ++if ($response->getStatusCode() == 404 && strpos($_SERVER['REQUEST_URI'], $mountpoint) === false) { + // We use UTF-8 for proper international characters handling. + header('Content-Type: text/html; charset=utf-8'); + renderPage($conf, $pluginManager, $linkDb, $history, $sessionManager, $loginManager); diff --git a/overlays/slrn/default.nix b/overlays/slrn/default.nix new file mode 100644 index 00000000..6caef550 --- /dev/null +++ b/overlays/slrn/default.nix @@ -0,0 +1,11 @@ +self: super: { + slrn = super.slrn.overrideAttrs (old: rec { + version = "1.0.3a"; + name = "slrn-${version}"; + src = self.fetchurl { + url = "http://www.jedsoft.org/releases/slrn/slrn-${version}.tar.bz2"; + sha256 = "1b1d9iikr60w0vq86y9a0l4gjl0jxhdznlrdp3r405i097as9a1v"; + }; + configureFlags = old.configureFlags ++ [ "--with-slrnpull" ]; + }); +} diff --git a/overlays/taskwarrior/default.nix b/overlays/taskwarrior/default.nix new file mode 100644 index 00000000..64ea6900 --- /dev/null +++ b/overlays/taskwarrior/default.nix @@ -0,0 +1,13 @@ +self: super: +{ + taskwarrior = super.taskwarrior.overrideAttrs (old: { + postInstall = ''${old.postInstall} + mkdir -p "$out/share/vim/vimfiles/ftdetect" + mkdir -p "$out/share/vim/vimfiles/syntax" + ln -s "../../../../share/doc/task/scripts/vim/ftdetect/task.vim" "$out/share/vim/vimfiles/ftdetect/" + ln -s "../../../../share/doc/task/scripts/vim/syntax/taskrc.vim" "$out/share/vim/vimfiles/syntax/" + ln -s "../../../../share/doc/task/scripts/vim/syntax/taskdata.vim" "$out/share/vim/vimfiles/syntax/" + ln -s "../../../../share/doc/task/scripts/vim/syntax/taskedit.vim" "$out/share/vim/vimfiles/syntax/" + ''; + }); +} diff --git a/overlays/vit/default.nix b/overlays/vit/default.nix new file mode 100644 index 00000000..46242840 --- /dev/null +++ b/overlays/vit/default.nix @@ -0,0 +1,8 @@ +self: super: +{ + vit = (super.vit.override { inherit (self) taskwarrior; }).overrideAttrs (old: + self.mylibs.fetchedGithub ./vit.json // { + buildInputs = old.buildInputs ++ (with self.perlPackages; [ TryTiny TextCharWidth ]); + } + ); +} diff --git a/overlays/vit/vit.json b/overlays/vit/vit.json new file mode 100644 index 00000000..d062f685 --- /dev/null +++ b/overlays/vit/vit.json @@ -0,0 +1,15 @@ +{ + "tag": "dbacada-1.3", + "meta": { + "name": "vit", + "url": "https://github.com/scottkosty/vit", + "branch": "1.3" + }, + "github": { + "owner": "scottkosty", + "repo": "vit", + "rev": "dbacada5867b238fdf35dbf00a3ca0daf7703038", + "sha256": "1wlk62cv6dc0dqv8265xcx2l7ydzg40xf6l4qbrf6h5156ncc90l", + "fetchSubmodules": true + } +} diff --git a/overlays/weboob/default.nix b/overlays/weboob/default.nix new file mode 100644 index 00000000..d0a15a7d --- /dev/null +++ b/overlays/weboob/default.nix @@ -0,0 +1,15 @@ +self: super: { + weboob = (self.pythonPackages.weboob.overridePythonAttrs { + setupPyBuildFlags = [ "--no-qt" "--xdg" ]; + }).overrideAttrs (old: rec { + version = "1.5"; + src = self.fetchurl { + url = "https://git.weboob.org/weboob/weboob/-/archive/${version}/${old.pname}-${version}.tar.gz"; + sha256 = "0l6q5nm5g0zn6gmf809059kddrbds27wgygxsfkqja9blks5vq7z"; + }; + postInstall = ''${old.postInstall or ""} + mkdir -p $out/share/bash-completion/completions/ + cp tools/weboob_bash_completion $out/share/bash-completion/completions/weboob + ''; + }); +} diff --git a/overlays/weechat/default.nix b/overlays/weechat/default.nix new file mode 100644 index 00000000..17faa0ec --- /dev/null +++ b/overlays/weechat/default.nix @@ -0,0 +1,14 @@ +self: super: { + weechat = super.weechat.override { + configure = { availablePlugins, ... }: { + plugins = with self; with availablePlugins; [ + # Make sure websocket_client is not 0.55.0, it provokes + # regular crashes + (python.withPackages (ps: with ps; assert websocket_client.version == "0.54.0"; [websocket_client emoji])) + perl + ruby + ]; + }; + }; + +} diff --git a/overlays/ympd/default.nix b/overlays/ympd/default.nix new file mode 100644 index 00000000..dda17aa7 --- /dev/null +++ b/overlays/ympd/default.nix @@ -0,0 +1,5 @@ +self: super: { + ympd = super.ympd.overrideAttrs(old: self.mylibs.fetchedGithub ./ympd.json // { + patches = (old.patches or []) ++ [ ./ympd-password-env.patch ]; + }); +} diff --git a/overlays/ympd/ympd-password-env.patch b/overlays/ympd/ympd-password-env.patch new file mode 100644 index 00000000..2bbe1886 --- /dev/null +++ b/overlays/ympd/ympd-password-env.patch @@ -0,0 +1,23 @@ +diff --git a/src/ympd.c b/src/ympd.c +index 3aed7e6..b3b6fda 100644 +--- a/src/ympd.c ++++ b/src/ympd.c +@@ -71,6 +71,7 @@ int main(int argc, char **argv) + char *run_as_user = NULL; + char const *error_msg = NULL; + char *webport = "8080"; ++ const char *s; + + atexit(bye); + #ifdef WITH_DYNAMIC_ASSETS +@@ -92,6 +93,10 @@ int main(int argc, char **argv) + {0, 0, 0, 0 } + }; + ++ if ((s = getenv("MPD_PASSWORD")) != NULL) { ++ mpd.password = strdup(s); ++ } ++ + while((n = getopt_long(argc, argv, "h:p:w:u:vm:", + long_options, &option_index)) != -1) { + switch (n) { diff --git a/overlays/ympd/ympd.json b/overlays/ympd/ympd.json new file mode 100644 index 00000000..51f06d5d --- /dev/null +++ b/overlays/ympd/ympd.json @@ -0,0 +1,15 @@ +{ + "tag": "612f8fc-master", + "meta": { + "name": "ympd", + "url": "https://github.com/notandy/ympd", + "branch": "master" + }, + "github": { + "owner": "notandy", + "repo": "ympd", + "rev": "612f8fc0b2c47fc89d403e4a044541c6b2b238c8", + "sha256": "01hnj10zl103mrn82vyd42fvq7w5az3jf1qz18889zv67kn73ll9", + "fetchSubmodules": true + } +} -- cgit v1.2.3