mirror of
https://github.com/kmein/niveum
synced 2026-03-29 08:41:07 +02:00
Compare commits
1 Commits
dbdc876375
...
bc51c93740
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bc51c93740 |
1
ci.nix
1
ci.nix
@@ -37,7 +37,6 @@
|
||||
"di.fm/key"
|
||||
"eduroam/identity"
|
||||
"eduroam/password"
|
||||
"github/notification.token"
|
||||
"hass/token"
|
||||
"mail/cock"
|
||||
"mail/fastmail"
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
roboto
|
||||
roboto-mono
|
||||
noto-fonts
|
||||
noto-fonts-cjk
|
||||
noto-fonts-emoji
|
||||
roboto-slab
|
||||
scheherazade-new
|
||||
@@ -47,7 +46,7 @@
|
||||
fontconfig.defaultFonts = {
|
||||
monospace = ["Noto Sans Mono"];
|
||||
serif = ["Noto Serif" "Noto Naskh Arabic" "Noto Serif Devanagari"];
|
||||
sansSerif = ["Noto Sans Display" "Noto Kufi Arabic" "Noto Sans Devanagari" "Noto Sans CJK JP"];
|
||||
sansSerif = ["Noto Sans Display" "Noto Kufi Arabic" "Noto Sans Devanagari"];
|
||||
emoji = ["Noto Color Emoji" "Noto Emoji"];
|
||||
};
|
||||
};
|
||||
|
||||
@@ -167,7 +167,7 @@ in {
|
||||
text = colours.foreground;
|
||||
};
|
||||
};
|
||||
statusCommand = "env I3RS_GITHUB_TOKEN=${lib.strings.fileContents <secrets/github/notification.token>} ${pkgs.i3status-rust}/bin/i3status-rs ${
|
||||
statusCommand = "${pkgs.i3status-rust}/bin/i3status-rs ${
|
||||
(pkgs.formats.toml {}).generate "i3status-rust.toml" (import <niveum/lib/i3status-rust.nix> {
|
||||
inherit (config.niveum) batteryName wirelessInterface;
|
||||
inherit colours;
|
||||
|
||||
@@ -115,7 +115,7 @@ in {
|
||||
color index red default '.*'
|
||||
color index_flags lightcyan default '.*'
|
||||
color index_author yellow default '.*'
|
||||
color index_subject default default '.*'
|
||||
color index_subject white default '.*'
|
||||
|
||||
# New mail is boldened:
|
||||
color index_author lightyellow default "~N"
|
||||
|
||||
@@ -75,7 +75,7 @@ in {
|
||||
pkgs.newsboat
|
||||
(pkgs.writers.writeDashBin "newsboat-unread-count" ''
|
||||
if [ -f ${newsboat-home}/cache.db.lock ]; then
|
||||
${pkgs.jq}/bin/jq -n '{state: "Info", text: "↻", icon: "rss"}'
|
||||
${pkgs.jq}/bin/jq -n '{state: "Info", text: "↻", icon: "update"}'
|
||||
else
|
||||
|
||||
${pkgs.jq}/bin/jq -n \
|
||||
|
||||
@@ -19,7 +19,6 @@ in {
|
||||
./astrology.nix
|
||||
./autorenkalender.nix
|
||||
./hesychius.nix
|
||||
./smyth.nix
|
||||
./nachtischsatan.nix
|
||||
./tlg-wotd.nix
|
||||
<niveum/modules/telegram-bot.nix>
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
niveum.telegramBots.smyth = {
|
||||
enable = true;
|
||||
time = "08/6:00";
|
||||
token = lib.strings.fileContents <system-secrets/telegram/kmein.token>;
|
||||
chatIds = ["@HerbertWeirSmyth"];
|
||||
command = toString (pkgs.writers.writeDash "random-smyth" ''
|
||||
set -efu
|
||||
|
||||
RANDOM_SECTION=$(
|
||||
${pkgs.curl}/bin/curl -sSL http://www.perseus.tufts.edu/hopper/xmltoc?doc=Perseus%3Atext%3A1999.04.0007%3Asmythp%3D1 \
|
||||
| ${pkgs.gnugrep}/bin/grep -o 'ref="[^"]*"' \
|
||||
| ${pkgs.coreutils}/bin/shuf -n1 \
|
||||
| ${pkgs.gnused}/bin/sed 's/^ref="//;s/"$//'
|
||||
)
|
||||
|
||||
${pkgs.curl}/bin/curl -sSL http://www.perseus.tufts.edu/hopper/text?doc=$RANDOM_SECTION\
|
||||
| ${pkgs.htmlq}/bin/htmlq '#text_main' \
|
||||
| ${pkgs.gnused}/bin/sed 's/<\/\?hr>//g' \
|
||||
| ${pkgs.pandoc}/bin/pandoc -f html -t plain --wrap=none
|
||||
'');
|
||||
};
|
||||
|
||||
niveum.passport.services = [
|
||||
{
|
||||
title = "Herbert Weir Smyth Bot";
|
||||
description = "sends a random section from Smyth's Ancient Greek grammar to Telegram.";
|
||||
link = "https://t.me/HerbertWeirSmyth";
|
||||
}
|
||||
];
|
||||
}
|
||||
36
flake.lock
generated
36
flake.lock
generated
@@ -23,11 +23,11 @@
|
||||
"utils": "utils"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1661573386,
|
||||
"narHash": "sha256-pBEg8iY00Af/SAtU2dlmOAv+2x7kScaGlFRDjNoVJO8=",
|
||||
"lastModified": 1660574517,
|
||||
"narHash": "sha256-Lp5D2pAPrM3iAc1eeR0iGwz5rM+SYOWzVxI3p17nlrU=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "d89bdff445eadff03fe414e9c30486bc8166b72b",
|
||||
"rev": "688e5c85b7537f308b82167c8eb4ecfb70a49861",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -47,15 +47,15 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1661273257,
|
||||
"narHash": "sha256-cywpSH3D291AwdO/ecJxHeN2Vuuz0cIy/NEXMsFT+Og=",
|
||||
"owner": "kmein",
|
||||
"lastModified": 1644957911,
|
||||
"narHash": "sha256-ggie/j7pdBqzDs4W7OiPmhqH9IGbXAbJxGqBdVxA8jA=",
|
||||
"owner": "Mic92",
|
||||
"repo": "krops",
|
||||
"rev": "542bc544ec8b0b807933a812d098e601683b0956",
|
||||
"rev": "86fb3d2ee94fd8306231853b323ed8804edf26ec",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "kmein",
|
||||
"owner": "Mic92",
|
||||
"repo": "krops",
|
||||
"type": "github"
|
||||
}
|
||||
@@ -110,11 +110,11 @@
|
||||
},
|
||||
"nixos-stable": {
|
||||
"locked": {
|
||||
"lastModified": 1661520432,
|
||||
"narHash": "sha256-9z+WDeXiu3hobvSsL0SbHDx4s+kFmm8eussySuX4zCM=",
|
||||
"lastModified": 1660926553,
|
||||
"narHash": "sha256-19Ib1b7Ny+yGhnxwnH1KhhB2hvALuNuqevA6XzqkQmo=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "f11e12ac6af528c1ba12426ce83cee26f21ceafd",
|
||||
"rev": "00e376e3f3c22d991052dfeaf154c42b09deeb29",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -126,11 +126,11 @@
|
||||
},
|
||||
"nixos-unstable": {
|
||||
"locked": {
|
||||
"lastModified": 1661450036,
|
||||
"narHash": "sha256-0/9UyJLtfWqF4uvOrjFIzk8ue1YYUHa6JIhV0mALkH0=",
|
||||
"lastModified": 1660908602,
|
||||
"narHash": "sha256-SwZ85IPWvC4NxxFhWhRMTJpApSHbY1u4YK2UFWEBWvY=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "f3d0897be466aa09a37f6bf59e62c360c3f9a6cc",
|
||||
"rev": "495b19d5b3e62b4ec7e846bdfb6ef3d9c3b83492",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -211,11 +211,11 @@
|
||||
"stockholm": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1661246925,
|
||||
"narHash": "sha256-hGNCF4m3SuVogqoipmJzNIKoh03S/SMnO5oMHgfHWjA=",
|
||||
"lastModified": 1660682075,
|
||||
"narHash": "sha256-2Q0j7FiYao0VDRKnW1jSLJu3Cn/ORz/pPsyW+wwWoEU=",
|
||||
"ref": "refs/heads/master",
|
||||
"rev": "d1fa957ed5bf60767c83c96135f9142f6c96ea50",
|
||||
"revCount": 10749,
|
||||
"rev": "9ae4a08ccc07964decc51fb1e92bc35d49e4691c",
|
||||
"revCount": 10732,
|
||||
"type": "git",
|
||||
"url": "https://cgit.lassul.us/stockholm"
|
||||
},
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
inputs.nixpkgs.follows = "nixos-unstable";
|
||||
};
|
||||
krops = {
|
||||
url = "github:kmein/krops";
|
||||
url = "github:Mic92/krops";
|
||||
inputs.nixpkgs.follows = "nixos-stable";
|
||||
inputs.flake-utils.follows = "flake-utils";
|
||||
};
|
||||
@@ -152,7 +152,6 @@
|
||||
toString (krops.packages.${system}.writeDeploy "deploy-${name}" {
|
||||
source = krops.lib.evalSource [(source {inherit sources unstable name;})];
|
||||
target = "${user}@${host}:${toString sshPort}";
|
||||
useNixOutputMonitor = true;
|
||||
});
|
||||
in {
|
||||
apps.${system} = let
|
||||
|
||||
@@ -35,8 +35,6 @@ in {
|
||||
};
|
||||
icons.name = "awesome6";
|
||||
icons.overrides.rss = "";
|
||||
icons.overrides.vpn = "";
|
||||
icons.overrides.irc = "";
|
||||
block = [
|
||||
{
|
||||
block = "weather";
|
||||
@@ -72,11 +70,6 @@ in {
|
||||
print("↑{} ↓{} {}{}".format(sun["sunrise"].strftime("%R"), sun["sunset"].strftime("%R"), "☽" if current_phase < 14 else "☾", round(current_phase, 1)))
|
||||
'';
|
||||
}
|
||||
{
|
||||
block = "github";
|
||||
info = ["total"];
|
||||
warning = ["mention" "review_requested"];
|
||||
}
|
||||
{
|
||||
block = "custom";
|
||||
interval = 10;
|
||||
@@ -93,7 +86,7 @@ in {
|
||||
| (map(select(.due >= now and .due < now + (60 * 60 * 24))) | length) as $dueToday
|
||||
| {
|
||||
icon: "tasks",
|
||||
text: (($overdue + $dueToday) as $sum | if $sum > 0 then $sum | tostring else "" end),
|
||||
text: ($overdue + $dueToday) | tostring,
|
||||
state: (
|
||||
if $overdue > 0 then
|
||||
"Critical"
|
||||
@@ -107,30 +100,27 @@ in {
|
||||
'
|
||||
'';
|
||||
json = true;
|
||||
hide_when_empty = true;
|
||||
}
|
||||
{
|
||||
block = "custom";
|
||||
interval = 60 * 5;
|
||||
command = let
|
||||
query-account = name: account:
|
||||
pkgs.writers.writeDash "query-imap-${name}" ''
|
||||
query-account = account:
|
||||
pkgs.writers.writeDash "query-imap" ''
|
||||
${pkgs.curl}/bin/curl -sSL -u ${lib.escapeShellArg "${account.user}:${account.password}"} imaps://${account.imap} -X 'STATUS INBOX (UNSEEN)' \
|
||||
| ${pkgs.gnugrep}/bin/grep -Eo '[0-9]+' \
|
||||
| sed 's/^/{"${name}":/;s/$/}/'
|
||||
| ${pkgs.gnugrep}/bin/grep -Eo '[0-9]+'
|
||||
'';
|
||||
in
|
||||
pkgs.writers.writeDash "unread-mail" ''
|
||||
{
|
||||
${lib.concatStringsSep "\n" (lib.mapAttrsToList query-account accounts)}
|
||||
${lib.concatMapStringsSep "\n" query-account (builtins.attrValues accounts)}
|
||||
} | jq -s '
|
||||
add
|
||||
| (values | add) as $sum
|
||||
(. | add) as $sum
|
||||
| {
|
||||
text: (if $sum > 0 then $sum | tostring else "" end),
|
||||
text: $sum | tostring,
|
||||
icon: "mail",
|
||||
state: (
|
||||
if .uni > 0 or .["work-uni"] > 0 or .posteo > 0 then
|
||||
if $sum > 5 then
|
||||
"Warning"
|
||||
elif $sum > 0 then
|
||||
"Info"
|
||||
@@ -141,32 +131,16 @@ in {
|
||||
}'
|
||||
'';
|
||||
json = true;
|
||||
hide_when_empty = true;
|
||||
}
|
||||
{
|
||||
block = "custom";
|
||||
interval = 60;
|
||||
command = pkgs.writers.writeDash "weechat" ''
|
||||
ssh makanek cat /var/lib/weechat/hotlist.txt | sed 's/,/\n/g' | wc -l | jq '{
|
||||
text: (if . > 0 then . | tostring else "" end),
|
||||
state: (if . > 0 then "Info" else "Idle" end),
|
||||
icon: "irc"
|
||||
}'
|
||||
'';
|
||||
json = true;
|
||||
hide_when_empty = true;
|
||||
}
|
||||
{
|
||||
block = "custom";
|
||||
interval = 5;
|
||||
command = pkgs.writers.writeDash "hu-berlin-vpn" ''
|
||||
PATH=${lib.makeBinPath [pkgs.systemd]}
|
||||
(systemctl is-active --quiet openvpn-hu-berlin.service && echo '{"state": "Good", "text": "OpenVPN", "icon": "vpn"}') \
|
||||
|| (systemctl is-active --quiet hu-vpn.service && echo '{"state": "Good", "text": "PPP+SSL", "icon": "vpn"}') \
|
||||
|| echo '{"state": "Idle", "icon": "vpn", "text": ""}'
|
||||
(systemctl is-active --quiet openvpn-hu-berlin.service && echo "OVPN") \
|
||||
|| (systemctl is-active --quiet hu-vpn.service && echo "PPP-VPN") \
|
||||
|| :
|
||||
'';
|
||||
json = true;
|
||||
hide_when_empty = true;
|
||||
}
|
||||
{
|
||||
block = "net";
|
||||
@@ -194,7 +168,7 @@ in {
|
||||
{block = "load";}
|
||||
{
|
||||
block = "custom";
|
||||
interval = 1;
|
||||
interval = 10;
|
||||
json = true;
|
||||
command = pkgs.writers.writeDash "time" ''
|
||||
${pkgs.jq}/bin/jq -n \
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
{
|
||||
stdenv,
|
||||
lib,
|
||||
fetchurl,
|
||||
weechat,
|
||||
}:
|
||||
stdenv.mkDerivation {
|
||||
pname = "hotlist2extern";
|
||||
version = "1.0";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://raw.githubusercontent.com/weechat/scripts/dd627975cf2e464f206f8006cb3963c8ee82044c/perl/hotlist2extern.pl";
|
||||
sha256 = "1flpikm1kq6m9rh3hmafni9f2yi1b90w539k3hj55a5c9gddp2lr";
|
||||
};
|
||||
|
||||
dontUnpack = true;
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/share
|
||||
cp $src $out/share/hotlist2extern.pl
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
scripts = ["hotlist2extern.pl"];
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
inherit (weechat.meta) platforms;
|
||||
description = "Give hotlist to an external file/program";
|
||||
license = licenses.gpl3;
|
||||
maintainers = with maintainers; [kmein];
|
||||
};
|
||||
}
|
||||
@@ -103,11 +103,5 @@ in {
|
||||
defaults.email = kieran.email;
|
||||
};
|
||||
|
||||
environment.systemPackages = [
|
||||
pkgs.vim
|
||||
pkgs.git
|
||||
pkgs.tmux
|
||||
pkgs.python3
|
||||
pkgs.nix-output-monitor
|
||||
];
|
||||
environment.systemPackages = [pkgs.vim pkgs.git pkgs.tmux pkgs.python3];
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
}: let
|
||||
inherit (import <niveum/lib>) kieran;
|
||||
relayPassword = lib.fileContents <system-secrets/weechat/relay>;
|
||||
weechatHome = "/var/lib/weechat";
|
||||
in {
|
||||
systemd.services.weechat = let
|
||||
tmux = pkgs.writers.writeDash "tmux" ''
|
||||
@@ -32,7 +31,6 @@ in {
|
||||
pkgs.weechatScripts.weechat-autosort
|
||||
pkgs.weechatScripts.colorize_nicks
|
||||
pkgs.weechatScripts.weechat-matrix
|
||||
(pkgs.callPackage <niveum/packages/weechatScripts/hotlist2extern.nix> {})
|
||||
];
|
||||
settings = let
|
||||
nick = "kmein";
|
||||
@@ -108,13 +106,6 @@ in {
|
||||
};
|
||||
};
|
||||
logger.level.irc.news = 0;
|
||||
plugins.var.perl.hotlist2extern = {
|
||||
external_command_hotlist = "echo %X > ${weechatHome}/hotlist.txt";
|
||||
external_command_hotlist_empty = "echo -n %X > ${weechatHome}/hotlist.txt";
|
||||
lowest_priority = "2";
|
||||
use_title = "off";
|
||||
delimiter = ",";
|
||||
};
|
||||
matrix.server.nibbana = {
|
||||
address = "nibbana.jp";
|
||||
username = nick;
|
||||
@@ -172,7 +163,7 @@ in {
|
||||
wantedBy = ["multi-user.target"];
|
||||
restartIfChanged = true;
|
||||
path = [pkgs.alacritty.terminfo];
|
||||
environment.WEECHAT_HOME = weechatHome;
|
||||
environment.WEECHAT_HOME = "/var/lib/weechat";
|
||||
preStart = "${pkgs.coreutils}/bin/rm $WEECHAT_HOME/*.conf";
|
||||
script = "${tmux} -2 new-session -d -s IM ${weechat}/bin/weechat";
|
||||
preStop = "${tmux} kill-session -t IM";
|
||||
|
||||
Reference in New Issue
Block a user