1
0
mirror of https://github.com/kmein/niveum synced 2026-03-23 21:21:08 +01:00

25 Commits

Author SHA1 Message Date
d751ecdab7 feat: add grimm dwb scroller 2022-09-08 08:47:11 +02:00
2280b21a75 feat: automate entering ssh passphrase 2022-09-08 08:46:53 +02:00
de34cb6d66 fix: downgrade nixpkgs unstable 2022-09-06 08:54:38 +02:00
3d6b34572d fix(scanned) 2022-09-05 15:38:59 +02:00
ce0869c64b fix(rofi-pass): user is in login field 2022-09-05 15:38:49 +02:00
a589332b42 feat(urlwatch): 2022 c3 2022-09-02 15:13:05 +02:00
5a6b32e0b4 Merge remote-tracking branch 'origin/update_flake_lock_action' 2022-08-31 21:13:28 +02:00
6cf3072609 fix(i3status-rust): offline behaviour 2022-08-30 19:33:07 +02:00
4fe122f06c feat(telegram-bots): start at random time 2022-08-30 19:32:49 +02:00
4fa6a62966 feat: sxiv -> nsxiv 2022-08-30 19:32:27 +02:00
github-actions[bot]
dbdc876375 flake.lock: Update
Flake lock file updates:

• Updated input 'home-manager':
    'github:nix-community/home-manager/0160a0cef076294127f8cc0750019410ab94370d' (2022-08-22)
  → 'github:nix-community/home-manager/d89bdff445eadff03fe414e9c30486bc8166b72b' (2022-08-27)
• Updated input 'nixos-stable':
    'github:NixOS/nixpkgs/52527082ea267fe486f0648582d57c85486b2031' (2022-08-22)
  → 'github:NixOS/nixpkgs/f11e12ac6af528c1ba12426ce83cee26f21ceafd' (2022-08-26)
• Updated input 'nixos-unstable':
    'github:NixOS/nixpkgs/c4a0efdd5a728e20791b8d8d2f26f90ac228ee8d' (2022-08-12)
  → 'github:NixOS/nixpkgs/f3d0897be466aa09a37f6bf59e62c360c3f9a6cc' (2022-08-25)
2022-08-28 01:01:59 +00:00
eb79f88c59 feat(i3status-rust): show number of hot weechat buffers 2022-08-23 21:44:39 +02:00
8384363dcb fix: downgrade nixpkgs unstable
coreutils gets built manually and electrum fails otherwise
2022-08-23 20:27:41 +02:00
797e53db7a feat: nom nom nom 2022-08-23 19:02:34 +02:00
426a82dff9 chore: update 2022-08-23 15:02:55 +02:00
7264fce03c feat(telegram-bots): add smyth 2022-08-23 14:47:24 +02:00
b332784140 fix(ci): add shared secret 2022-08-22 10:36:32 +02:00
ed51858a67 feat(i3status-rust): time interval 1s 2022-08-22 10:30:29 +02:00
ba13cd24a1 feat(fonts): noto sans cjk 2022-08-22 10:30:15 +02:00
8331d11a50 feat(i3status-rust): make email state depend on which account the unseen messages are 2022-08-22 10:30:02 +02:00
79e14bfbc2 feat(i3status-rust): todo empty if none due 2022-08-22 10:29:04 +02:00
eed0d0b2af feat(i3status-rust): add github block 2022-08-22 10:28:48 +02:00
5930340a05 feat(i3status-rust): hide todo and vpn when empty 2022-08-22 10:28:06 +02:00
a5f6a46262 feat(neomutt): set dark/light friendly subject colour 2022-08-22 10:27:33 +02:00
4eea890efc fix(i3-status-rust): newsboat updating icon 2022-08-21 10:09:19 +02:00
23 changed files with 232 additions and 54 deletions

1
ci.nix
View File

