1
0
mirror of https://github.com/kmein/niveum synced 2026-03-29 16:51:07 +02:00

5 Commits

7 changed files with 47 additions and 10 deletions

View File

@@ -11,8 +11,7 @@ let
cat > shell.nix <<'EOF' cat > shell.nix <<'EOF'
{ pkgs ? import <nixpkgs> {} }: { pkgs ? import <nixpkgs> {} }:
pkgs.mkShell { pkgs.mkShell {
buildInputs = with pkgs; []; buildInputs = [];
shellHook = "export HISTFILE=''${toString ./.history}";
} }
EOF EOF
''${EDITOR:-vim} shell.nix ''${EDITOR:-vim} shell.nix

View File

@@ -5,6 +5,8 @@
enableDefaultFonts = true; enableDefaultFonts = true;
fontDir.enable = true; fontDir.enable = true;
fonts = with pkgs; [ fonts = with pkgs; [
alegreya
alegreya-sans
corefonts corefonts
eb-garamond eb-garamond
fira fira

View File

@@ -1,25 +1,34 @@
{ pkgs, ... }: { config, pkgs, ... }:
let let
backupLocation = "/var/lib/codimd-backup"; backupLocation = "/var/lib/codimd-backup";
stateLocation = "/var/lib/codimd/state.sqlite"; stateLocation = "/var/lib/codimd/state.sqlite";
nixpkgs-unstable = import <nixpkgs-unstable> {}; nixpkgs-unstable = import <nixpkgs-unstable> {};
domain = "pad.xn--kiern-0qa.de";
in in
{ {
imports = [ <stockholm/krebs/3modules/permown.nix> ]; imports = [ <stockholm/krebs/3modules/permown.nix> ];
services.nginx.virtualHosts."pad.xn--kiern-0qa.de" = { services.nginx.virtualHosts.${domain} = {
enableACME = true; enableACME = true;
addSSL = true; forceSSL = true;
locations."/".extraConfig = '' locations."/" = {
client_max_body_size 4G; proxyPass = "https://localhost:3091";
proxy_set_header Host $host; proxyWebsockets = true;
proxy_pass http://localhost:3091; };
''; };
security.acme.certs.${domain}.group = "hedgecert";
users.groups.hedgecert.members = [ "codimd" "nginx" ];
security.dhparams = {
enable = true;
params.hedgedoc = {};
}; };
services.hedgedoc = { services.hedgedoc = {
enable = true; enable = true;
configuration = { configuration = {
allowOrigin = [ domain ];
allowAnonymous = true; allowAnonymous = true;
allowGravatar = false; allowGravatar = false;
allowFreeURL = true; allowFreeURL = true;
@@ -28,6 +37,13 @@ in
storage = stateLocation; storage = stateLocation;
}; };
port = 3091; port = 3091;
domain = domain;
useSSL = true;
protocolUseSSL = true;
sslCAPath = [ "/etc/ssl/certs/ca-certificates.crt" ];
sslCertPath = "/var/lib/acme/${domain}/cert.pem";
sslKeyPath = "/var/lib/acme/${domain}/key.pem";
dhParamPath = config.security.dhparams.params.hedgedoc.path;
}; };
}; };

View File

@@ -49,6 +49,8 @@ in
profiles = lib.mapAttrs profile { profiles = lib.mapAttrs profile {
Aether = { Aether = {
connection.uuid = "7138bb0f-1aeb-4905-890e-a6628427aa21"; connection.uuid = "7138bb0f-1aeb-4905-890e-a6628427aa21";
ipv6.addr-gen-mode = "stable";
wifi.cloned-mac-address = "stable";
wifi-security = { wifi-security = {
psk = lib.strings.fileContents <secrets/wifi/Aether.psk>; psk = lib.strings.fileContents <secrets/wifi/Aether.psk>;
auth-alg = "open"; auth-alg = "open";

View File

@@ -125,6 +125,7 @@ in {
scripts.scanned scripts.scanned
scripts.default-gateway scripts.default-gateway
scripts.showkeys-toggle scripts.showkeys-toggle
scripts.kirciuoklis
scripts.favicon scripts.favicon
scripts.ipa # XSAMPA to IPA converter scripts.ipa # XSAMPA to IPA converter
scripts.playlist scripts.playlist

View File

@@ -106,6 +106,12 @@ in rec {
name = "meteo"; name = "meteo";
}; };
kirciuoklis = wrapScript {
packages = [ pkgs.curl pkgs.jq ];
script = ./kirciuoklis.sh;
name = "kirciuoklis";
};
booksplit = wrapScript { booksplit = wrapScript {
packages = [ pkgs.ffmpeg tag pkgs.glibc.bin ]; packages = [ pkgs.ffmpeg tag pkgs.glibc.bin ];
script = "${voidrice}/.local/bin/booksplit"; script = "${voidrice}/.local/bin/booksplit";

11
packages/scripts/kirciuoklis.sh Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/sh
curl -sSL 'https://kalbu.vdu.lt/wp-admin/admin-ajax.php' -F action=text_accents -F body="$(cat)" \
| jq -r .message \
| if [ "$1" = "--json" ]
then jq .textParts
else jq -r '
.textParts
| map(if has("accented") then .accented else .string end)
| join("")
'
fi