summaryrefslogtreecommitdiffstats
path: root/krebs/5pkgs
diff options
context:
space:
mode:
Diffstat (limited to 'krebs/5pkgs')
-rw-r--r--krebs/5pkgs/haskell/nix-serve-ng.nix6
-rw-r--r--krebs/5pkgs/simple/fzfmenu/default.nix2
-rw-r--r--krebs/5pkgs/simple/ovh-zone/default.nix1
-rw-r--r--krebs/5pkgs/simple/realwallpaper/get_constellations.py29
-rw-r--r--krebs/5pkgs/simple/renew-krebs-intermediate-ca/default.nix30
-rw-r--r--krebs/5pkgs/simple/vicuna-chat/default.nix2
6 files changed, 52 insertions, 18 deletions
diff --git a/krebs/5pkgs/haskell/nix-serve-ng.nix b/krebs/5pkgs/haskell/nix-serve-ng.nix
index 8866b205b..62e02ce82 100644
--- a/krebs/5pkgs/haskell/nix-serve-ng.nix
+++ b/krebs/5pkgs/haskell/nix-serve-ng.nix
@@ -6,11 +6,11 @@
}:
mkDerivation {
pname = "nix-serve-ng";
- version = "1.0.0";
+ version = "1.0.1";
src = fetchgit {
url = "https://github.com/aristanetworks/nix-serve-ng";
- sha256 = "0mqp67z5mi8rsjahdh395n7ppf0b65k8rd3pvnl281g02rbr69y2";
- rev = "433f70f4daae156b84853f5aaa11987aa5ce7277";
+ sha256 = "sha256-PkzwtjUgYuqfWtCH1nRqVRaajihN1SqMVjWmoSG/CCY=";
+ rev = "9b546864f4090736f3f9069a01ea5d42cf7bab7c";
fetchSubmodules = true;
};
isLibrary = false;
diff --git a/krebs/5pkgs/simple/fzfmenu/default.nix b/krebs/5pkgs/simple/fzfmenu/default.nix
index eb2441330..030c1b1b1 100644
--- a/krebs/5pkgs/simple/fzfmenu/default.nix
+++ b/krebs/5pkgs/simple/fzfmenu/default.nix
@@ -43,7 +43,7 @@ pkgs.writers.writeDashBin "fzfmenu" ''
set -efu
# Spawn terminal if called without one, like e.g. from a window manager.
- if [ -z ''${TERM+x} ]; then
+ if [ -z ''${TERM+x} ] || [ $TERM = dumb ]; then
exec 3<&0
exec 4>&1
export FZFMENU_INPUT_FD=3
diff --git a/krebs/5pkgs/simple/ovh-zone/default.nix b/krebs/5pkgs/simple/ovh-zone/default.nix
index 051a14e8d..bc0e45cb9 100644
--- a/krebs/5pkgs/simple/ovh-zone/default.nix
+++ b/krebs/5pkgs/simple/ovh-zone/default.nix
@@ -9,7 +9,6 @@ python3Packages.buildPythonPackage rec {
name = "ovh-zone-${version}";
version = "0.4.4";
propagatedBuildInputs = with pkgs.python3Packages;[
- d2to1 # for setup to work
ovh
docopt
];
diff --git a/krebs/5pkgs/simple/realwallpaper/get_constellations.py b/krebs/5pkgs/simple/realwallpaper/get_constellations.py
index 5d8d3df5d..4ba766f6a 100644
--- a/krebs/5pkgs/simple/realwallpaper/get_constellations.py
+++ b/krebs/5pkgs/simple/realwallpaper/get_constellations.py
@@ -18,19 +18,24 @@ def points_to_lines(points):
return lines
-with open(sys.argv[1]) as f:
- constellations = json.load(f)['features']
+def main():
+ with open(sys.argv[1]) as f:
+ constellations = json.load(f)['features']
-output = []
+ output = []
-for const in constellations:
- for line in const['geometry']['coordinates']:
- transformed_line = []
- for point in line:
- transformed_line.append(convert_to_itrs(point))
+ for const in constellations:
+ for line in const['geometry']['coordinates']:
+ transformed_line = []
+ for point in line:
+ transformed_line.append(convert_to_itrs(point))
- line_combined = points_to_lines(transformed_line)
- for l in line_combined: # noqa
- output.append(f'{l[0][0]} {l[0][1]} {l[1][0]} {l[1][1]} # {const["id"]}') # noqa
+ line_combined = points_to_lines(transformed_line)
+ for l in line_combined: # noqa
+ output.append(f'{l[0][0]} {l[0][1]} {l[1][0]} {l[1][1]} # {const["id"]}') # noqa
-print('\n'.join(output))
+ print('\n'.join(output))
+
+
+if __name__ == "__main__":
+ main()
diff --git a/krebs/5pkgs/simple/renew-krebs-intermediate-ca/default.nix b/krebs/5pkgs/simple/renew-krebs-intermediate-ca/default.nix
new file mode 100644
index 000000000..d3557894d
--- /dev/null
+++ b/krebs/5pkgs/simple/renew-krebs-intermediate-ca/default.nix
@@ -0,0 +1,30 @@
+{ pkgs }:
+pkgs.writers.writeDashBin "renew-intermediate-ca" ''
+ TMPDIR=$(mktemp -d)
+ trap "rm -rf $TMPDIR;" INT TERM EXIT
+ mkdir -p "$TMPDIR/krebs"
+ brain show ca/ca.key > "$TMPDIR/krebs/ca.key"
+ brain show ca/ca.crt > "$TMPDIR/krebs/ca.crt"
+ brain show krebs-secrets/hotdog/acme_ca.key > "$TMPDIR/acme.key"
+ cp ${toString ../../../6assets/krebsAcmeCA.crt} "$TMPDIR/acme.crt"
+ export STEPPATH="$TMPDIR/step"
+ cat << EOF > "$TMPDIR/intermediate.tpl"
+ {
+ "subject": {{ toJson .Subject }},
+ "keyUsage": ["certSign", "crlSign"],
+ "basicConstraints": {
+ "isCA": true,
+ "maxPathLen": 0
+ },
+ "nameConstraints": {
+ "critical": true,
+ "permittedDNSDomains": ["r" ,"w"]
+ }
+ }
+ EOF
+
+ ${pkgs.step-cli}/bin/step ca renew "$TMPDIR/ca.crt" "$TMPDIR/ca.key" \
+ --offline \
+ --root "$TMPDIR/krebs/ca.crt" \
+ --ca-config "$TMPDIR/intermediate.tpl"
+''
diff --git a/krebs/5pkgs/simple/vicuna-chat/default.nix b/krebs/5pkgs/simple/vicuna-chat/default.nix
index 11a11aabe..db15899d6 100644
--- a/krebs/5pkgs/simple/vicuna-chat/default.nix
+++ b/krebs/5pkgs/simple/vicuna-chat/default.nix
@@ -23,7 +23,7 @@ pkgs.writers.writeDashBin "vicuna-chat" ''
add_to_context "{\"role\": \"user\", \"content\": \"$PROMPT\"}"
response=$(
jq -nc --slurpfile context "$CONTEXT" '{
- model: "vicuna-13b",
+ model: "vicuna-13b-v1.5-16k",
messages: $context[0],
}' |
curl -Ss http://vicuna.r/v1/chat/completions -H 'Content-Type: application/json' -d @-