@@ -37,6 +37,7 @@
"di.fm/key" "di.fm/key"
"eduroam/identity" "eduroam/identity"
"eduroam/password" "eduroam/password"
"github/notification.token"
"hass/token" "hass/token"
"mail/cock" "mail/cock"
"mail/fastmail" "mail/fastmail"

View File

@@ -30,6 +30,12 @@ in {
tocharian-font = pkgs.callPackage <niveum/packages/tocharian-font.nix> {}; tocharian-font = pkgs.callPackage <niveum/packages/tocharian-font.nix> {};
iolanguage = pkgs.callPackage <niveum/packages/iolanguage.nix> {}; iolanguage = pkgs.callPackage <niveum/packages/iolanguage.nix> {};
ix = pkgs.callPackage <niveum/packages/ix.nix> {}; ix = pkgs.callPackage <niveum/packages/ix.nix> {};
rofi-pass = pkgs.rofi-pass.overrideAttrs (final: previous: {
patches = [
# password store androi
<niveum/packages/rofi-pass.patch>
];
});
}; };
}; };
overlays = [ overlays = [
@@ -138,7 +144,7 @@ in {
cdt = "source ${cdt}"; cdt = "source ${cdt}";
vit = "$EDITOR $(mktemp)"; vit = "$EDITOR $(mktemp)";
tmux = "${pkgs.tmux}/bin/tmux -2"; tmux = "${pkgs.tmux}/bin/tmux -2";
sxiv = swallow "${pkgs.sxiv}/bin/sxiv"; sxiv = swallow "${pkgs.nsxiv}/bin/nsxiv";
zathura = swallow "${pkgs.zathura}/bin/zathura"; zathura = swallow "${pkgs.zathura}/bin/zathura";
us = "${pkgs.systemd}/bin/systemctl --user"; us = "${pkgs.systemd}/bin/systemctl --user";
wcd = "source ${wcd}"; wcd = "source ${wcd}";
@@ -264,7 +270,7 @@ in {
./ssh.nix ./ssh.nix
./sshd.nix ./sshd.nix
./sudo.nix ./sudo.nix
./sxiv.nix ./nsxiv.nix
./themes.nix ./themes.nix
./tmux.nix ./tmux.nix
./traadfri.nix ./traadfri.nix

View File

@@ -31,6 +31,7 @@
roboto roboto
roboto-mono roboto-mono
noto-fonts noto-fonts
noto-fonts-cjk
noto-fonts-emoji noto-fonts-emoji
roboto-slab roboto-slab
scheherazade-new scheherazade-new
@@ -46,7 +47,7 @@
fontconfig.defaultFonts = { fontconfig.defaultFonts = {
monospace = ["Noto Sans Mono"]; monospace = ["Noto Sans Mono"];
serif = ["Noto Serif" "Noto Naskh Arabic" "Noto Serif Devanagari"]; serif = ["Noto Serif" "Noto Naskh Arabic" "Noto Serif Devanagari"];
sansSerif = ["Noto Sans Display" "Noto Kufi Arabic" "Noto Sans Devanagari"]; sansSerif = ["Noto Sans Display" "Noto Kufi Arabic" "Noto Sans Devanagari" "Noto Sans CJK JP"];
emoji = ["Noto Color Emoji" "Noto Emoji"]; emoji = ["Noto Color Emoji" "Noto Emoji"];
}; };
}; };

View File

@@ -167,7 +167,7 @@ in {
text = colours.foreground; text = colours.foreground;
}; };
}; };
statusCommand = "${pkgs.i3status-rust}/bin/i3status-rs ${ statusCommand = "env I3RS_GITHUB_TOKEN=${lib.strings.fileContents <secrets/github/notification.token>} ${pkgs.i3status-rust}/bin/i3status-rs ${
(pkgs.formats.toml {}).generate "i3status-rust.toml" (import <niveum/lib/i3status-rust.nix> { (pkgs.formats.toml {}).generate "i3status-rust.toml" (import <niveum/lib/i3status-rust.nix> {
inherit (config.niveum) batteryName wirelessInterface; inherit (config.niveum) batteryName wirelessInterface;
inherit colours; inherit colours;

View File

@@ -7,8 +7,8 @@
"application/pdf" = "org.pwmt.zathura.desktop"; "application/pdf" = "org.pwmt.zathura.desktop";
"application/vnd.oasis.opendocument.text" = "writer.desktop"; "application/vnd.oasis.opendocument.text" = "writer.desktop";
"application/vnd.openxmlformats-officedocument.wordprocessingml.document" = "writer.desktop"; "application/vnd.openxmlformats-officedocument.wordprocessingml.document" = "writer.desktop";
"image/jpeg" = "sxiv.desktop"; "image/jpeg" = "nsxiv.desktop";
"image/png" = "sxiv.desktop"; "image/png" = "nsxiv.desktop";
"image/vnd.djvu+multipage" = "org.pwmt.zathura.desktop"; "image/vnd.djvu+multipage" = "org.pwmt.zathura.desktop";
"text/html" = "brave-browser.desktop"; "text/html" = "brave-browser.desktop";
"text/markdown" = "nvim.desktop"; "text/markdown" = "nvim.desktop";

View File

@@ -25,7 +25,7 @@ in {
pkgs.writeText "mailcap" '' pkgs.writeText "mailcap" ''
text/plain; $EDITOR %s ; text/plain; $EDITOR %s ;
text/html; ${pkgs.lynx}/bin/lynx -assume_charset=%{charset} -display_charset=utf-8 -dump %s; nametemplate=%s.html; copiousoutput; text/html; ${pkgs.lynx}/bin/lynx -assume_charset=%{charset} -display_charset=utf-8 -dump %s; nametemplate=%s.html; copiousoutput;
image/*; ${pkgs.sxiv}/bin/sxiv %s ; image/*; ${pkgs.nsxiv}/bin/nsxiv %s ;
video/*; ${pkgs.utillinux}/bin/setsid ${pkgs.mpv}/bin/mpv --quiet %s &; copiousoutput video/*; ${pkgs.utillinux}/bin/setsid ${pkgs.mpv}/bin/mpv --quiet %s &; copiousoutput
audio/*; ${pkgs.mpv}/bin/mpv %s ; audio/*; ${pkgs.mpv}/bin/mpv %s ;
application/pdf; ${pkgs.zathura}/bin/zathura %s ; application/pdf; ${pkgs.zathura}/bin/zathura %s ;
@@ -115,7 +115,7 @@ in {
color index red default '.*' color index red default '.*'
color index_flags lightcyan default '.*' color index_flags lightcyan default '.*'
color index_author yellow default '.*' color index_author yellow default '.*'
color index_subject white default '.*' color index_subject default default '.*'
# New mail is boldened: # New mail is boldened:
color index_author lightyellow default "~N" color index_author lightyellow default "~N"

View File

@@ -75,7 +75,7 @@ in {
pkgs.newsboat pkgs.newsboat
(pkgs.writers.writeDashBin "newsboat-unread-count" '' (pkgs.writers.writeDashBin "newsboat-unread-count" ''
if [ -f ${newsboat-home}/cache.db.lock ]; then if [ -f ${newsboat-home}/cache.db.lock ]; then
${pkgs.jq}/bin/jq -n '{state: "Info", text: "", icon: "update"}' ${pkgs.jq}/bin/jq -n '{state: "Info", text: "", icon: "rss"}'
else else
${pkgs.jq}/bin/jq -n \ ${pkgs.jq}/bin/jq -n \

View File

@@ -15,10 +15,10 @@
cf ''${XDG_CONFIG_HOME:-$HOME/.config} cf ''${XDG_CONFIG_HOME:-$HOME/.config}
''; '';
in { in {
environment.systemPackages = [pkgs.sxiv]; environment.systemPackages = [pkgs.nsxiv];
# TODO fix # TODO fix
home-manager.users.me.xdg.configFile."sxiv/exec/key-handler".source = pkgs.writers.writeDash "key-handler" '' home-manager.users.me.xdg.configFile."nsxiv/exec/key-handler".source = pkgs.writers.writeDash "key-handler" ''
PATH=$PATH:${ PATH=$PATH:${
lib.makeBinPath [ lib.makeBinPath [
pkgs.gnused pkgs.gnused

View File

@@ -7,8 +7,16 @@
inherit (import <niveum/lib>) sshPort kieran; inherit (import <niveum/lib>) sshPort kieran;
externalNetwork = import <niveum/lib/external-network.nix>; externalNetwork = import <niveum/lib/external-network.nix>;
sshIdentity = name: "${config.users.users.me.home}/.ssh/${name}"; sshIdentity = name: "${config.users.users.me.home}/.ssh/${name}";
ssh-passphease = lib.strings.fileContents <system-secrets/ssh/passphrase>;
in { in {
services.xserver.displayManager.sessionCommands = "${pkgs.openssh}/bin/ssh-add"; services.xserver.displayManager.sessionCommands = toString (pkgs.writeScript "ssh-add" ''
#!${pkgs.expect}/bin/expect -f
spawn ${pkgs.openssh}/bin/ssh-add
expect "Enter passphrase for *:"
send "${ssh-passphrase}\n";
expect "Identity added: *"
interact
'');
programs.ssh.startAgent = true; programs.ssh.startAgent = true;

View File

@@ -19,6 +19,7 @@ in {
./astrology.nix ./astrology.nix
./autorenkalender.nix ./autorenkalender.nix
./hesychius.nix ./hesychius.nix
./smyth.nix
./nachtischsatan.nix ./nachtischsatan.nix
./tlg-wotd.nix ./tlg-wotd.nix
<niveum/modules/telegram-bot.nix> <niveum/modules/telegram-bot.nix>

View File

@@ -13,6 +13,8 @@ in {
command = "${pkgs.coreutils}/bin/shuf -n1 ${hesychius}"; command = "${pkgs.coreutils}/bin/shuf -n1 ${hesychius}";
}; };
systemd.timers.telegram-bot-hesychius.timerConfig.RandomizedDelaySec = "10h";
niveum.passport.services = [ niveum.passport.services = [
{ {
title = "Hesychius of Alexandria Bot"; title = "Hesychius of Alexandria Bot";

View File

@@ -0,0 +1,37 @@
{
pkgs,
lib,
...
}: {
niveum.telegramBots.smyth = {
enable = true;
time = "06/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
'');
};
systemd.timers.telegram-bot-smyth.timerConfig.RandomizedDelaySec = "3h";
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
View File

@@ -23,11 +23,11 @@
"utils": "utils" "utils": "utils"
}, },
"locked": { "locked": {
"lastModified": 1660330190, "lastModified": 1661573386,
"narHash": "sha256-RgQUtZGmdb9fRkdBcI8x1KYuykbQCBaeY6ejFls7hFM=", "narHash": "sha256-pBEg8iY00Af/SAtU2dlmOAv+2x7kScaGlFRDjNoVJO8=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "8675cfa549e1240c9d2abb1c878bc427eefcf926", "rev": "d89bdff445eadff03fe414e9c30486bc8166b72b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -47,15 +47,15 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1644957911, "lastModified": 1661273257,
"narHash": "sha256-ggie/j7pdBqzDs4W7OiPmhqH9IGbXAbJxGqBdVxA8jA=", "narHash": "sha256-cywpSH3D291AwdO/ecJxHeN2Vuuz0cIy/NEXMsFT+Og=",
"owner": "Mic92", "owner": "kmein",
"repo": "krops", "repo": "krops",
"rev": "86fb3d2ee94fd8306231853b323ed8804edf26ec", "rev": "542bc544ec8b0b807933a812d098e601683b0956",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "Mic92", "owner": "kmein",
"repo": "krops", "repo": "krops",
"type": "github" "type": "github"
} }
@@ -110,11 +110,11 @@
}, },
"nixos-stable": { "nixos-stable": {
"locked": { "locked": {
"lastModified": 1660318005, "lastModified": 1661520432,
"narHash": "sha256-g9WCa9lVUmOV6dYRbEPjv/TLOR5hamjeCcKExVGS3OQ=", "narHash": "sha256-9z+WDeXiu3hobvSsL0SbHDx4s+kFmm8eussySuX4zCM=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "5c211b47aeadcc178c5320afd4e74c7eed5c389f", "rev": "f11e12ac6af528c1ba12426ce83cee26f21ceafd",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -195,11 +195,11 @@
"scripts": { "scripts": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1658436738, "lastModified": 1662493500,
"narHash": "sha256-y075C4CE543ZdKPl1Byz8EPn67jbA59Z0bIsixNFsso=", "narHash": "sha256-EdAEKDQ6z7oinqQ28ELE3+taJ106DgmhNJt/rpqHJic=",
"owner": "kmein", "owner": "kmein",
"repo": "scripts", "repo": "scripts",
"rev": "d5a38cf84e3f528641b1b10d9f33cf8bfcd5a52a", "rev": "51c641ac3c1100d80313696663db70c2eb3698dc",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -211,11 +211,11 @@
"stockholm": { "stockholm": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1660135264, "lastModified": 1661246925,
"narHash": "sha256-F2L0osJCjmqkXddDVSBdBanq06XUBQoKXPf4iRJUKYA=", "narHash": "sha256-hGNCF4m3SuVogqoipmJzNIKoh03S/SMnO5oMHgfHWjA=",
"ref": "refs/heads/master", "ref": "refs/heads/master",
"rev": "7ce87f5fdb602de7638b2df237e891e6038907ac", "rev": "d1fa957ed5bf60767c83c96135f9142f6c96ea50",
"revCount": 10727, "revCount": 10749,
"type": "git", "type": "git",
"url": "https://cgit.lassul.us/stockholm" "url": "https://cgit.lassul.us/stockholm"
}, },

View File

@@ -11,7 +11,7 @@
inputs.nixpkgs.follows = "nixos-unstable"; inputs.nixpkgs.follows = "nixos-unstable";
}; };
krops = { krops = {
url = "github:Mic92/krops"; url = "github:kmein/krops";
inputs.nixpkgs.follows = "nixos-stable"; inputs.nixpkgs.follows = "nixos-stable";
inputs.flake-utils.follows = "flake-utils"; inputs.flake-utils.follows = "flake-utils";
}; };
@@ -152,6 +152,7 @@
toString (krops.packages.${system}.writeDeploy "deploy-${name}" { toString (krops.packages.${system}.writeDeploy "deploy-${name}" {
source = krops.lib.evalSource [(source {inherit sources unstable name;})]; source = krops.lib.evalSource [(source {inherit sources unstable name;})];
target = "${user}@${host}:${toString sshPort}"; target = "${user}@${host}:${toString sshPort}";
useNixOutputMonitor = true;
}); });
in { in {
apps.${system} = let apps.${system} = let

View File

@@ -35,6 +35,8 @@ in {
}; };
icons.name = "awesome6"; icons.name = "awesome6";
icons.overrides.rss = ""; icons.overrides.rss = "";
icons.overrides.vpn = "";
icons.overrides.irc = "";
block = [ block = [
{ {
block = "weather"; block = "weather";
@@ -70,6 +72,11 @@ in {
print("{} {} {}{}".format(sun["sunrise"].strftime("%R"), sun["sunset"].strftime("%R"), "" if current_phase < 14 else "", round(current_phase, 1))) 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"; block = "custom";
interval = 10; interval = 10;
@@ -86,7 +93,7 @@ in {
| (map(select(.due >= now and .due < now + (60 * 60 * 24))) | length) as $dueToday | (map(select(.due >= now and .due < now + (60 * 60 * 24))) | length) as $dueToday
| { | {
icon: "tasks", icon: "tasks",
text: ($overdue + $dueToday) | tostring, text: (($overdue + $dueToday) as $sum | if $sum > 0 then $sum | tostring else "" end),
state: ( state: (
if $overdue > 0 then if $overdue > 0 then
"Critical" "Critical"
@@ -100,27 +107,30 @@ in {
' '
''; '';
json = true; json = true;
hide_when_empty = true;
} }
{ {
block = "custom"; block = "custom";
interval = 60 * 5; interval = 60 * 5;
command = let command = let
query-account = account: query-account = name: account: "${pkgs.writers.writeDash "query-imap-${name}" ''
pkgs.writers.writeDash "query-imap" '' ${pkgs.coreutils}/bin/timeout 1 ${pkgs.curl}/bin/curl -sSL -u ${lib.escapeShellArg "${account.user}:${account.password}"} imaps://${account.imap} -X 'STATUS INBOX (UNSEEN)' \
${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]+' \
| ${pkgs.gnugrep}/bin/grep -Eo '[0-9]+' | sed 's/^/{"${name}":/;s/$/}/'
''; ''} &";
in in
pkgs.writers.writeDash "unread-mail" '' pkgs.writers.writeDash "unread-mail" ''
{ {
${lib.concatMapStringsSep "\n" query-account (builtins.attrValues accounts)} ${lib.concatStringsSep "\n" (lib.mapAttrsToList query-account accounts)}
} | jq -s ' wait
(. | add) as $sum } | jq -s 'if length == 0 then {text: "", icon: "mail", state: "Idle"} else
add
| (values | add) as $sum
| { | {
text: $sum | tostring, text: (if $sum > 0 then $sum | tostring else "" end),
icon: "mail", icon: "mail",
state: ( state: (
if $sum > 5 then if .uni > 0 or .["work-uni"] > 0 or .posteo > 0 then
"Warning" "Warning"
elif $sum > 0 then elif $sum > 0 then
"Info" "Info"
@@ -128,19 +138,35 @@ in {
"Idle" "Idle"
end end
) )
}' } end'
''; '';
json = true; json = true;
hide_when_empty = true;
}
{
block = "custom";
interval = 60;
command = pkgs.writers.writeDash "weechat" ''
ssh -o ConnectTimeout=1 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"; block = "custom";
interval = 5; interval = 5;
command = pkgs.writers.writeDash "hu-berlin-vpn" '' command = pkgs.writers.writeDash "hu-berlin-vpn" ''
PATH=${lib.makeBinPath [pkgs.systemd]} PATH=${lib.makeBinPath [pkgs.systemd]}
(systemctl is-active --quiet openvpn-hu-berlin.service && echo "OVPN") \ (systemctl is-active --quiet openvpn-hu-berlin.service && echo '{"state": "Good", "text": "OpenVPN", "icon": "vpn"}') \
|| (systemctl is-active --quiet hu-vpn.service && echo "PPP-VPN") \ || (systemctl is-active --quiet hu-vpn.service && echo '{"state": "Good", "text": "PPP+SSL", "icon": "vpn"}') \
|| : || echo '{"state": "Idle", "icon": "vpn", "text": ""}'
''; '';
json = true;
hide_when_empty = true;
} }
{ {
block = "net"; block = "net";
@@ -168,7 +194,7 @@ in {
{block = "load";} {block = "load";}
{ {
block = "custom"; block = "custom";
interval = 10; interval = 1;
json = true; json = true;
command = pkgs.writers.writeDash "time" '' command = pkgs.writers.writeDash "time" ''
${pkgs.jq}/bin/jq -n \ ${pkgs.jq}/bin/jq -n \

12
packages/rofi-pass.patch Normal file
View File

@@ -0,0 +1,12 @@
diff --git a/rofi-pass b/rofi-pass
index 48928db..13682a5 100755
--- a/rofi-pass
+++ b/rofi-pass
@@ -15,7 +15,7 @@ _image_viewer () {
# We expect to find these fields in pass(1)'s output
URL_field='url'
-USERNAME_field='user'
+USERNAME_field='login'
AUTOTYPE_field='autotype'
OTPmethod_field='otp_method'

View File

@@ -96,7 +96,7 @@ in
rm "$file" rm "$file"
} }
${pkgs.qrencode}/bin/qrencode "$(${pkgs.xclip}/bin/xclip -selection clipboard -out)" -o "$file" ${pkgs.qrencode}/bin/qrencode "$(${pkgs.xclip}/bin/xclip -selection clipboard -out)" -o "$file"
${pkgs.sxiv}/bin/sxiv "$file" ${pkgs.nsxiv}/bin/nsxiv "$file"
''; '';
ttspaste = pkgs.writers.writeDashBin "ttspaste" '' ttspaste = pkgs.writers.writeDashBin "ttspaste" ''
@@ -123,7 +123,7 @@ in
}; };
meteo = wrapScript { meteo = wrapScript {
packages = [pkgs.jq pkgs.curl pkgs.xdotool pkgs.sxiv pkgs.gnused]; packages = [pkgs.jq pkgs.curl pkgs.xdotool pkgs.nsxiv pkgs.gnused];
script = ./meteo.sh; script = ./meteo.sh;
name = "meteo"; name = "meteo";
}; };
@@ -433,7 +433,7 @@ in
scanned = pkgs.writers.writeDashBin "scanned" '' scanned = pkgs.writers.writeDashBin "scanned" ''
[ $# -eq 1 -a -f "$1" -a -r "$1" ] || exit 1 [ $# -eq 1 -a -f "$1" -a -r "$1" ] || exit 1
${pkgs.imagemagick}/bin/convert -density 150 "$1" -colorspace gray -linear-stretch 3.5%x10% -blur 0x0.5 -attenuate 0.25 +noise Gaussian "scanned-$1" ${pkgs.imagemagick}/bin/convert -density 150 "$1" -rotate 0.5 -attenuate 0.25 +noise Multiplicative -colorspace Gray "scanned-$1"
''; '';
nix-index-update = pkgs.writers.writeDashBin "nix-index-update" '' nix-index-update = pkgs.writers.writeDashBin "nix-index-update" ''

View File

@@ -69,8 +69,8 @@ curl -sSL \
"http://wetterstationen.meteomedia.de/messnetz/vorhersagegrafik/$station.png" \ "http://wetterstationen.meteomedia.de/messnetz/vorhersagegrafik/$station.png" \
-o "$cache" -o "$cache"
if window_id=$(xdotool search --name "^sxiv - $cache$"); then if window_id=$(xdotool search --name "^nsxiv - $cache$"); then
xdotool key --window "$window_id" r xdotool key --window "$window_id" r
else else
sxiv "$cache" & nsxiv "$cache" &
fi fi

View File

@@ -0,0 +1,33 @@
{
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];
};
}

View File

@@ -17,6 +17,7 @@ in {
./monitoring ./monitoring
./moodle-dl-borsfaye.nix ./moodle-dl-borsfaye.nix
./names.nix ./names.nix
./grimm.nix
./nextcloud.nix ./nextcloud.nix
./radio-news.nix ./radio-news.nix
./radio.nix ./radio.nix
@@ -103,5 +104,11 @@ in {
defaults.email = kieran.email; defaults.email = kieran.email;
}; };
environment.systemPackages = [pkgs.vim pkgs.git pkgs.tmux pkgs.python3]; environment.systemPackages = [
pkgs.vim
pkgs.git
pkgs.tmux
pkgs.python3
pkgs.nix-output-monitor
];
} }

30
systems/makanek/grimm.nix Normal file
View File

@@ -0,0 +1,30 @@
{pkgs, ...}: let
port = 9610;
web-socket-sink-src = "${<scripts>}/grimm-scroller";
web-socket-sink = pkgs.callPackage web-socket-sink-src {};
lemmata = "${web-socket-sink-src}/dwb-compact.json";
in {
systemd.services.grimm-ws = {
wantedBy = ["multi-user.target"];
script = "${web-socket-sink}/bin/web-socket-sink --host 0.0.0.0 --port ${toString port} < ${lemmata}";
serviceConfig = {
Restart = "always";
DynamicUser = true;
};
};
services.nginx.virtualHosts."grimm.kmein.de" = {
enableACME = false;
forceSSL = false;
locations = {
"/".root = pkgs.linkFarm "grimm" [
{
name = "index.html";
path = "${web-socket-sink-src}/wclient.html";
}
];
};
};
networking.firewall.allowedTCPPorts = [port];
}

View File

@@ -114,6 +114,10 @@
url = "https://www.deutschlandfunk.de/meine-nacht-schlaeft-nicht-pflanze-mich-nicht-in-dein-herz.700.de.html?dram:article_id=486475"; url = "https://www.deutschlandfunk.de/meine-nacht-schlaeft-nicht-pflanze-mich-nicht-in-dein-herz.700.de.html?dram:article_id=486475";
filter = [{element-by-class = "dlf-articledetail";} "html2text" "strip"]; filter = [{element-by-class = "dlf-articledetail";} "html2text" "strip"];
} }
{
name = "Ist der Congress schon abgesagt?";
url = "https://ist-der-congress-schon-abgesagt.de/";
}
{ {
name = "fxght.or.flxght"; name = "fxght.or.flxght";
url = "https://api.tellonym.me/profiles/name/fxght.or.flxght?limit=20"; url = "https://api.tellonym.me/profiles/name/fxght.or.flxght?limit=20";

View File

@@ -5,6 +5,7 @@
}: let }: let
inherit (import <niveum/lib>) kieran; inherit (import <niveum/lib>) kieran;
relayPassword = lib.fileContents <system-secrets/weechat/relay>; relayPassword = lib.fileContents <system-secrets/weechat/relay>;
weechatHome = "/var/lib/weechat";
in { in {
systemd.services.weechat = let systemd.services.weechat = let
tmux = pkgs.writers.writeDash "tmux" '' tmux = pkgs.writers.writeDash "tmux" ''
@@ -31,6 +32,7 @@ in {
pkgs.weechatScripts.weechat-autosort pkgs.weechatScripts.weechat-autosort
pkgs.weechatScripts.colorize_nicks pkgs.weechatScripts.colorize_nicks
pkgs.weechatScripts.weechat-matrix pkgs.weechatScripts.weechat-matrix
(pkgs.callPackage <niveum/packages/weechatScripts/hotlist2extern.nix> {})
]; ];
settings = let settings = let
nick = "kmein"; nick = "kmein";
@@ -106,6 +108,13 @@ in {
}; };
}; };
logger.level.irc.news = 0; 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 = { matrix.server.nibbana = {
address = "nibbana.jp"; address = "nibbana.jp";
username = nick; username = nick;
@@ -163,7 +172,7 @@ in {
wantedBy = ["multi-user.target"]; wantedBy = ["multi-user.target"];
restartIfChanged = true; restartIfChanged = true;
path = [pkgs.alacritty.terminfo]; path = [pkgs.alacritty.terminfo];
environment.WEECHAT_HOME = "/var/lib/weechat"; environment.WEECHAT_HOME = weechatHome;
preStart = "${pkgs.coreutils}/bin/rm $WEECHAT_HOME/*.conf"; preStart = "${pkgs.coreutils}/bin/rm $WEECHAT_HOME/*.conf";
script = "${tmux} -2 new-session -d -s IM ${weechat}/bin/weechat"; script = "${tmux} -2 new-session -d -s IM ${weechat}/bin/weechat";
preStop = "${tmux} kill-session -t IM"; preStop = "${tmux} kill-session -t IM";