diff options
author | Mx Kookie <kookie@spacekookie.de> | 2020-12-21 06:08:07 +0100 |
---|---|---|
committer | Mx Kookie <kookie@spacekookie.de> | 2020-12-21 06:08:07 +0100 |
commit | 1c32b3da4c26d00b83b2dc274a7f445e2a01bf2e (patch) | |
tree | 91d639b523ab4a58b4c59c5c2b70aa6e79d5d4a3 /infra | |
parent | 4741f73bce20b498f52920eb514672c58575632a (diff) |
libkookie: init overlays
This is a one-for-one copy from the old infrastructure repository
Diffstat (limited to 'infra')
16 files changed, 638 insertions, 0 deletions
diff --git a/infra/libkookie/overlays/default.nix b/infra/libkookie/overlays/default.nix new file mode 100644 index 000000000000..f503537d4f5e --- /dev/null +++ b/infra/libkookie/overlays/default.nix @@ -0,0 +1,19 @@ +/* Overlays in LIBKOOKIE are split into three parts + * + * patches: upstream but with cool stuff + * staging: things that might become upstream + * kookie: scripts and utils that won't leave LIBKOOKIE + */ + +self: super: { + + barrel-blog = self.callPackage ./kookie/barrel-blog { inherit (super); }; + invoice = self.callPackage ./kookie/invoice { inherit (super); }; + spacekookie-de = self.callPackage ./kookie/spacekookie-de { inherit (super); }; + + nodemcu-uploader = self.callPackage ./staging/nodemcu-uploader { }; + pleroma = self.callPackage ./staging/pleroma { }; + foo2zjs = self.callPackage ./staging/foo2zjs { }; + + htop = self.callPackage ./patches/htop { inherit (super) htop; }; +} diff --git a/infra/libkookie/overlays/kookie/barrel-blog/default.nix b/infra/libkookie/overlays/kookie/barrel-blog/default.nix new file mode 100644 index 000000000000..15c2e58d5ce1 --- /dev/null +++ b/infra/libkookie/overlays/kookie/barrel-blog/default.nix @@ -0,0 +1,32 @@ +{ stdenv, fetchFromGitHub, pythonPackages }: + +let + json = with builtins; fromJSON (readFile ./meta.json); + master = json.rev; + masterSha256 = json.sha256; +in + stdenv.mkDerivation rec { + name = "barrel-blog"; + + src = fetchFromGitHub { + owner = "spacekookie"; + repo = "barrel"; + rev = master; + sha256 = masterSha256; + }; + + buildInputs = with pythonPackages; [ pelican webassets markdown ]; + + installPhase = '' + cd docs/ + pelican content + cp -rv output $out + ''; + + meta = with stdenv.lib; { + description = "A static website running on https://barrel.spacekookie.de"; + homepage = "https://barrel.spacekookie.de"; + license = licenses.mit; + }; + } + diff --git a/infra/libkookie/overlays/kookie/barrel-blog/meta.json b/infra/libkookie/overlays/kookie/barrel-blog/meta.json new file mode 100644 index 000000000000..3f1a908d973a --- /dev/null +++ b/infra/libkookie/overlays/kookie/barrel-blog/meta.json @@ -0,0 +1,6 @@ +{ + "owner": "spacekookie", + "repo": "barrel", + "rev": "ee5a17c97ac5315388f015ce59c98da3b6a895ce", + "sha256": "0n566x8y87pc3ynxqj7sv7cwsj4fhpz2pwn2mhhyjyqpyrq0khfc" +}
\ No newline at end of file diff --git a/infra/libkookie/overlays/kookie/dcutil/default.nix b/infra/libkookie/overlays/kookie/dcutil/default.nix new file mode 100644 index 000000000000..6f8e2bb28649 --- /dev/null +++ b/infra/libkookie/overlays/kookie/dcutil/default.nix @@ -0,0 +1,32 @@ +/* DATACORE UTILS + * + * A tool that makes it easier to deal with decrypting + * and re-crypting the datacore storage pool. + */ + + +{ writeShellScriptBin, zfs }: writeShellScriptBin "dcutils" '' + set -eo pipefail + + function open_pool { + ${zfs}/bin/zfs load-key datacore + ${zfs}/bin/zfs mount datacore + ${zfs}/bin/zfs mount datacore/backup + ${zfs}/bin/zfs mount datacore/media + ${zfs}/bin/zfs mount datacore/sync + } + + function close_pool { + ${zfs}/bin/zfs umount datacore + ${zfs}/bin/zfs umount datacore/backup + ${zfs}/bin/zfs umount datacore/media + ${zfs}/bin/zfs umount datacore/sync + ${zfs}/bin/zfs unload-key datacore + } + + case "$1" in + open*) open_pool ;; + close*) close_pool ;; + *) echo "Usage: <dcutils> [open|close]" + esac +'' diff --git a/infra/libkookie/overlays/kookie/invoice/README.md b/infra/libkookie/overlays/kookie/invoice/README.md new file mode 100644 index 000000000000..500fb5929fed --- /dev/null +++ b/infra/libkookie/overlays/kookie/invoice/README.md @@ -0,0 +1,54 @@ +# invoice + +A tool that generates invoices with `pandoc`, `xelatex` and `yaml`. +A descriptor file is required in order to make all of this work. +These are independent of the tooling and template and should be +client specific. Following is a small example of what it should +look like: + +```yaml +--- +invoice-nr: 2019-1234 +date: 2019-06-09 +author: Alice Anonymous +city: Metropolis +from: +- Cyberstreet 69 +- XX51F5 Metropolis +- alice.anonymous@mail.cyber +- + 69 (0) 13 37 13 12 +ustid: Your Tax ID here +bank: Evil Bank (i.e. a bank) +bank_iban: Your IBAN +bank_bic: Your Bank BIC +to: +- Client Name +- Client Address +- ... +VAT: 19 # Depends on the country you live in +service: +- description: Looking cool + price: 255 + details: + - Making all your other employees look silly + - Telling really bad jokes +- description: Being awesome + price: 615 + details: Its in the title! + +currency: EUR +lang: english + +# Typography and layout +fontsize: 10pt +geometry: a4paper, left=43mm, right=43mm, top=51mm, bottom=17mm +--- +``` + +Then point the script at this descriptor: + +``` +$ invoice clients/client_name.yml +``` + +This will then generate `clients/client_name.pdf` as an invoice diff --git a/infra/libkookie/overlays/kookie/invoice/default.nix b/infra/libkookie/overlays/kookie/invoice/default.nix new file mode 100644 index 000000000000..cdf0f1537acc --- /dev/null +++ b/infra/libkookie/overlays/kookie/invoice/default.nix @@ -0,0 +1,29 @@ +{ stdenv, makeWrapper, coreutils, findutils, + gawk, pandoc, gnumake, texlive }: + +stdenv.mkDerivation { + pname = "invoice"; + version = "0.1.0"; + src = ./.; + + nativeBuildInputs = [ makeWrapper ]; + + installPhase = '' + mkdir -p $out/{bin,share} + cp invoice.sh $out/bin/invoice + cp template.tex $out/share/ + + wrapProgram $out/bin/invoice \ + --set PATH $out/bin:${stdenv.lib.makeBinPath + [ coreutils findutils gawk gnumake pandoc texlive.combined.scheme-full ]} \ + --set TEMPLATE_FILE $out/share/template.tex + ''; + + + meta = with stdenv.lib; { + description = "Generate dynamic invoices based on yaml descriptors"; + homepage = "https://git.sr.ht/~spacekookie/libkookie/"; + license = licenses.gpl3; + }; +} + diff --git a/infra/libkookie/overlays/kookie/invoice/invoice.sh b/infra/libkookie/overlays/kookie/invoice/invoice.sh new file mode 100755 index 000000000000..ff6a22b1112b --- /dev/null +++ b/infra/libkookie/overlays/kookie/invoice/invoice.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +set -ueo pipefail + +SOURCE=$1 + +if [ -z $SOURCE ]; then + echo "Usage: invoice <file>" + exit 2 +fi + +TARGET=$(dirname $SOURCE) +ACCOUNT=$(basename $SOURCE .yml) + +# The reason behind this awk madness is that we want to be able to write +# a date as yyyy-mm-dd in the invoice descriptor, but LaTeX needs the +# date as three elements to fill in a {d}{m}{y} pattern. Thus we replace +# a simple "date" line with three seperate fields that we can then read +# from LaTeX +cat $SOURCE | xargs -d '\n' -L 1 \ + | awk -F '-' '{ if(match($0, /date/)) { gsub(/date: /,"", $1); \ + print "date_year: " $1 "\n" "date_month: " $2 "\n" "date_day: " $3 } \ + else { print $0} }' \ + | pandoc - -o $TARGET/$ACCOUNT.pdf --template=$TEMPLATE_FILE --pdf-engine=xelatex diff --git a/infra/libkookie/overlays/kookie/invoice/template.tex b/infra/libkookie/overlays/kookie/invoice/template.tex new file mode 100644 index 000000000000..0e04455c0bc3 --- /dev/null +++ b/infra/libkookie/overlays/kookie/invoice/template.tex @@ -0,0 +1,143 @@ +%!TEX TS-program = xelatex +%!TEX encoding = UTF-8 Unicode + +\documentclass[$fontsize$, a4paper]{scrartcl} + +% LAYOUT +%-------------------------------- +\usepackage{geometry} +\geometry{$geometry$} +\pagenumbering{gobble} +\usepackage[document]{ragged2e} +\usepackage{scrlayer-scrpage} + +% TYPOGRAPHY +%-------------------------------- +\usepackage{fontspec} +\usepackage{xunicode} +\usepackage{xltxtra} + +\setlength{\parskip}{1em} + +% Command required by how Pandoc handles the list conversion +\providecommand{\tightlist} { + \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt} +} + +% TABLE CUSTOMIZATION +%-------------------------------- +\usepackage{spreadtab} +\usepackage[compact]{titlesec} +\usepackage{hhline} +\usepackage{enumitem} +\usepackage{arydshln} + +\titlespacing*{\section}{0pt}{3pt}{-7pt} +\renewcommand{\arraystretch}{1.5} +\setlist{nolistsep} +\setlist[itemize]{leftmargin=0.5cm} +\setlength{\tabcolsep}{9pt} + + +% LANGUAGE +%-------------------------------- +$if(lang)$ +\usepackage{polyglossia} +\setmainlanguage{german} +$endif$ + +% PDF SETUP +%-------------------------------- +\usepackage[xetex, bookmarks, colorlinks, breaklinks]{hyperref} +\hypersetup +{ + pdfauthor={$author$}, + pdfsubject=Rechnungs Nr. $invoice-nr$, + pdftitle=Rechnungs Nr. $invoice-nr$, + linkcolor=blue, + citecolor=blue, + filecolor=black, + urlcolor=blue +} + +\usepackage[nodayofweek]{datetime} +\newdate{date}{$date_day$}{$date_month$}{$date_year$} +\date{\displaydate{date}} + +% DOCUMENT +%-------------------------------- + +\ohead{ + \textsc{\textbf{$author$}} \\ + $for(from)$ + \textsc{$from$} \\ + $endfor$ + \textsc{USt-IdNr: $ustid$} \\ + \vspace{1em} +} + +\begin{document} + +\vspace{1em} + +\normalsize \sffamily +$for(to)$ +$to$\\ +$endfor$ + +\vspace{6em} + +\begin{flushright} + \small + $city$, \displaydate{date} +\end{flushright} + +\vspace{1em} + +\section*{\textsc{Rechnung} \textsc{\#$invoice-nr$}} +\footnotesize +\newcounter{pos} +\setcounter{pos}{0} +\STautoround*{2} % Get spreadtab to always display the decimal part +$if(commasep)$\STsetdecimalsep{,}$endif$ % Use comma as decimal separator + +\begin{spreadtab}{{tabular}[t t t]{lp{8.2cm}r}} + \hdashline[1pt/1pt] + @ \noalign{\vskip 2mm} \textbf{Pos.} & @ \textbf{Description} & @ \textbf{Prices in $currency$} \\ \hline + $for(service)$ @ \noalign{\vskip 2mm} \refstepcounter{pos} \thepos + & @ $service.description$ + $if(service.details)$\newline \begin{itemize} + $for(service.details)$\scriptsize \item $service.details$ + $endfor$ \end{itemize} + $endif$ & $service.price$\\$endfor$ \noalign{\vskip 2mm} \hline + $if(VAT)$ + @ & @ \multicolumn{1}{r}{Subtotal:} & :={sum(c1:[0,-1])} \\ \hhline{~~-} + @ & @ \multicolumn{1}{r}{VAT $VAT$\%:} & $VAT$/100*[0,-1] \\ \hhline{~~-} + $else$ + @ & @ \multicolumn{1}{r}{Subtotal:} & :={sum(c1:[0,-1])} \\ \hhline{~~-} + @ & @ \multicolumn{1}{r}{USt. Nullregelung:} & 0 \\ \hhline{~~-} + $endif$ + @ & @ \multicolumn{1}{r}{\textbf{Total:}} & \textbf{:={$if(VAT)$[0,-1]+[0,-2]$else$[0,-2]$endif$}} \\ \hhline{~~-} +\end{spreadtab} + +\vspace{15mm} + +\sffamily +\small + +$post_details$ + +bitte überweisen Sie den folgenden Betrag in den nächsten 14 Tagen: + +\strong{Kontoinhaber}: $author$ \\ +\strong{Kreditinstitut}: $bank$ \\ +\strong{IBAN}: $bank_iban$ \\ +\strong{BIC}: $bank_bic$ + +Mit freundlichen Grüßen, + +\medskip + +$author$ + +\end{document} diff --git a/infra/libkookie/overlays/kookie/onepass/default.nix b/infra/libkookie/overlays/kookie/onepass/default.nix new file mode 100644 index 000000000000..47302d0bb7bb --- /dev/null +++ b/infra/libkookie/overlays/kookie/onepass/default.nix @@ -0,0 +1,21 @@ +{ stdenv, lib, fetchurl, wine }: + +stdenv.mkDerivation rec { + pname = "onepass"; + version = "4.6.2.626"; + + src = fetchurl { + url = "https://c.1password.com/dist/1P/win4/1Password-${version}.exe"; + sha256 = "0p2g1vbz48bjjlxzrwww7gqfsn3c3na98qk019xal5s1j912h1ml"; + }; + + dontUnpack = true; + + buildPhase = '' + mkdir -p $out/onepass + WINE_PREFIX=$out/onepass ${wine}/bin/wine ${src} + ''; +} + + + diff --git a/infra/libkookie/overlays/kookie/spacekookie-de/default.nix b/infra/libkookie/overlays/kookie/spacekookie-de/default.nix new file mode 100644 index 000000000000..38ac94dbf55f --- /dev/null +++ b/infra/libkookie/overlays/kookie/spacekookie-de/default.nix @@ -0,0 +1,25 @@ +{ lib, stdenv, fetchgit, python3Packages }: + +stdenv.mkDerivation rec { + name = "spacekookie.de"; + + src = fetchgit { + url = "https://git.sr.ht/~spacekookie/website"; + rev = "f6ca92954f6b825f933f685cb3c27990b96b1721"; + sha256 = "0414351da5hy1096lrmmpm2jwdrxb8j5v59ccz6ayzpv1vwxk5qd"; + }; + + buildInputs = with python3Packages; [ pelican webassets markdown ]; + + installPhase = '' + pelican content + cp -rv output $out + ''; + + meta = with stdenv.lib; { + description = "The `about` and `blog` part of spacekookie.de"; + homepage = "https://spacekookie.de"; + license = licenses.mit; + }; +} + diff --git a/infra/libkookie/overlays/patches/htop/0001-htop-untruncated-username.patch b/infra/libkookie/overlays/patches/htop/0001-htop-untruncated-username.patch new file mode 100644 index 000000000000..1456cf043622 --- /dev/null +++ b/infra/libkookie/overlays/patches/htop/0001-htop-untruncated-username.patch @@ -0,0 +1,136 @@ +From: Alyssa Ross <hi@alyssa.is> +Subject: [PATCH v2] Make "spacekookie" fit untruncated as a user name +Date: Fri, 15 Mar 2019 18:18:22 +0000 + +--- +This version of the increases the length of the column header as well as +the values, so columns after USER don't have misaligned headers. + + Process.c | 10 +++++----- + darwin/Platform.c | 2 +- + dragonflybsd/DragonFlyBSDProcess.c | 2 +- + freebsd/FreeBSDProcess.c | 2 +- + linux/LinuxProcess.c | 2 +- + openbsd/OpenBSDProcess.c | 2 +- + solaris/SolarisProcess.c | 2 +- + unsupported/Platform.c | 2 +- + 8 files changed, 12 insertions(+), 12 deletions(-) + +diff --git a/Process.c b/Process.c +index 54c41af..41d30a3 100644 +--- a/Process.c ++++ b/Process.c +@@ -480,13 +480,13 @@ void Process_writeField(Process* this, RichString* str, ProcessField field) { + if (Process_getuid != (int) this->st_uid) + attr = CRT_colors[PROCESS_SHADOW]; + if (this->user) { +- xSnprintf(buffer, n, "%-9s ", this->user); ++ xSnprintf(buffer, n, "%-11s ", this->user); + } else { +- xSnprintf(buffer, n, "%-9d ", this->st_uid); ++ xSnprintf(buffer, n, "%-11d ", this->st_uid); + } +- if (buffer[9] != '\0') { +- buffer[9] = ' '; +- buffer[10] = '\0'; ++ if (buffer[11] != '\0') { ++ buffer[11] = ' '; ++ buffer[12] = '\0'; + } + break; + } +diff --git a/darwin/Platform.c b/darwin/Platform.c +index 1dce8b6..d603fd2 100644 +--- a/darwin/Platform.c ++++ b/darwin/Platform.c +@@ -93,7 +93,7 @@ ProcessFieldData Process_fields[] = { + [ST_UID] = { .name = "ST_UID", .title = " UID ", .description = "User ID of the process owner", .flags = 0, }, + [PERCENT_CPU] = { .name = "PERCENT_CPU", .title = "CPU% ", .description = "Percentage of the CPU time the process used in the last sampling", .flags = 0, }, + [PERCENT_MEM] = { .name = "PERCENT_MEM", .title = "MEM% ", .description = "Percentage of the memory the process is using, based on resident memory size", .flags = 0, }, +- [USER] = { .name = "USER", .title = "USER ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, }, ++ [USER] = { .name = "USER", .title = "USER ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, }, + [TIME] = { .name = "TIME", .title = " TIME+ ", .description = "Total time the process has spent in user and system time", .flags = 0, }, + [NLWP] = { .name = "NLWP", .title = "NLWP ", .description = "Number of threads in the process", .flags = 0, }, + [TGID] = { .name = "TGID", .title = " TGID ", .description = "Thread group ID (i.e. process ID)", .flags = 0, }, +diff --git a/dragonflybsd/DragonFlyBSDProcess.c b/dragonflybsd/DragonFlyBSDProcess.c +index dade106..19d075d 100644 +--- a/dragonflybsd/DragonFlyBSDProcess.c ++++ b/dragonflybsd/DragonFlyBSDProcess.c +@@ -77,7 +77,7 @@ ProcessFieldData Process_fields[] = { + [ST_UID] = { .name = "ST_UID", .title = " UID ", .description = "User ID of the process owner", .flags = 0, }, + [PERCENT_CPU] = { .name = "PERCENT_CPU", .title = "CPU% ", .description = "Percentage of the CPU time the process used in the last sampling", .flags = 0, }, + [PERCENT_MEM] = { .name = "PERCENT_MEM", .title = "MEM% ", .description = "Percentage of the memory the process is using, based on resident memory size", .flags = 0, }, +- [USER] = { .name = "USER", .title = "USER ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, }, ++ [USER] = { .name = "USER", .title = "USER ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, }, + [TIME] = { .name = "TIME", .title = " TIME+ ", .description = "Total time the process has spent in user and system time", .flags = 0, }, + [NLWP] = { .name = "NLWP", .title = "NLWP ", .description = "Number of threads in the process", .flags = 0, }, + [TGID] = { .name = "TGID", .title = " TGID ", .description = "Thread group ID (i.e. process ID)", .flags = 0, }, +diff --git a/freebsd/FreeBSDProcess.c b/freebsd/FreeBSDProcess.c +index f81fadf..1ed6c2a 100644 +--- a/freebsd/FreeBSDProcess.c ++++ b/freebsd/FreeBSDProcess.c +@@ -76,7 +76,7 @@ ProcessFieldData Process_fields[] = { + [ST_UID] = { .name = "ST_UID", .title = " UID ", .description = "User ID of the process owner", .flags = 0, }, + [PERCENT_CPU] = { .name = "PERCENT_CPU", .title = "CPU% ", .description = "Percentage of the CPU time the process used in the last sampling", .flags = 0, }, + [PERCENT_MEM] = { .name = "PERCENT_MEM", .title = "MEM% ", .description = "Percentage of the memory the process is using, based on resident memory size", .flags = 0, }, +- [USER] = { .name = "USER", .title = "USER ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, }, ++ [USER] = { .name = "USER", .title = "USER ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, }, + [TIME] = { .name = "TIME", .title = " TIME+ ", .description = "Total time the process has spent in user and system time", .flags = 0, }, + [NLWP] = { .name = "NLWP", .title = "NLWP ", .description = "Number of threads in the process", .flags = 0, }, + [TGID] = { .name = "TGID", .title = " TGID ", .description = "Thread group ID (i.e. process ID)", .flags = 0, }, +diff --git a/linux/LinuxProcess.c b/linux/LinuxProcess.c +index 5f69707..1288155 100644 +--- a/linux/LinuxProcess.c ++++ b/linux/LinuxProcess.c +@@ -206,7 +206,7 @@ ProcessFieldData Process_fields[] = { + [ST_UID] = { .name = "ST_UID", .title = " UID ", .description = "User ID of the process owner", .flags = 0, }, + [PERCENT_CPU] = { .name = "PERCENT_CPU", .title = "CPU% ", .description = "Percentage of the CPU time the process used in the last sampling", .flags = 0, }, + [PERCENT_MEM] = { .name = "PERCENT_MEM", .title = "MEM% ", .description = "Percentage of the memory the process is using, based on resident memory size", .flags = 0, }, +- [USER] = { .name = "USER", .title = "USER ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, }, ++ [USER] = { .name = "USER", .title = "USER ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, }, + [TIME] = { .name = "TIME", .title = " TIME+ ", .description = "Total time the process has spent in user and system time", .flags = 0, }, + [NLWP] = { .name = "NLWP", .title = "NLWP ", .description = "Number of threads in the process", .flags = 0, }, + [TGID] = { .name = "TGID", .title = " TGID ", .description = "Thread group ID (i.e. process ID)", .flags = 0, }, +diff --git a/openbsd/OpenBSDProcess.c b/openbsd/OpenBSDProcess.c +index 70f9653..ed90cf2 100644 +--- a/openbsd/OpenBSDProcess.c ++++ b/openbsd/OpenBSDProcess.c +@@ -150,7 +150,7 @@ ProcessFieldData Process_fields[] = { + .flags = 0, }, + [USER] = { + .name = "USER", +- .title = "USER ", ++ .title = "USER ", + .description = "Username of the process owner (or user ID if name cannot be determined)", + .flags = 0, }, + [TIME] = { +diff --git a/solaris/SolarisProcess.c b/solaris/SolarisProcess.c +index 31f488e..7452e94 100644 +--- a/solaris/SolarisProcess.c ++++ b/solaris/SolarisProcess.c +@@ -93,7 +93,7 @@ ProcessFieldData Process_fields[] = { + [ST_UID] = { .name = "ST_UID", .title = " UID ", .description = "User ID of the process owner", .flags = 0, }, + [PERCENT_CPU] = { .name = "PERCENT_CPU", .title = "CPU% ", .description = "Percentage of the CPU time the process used in the last sampling", .flags = 0, }, + [PERCENT_MEM] = { .name = "PERCENT_MEM", .title = "MEM% ", .description = "Percentage of the memory the process is using, based on resident memory size", .flags = 0, }, +- [USER] = { .name = "USER", .title = "USER ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, }, ++ [USER] = { .name = "USER", .title = "USER ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, }, + [TIME] = { .name = "TIME", .title = " TIME+ ", .description = "Total time the process has spent in user and system time", .flags = 0, }, + [NLWP] = { .name = "NLWP", .title = "NLWP ", .description = "Number of threads in the process", .flags = 0, }, + [TGID] = { .name = "TGID", .title = " TGID ", .description = "Thread group ID (i.e. process ID)", .flags = 0, }, +diff --git a/unsupported/Platform.c b/unsupported/Platform.c +index ba84419..cf5b09d 100644 +--- a/unsupported/Platform.c ++++ b/unsupported/Platform.c +@@ -53,7 +53,7 @@ ProcessFieldData Process_fields[] = { + [ST_UID] = { .name = "ST_UID", .title = " UID ", .description = "User ID of the process owner", .flags = 0, }, + [PERCENT_CPU] = { .name = "PERCENT_CPU", .title = "CPU% ", .description = "Percentage of the CPU time the process used in the last sampling", .flags = 0, }, + [PERCENT_MEM] = { .name = "PERCENT_MEM", .title = "MEM% ", .description = "Percentage of the memory the process is using, based on resident memory size", .flags = 0, }, +- [USER] = { .name = "USER", .title = "USER ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, }, ++ [USER] = { .name = "USER", .title = "USER ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, }, + [TIME] = { .name = "TIME", .title = " TIME+ ", .description = "Total time the process has spent in user and system time", .flags = 0, }, + [NLWP] = { .name = "NLWP", .title = "NLWP ", .description = "Number of threads in the process", .flags = 0, }, + [TGID] = { .name = "TGID", .title = " TGID ", .description = "Thread group ID (i.e. process ID)", .flags = 0, }, +-- +2.19.2 + + diff --git a/infra/libkookie/overlays/patches/htop/default.nix b/infra/libkookie/overlays/patches/htop/default.nix new file mode 100644 index 000000000000..7550f960aac6 --- /dev/null +++ b/infra/libkookie/overlays/patches/htop/default.nix @@ -0,0 +1,16 @@ +/* HTOP CUSTOM COLUMN LENGTHS + * + * My nick (spacekookie) is too long to be displayed + * in an htop column. This custom patches fixes this + * + * (<3) + */ +{ htop, python3 }: + +htop.overrideAttrs ({ patches ? [], nativeBuildInputs ? [], postConfigure ? "", ... }: { + patches = patches ++ [ ./0001-htop-untruncated-username.patch ]; + nativeBuildInputs = nativeBuildInputs ++ [ python3 ]; + postConfigure = '' + patchShebangs ./scripts/MakeHeader.py + '' + postConfigure; +}) diff --git a/infra/libkookie/overlays/staging/foo2zjs/0001-Removing-the-way-the-Makefile-handles-PREFIX.patch b/infra/libkookie/overlays/staging/foo2zjs/0001-Removing-the-way-the-Makefile-handles-PREFIX.patch new file mode 100644 index 000000000000..95ca34f8d986 --- /dev/null +++ b/infra/libkookie/overlays/staging/foo2zjs/0001-Removing-the-way-the-Makefile-handles-PREFIX.patch @@ -0,0 +1,28 @@ +From dfd14d715efd21845132b9aa824fd024785f0e4f Mon Sep 17 00:00:00 2001 +From: Kaiden Fey <kookie@spacekookie.de> +Date: Sun, 8 Nov 2020 13:59:19 +0100 +Subject: [PATCH] Removing the way the Makefile handles PREFIX + +--- + Makefile | 5 ----- + 1 file changed, 5 deletions(-) + +diff --git a/Makefile b/Makefile +index 381fd6c..4df0c20 100644 +--- a/Makefile ++++ b/Makefile +@@ -16,11 +16,6 @@ SYSNAME := $(shell uname -n) + # No version number yet... + VERSION=0.0 + +-# Installation prefix... +-PREFIX=/usr/local +-PREFIX=/usr +-PREFIX=$(DESTDIR)/usr +- + # Pathnames for this package... + BIN=$(PREFIX)/bin + SHAREZJS=$(PREFIX)/share/foo2zjs +-- +2.28.0 + diff --git a/infra/libkookie/overlays/staging/foo2zjs/default.nix b/infra/libkookie/overlays/staging/foo2zjs/default.nix new file mode 100644 index 000000000000..b51b4073cf81 --- /dev/null +++ b/infra/libkookie/overlays/staging/foo2zjs/default.nix @@ -0,0 +1,25 @@ +{ stdenv, lib, fetchurl, glibc, ghostscript, bc, cups-filters, ... }: + +stdenv.mkDerivation { + pname = "foo2zjs"; + version = "0.0.0"; + src = fetchurl { + url = "http://foo2zjs.rkkda.com/foo2zjs.tar.gz"; + sha256 = "013793jnlqp21gmsn362zf9yxgi9f9lsmcz20v3db85hcbq91ib3"; + }; + + nativeBuildInputs = [ ghostscript bc ]; + patches = [ ./0001-Removing-the-way-the-Makefile-handles-PREFIX.patch ]; + + configurePhase = '' + sed -i "s:/usr/include/stdio.h:${glibc.dev.outPath}/include/stdio.h:" Makefile + ''; + + buildInputs = [ cups-filters ]; + + installFlags = [ "PREFIX=$(out)" ]; + + # installPhase = '' + # mkdir -p $out/bin + # ''; +} diff --git a/infra/libkookie/overlays/staging/nodemcu-uploader/default.nix b/infra/libkookie/overlays/staging/nodemcu-uploader/default.nix new file mode 100644 index 000000000000..43176a9c890f --- /dev/null +++ b/infra/libkookie/overlays/staging/nodemcu-uploader/default.nix @@ -0,0 +1,23 @@ +{ stdenv, python2, python2Packages, ... }: + +python2.pkgs.buildPythonApplication rec { + pname = "nodemcu-uploader"; + version = "0.4.3"; + + src = python2.pkgs.fetchPypi { + inherit pname version; + sha256 = "13nlc2gr85pw7kcfirzi3k8rqybmdwhsxnndixvayis1fm80bsrf"; + }; + + propagatedBuildInputs = with python2.pkgs; [ pyserial wrapt ]; + + doCheck = false; + + meta = with stdenv.lib; { + description = "Lalalala"; + homepage = https://www.foo.org; + license = licenses.mit; + platforms = platforms.unix; + maintainers = with maintainers; [ spacekookie ]; + }; +} diff --git a/infra/libkookie/overlays/staging/pleroma/default.nix b/infra/libkookie/overlays/staging/pleroma/default.nix new file mode 100644 index 000000000000..1e1cc2d58eb7 --- /dev/null +++ b/infra/libkookie/overlays/staging/pleroma/default.nix @@ -0,0 +1,25 @@ +{ stdenv, lib, pkgs, fetchFromGitLab, ... }: + +stdenv.mkDerivation rec { + name = "pleroma-${version}"; + version = "0.9.0"; + + src = fetchFromGitLab rec { + domain = "git.pleroma.social"; + owner = "pleroma"; + repo = "pleroma"; + rev = "v${version}"; + sha256 = "1k33h3j67ywrmkrjr1hvb53j3zsvszb4rfraak1vsh7jn4j6a0wl"; + }; + + installPhase = '' + cp -r $src $out + ''; + + meta = with lib; { + description = "A free, federated social networking server built on open protocols"; + license = licenses.agpl3; + maintainers = [ maintainers.spacekookie ]; + platforms = platforms.all; + }; +} |