mirror of
https://github.com/kmein/niveum
synced 2026-03-26 06:11:07 +01:00
Compare commits
3 Commits
426a82dff9
...
eb79f88c59
| Author | SHA1 | Date | |
|---|---|---|---|
| eb79f88c59 | |||
| 8384363dcb | |||
| 797e53db7a |
16
flake.lock
generated
16
flake.lock
generated
@@ -47,15 +47,15 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1644957911,
|
||||
"narHash": "sha256-ggie/j7pdBqzDs4W7OiPmhqH9IGbXAbJxGqBdVxA8jA=",
|
||||
"owner": "Mic92",
|
||||
"lastModified": 1661273257,
|
||||
"narHash": "sha256-cywpSH3D291AwdO/ecJxHeN2Vuuz0cIy/NEXMsFT+Og=",
|
||||
"owner": "kmein",
|
||||
"repo": "krops",
|
||||
"rev": "86fb3d2ee94fd8306231853b323ed8804edf26ec",
|
||||
"rev": "542bc544ec8b0b807933a812d098e601683b0956",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "Mic92",
|
||||
"owner": "kmein",
|
||||
"repo": "krops",
|
||||
"type": "github"
|
||||
}
|
||||
@@ -126,11 +126,11 @@
|
||||
},
|
||||
"nixos-unstable": {
|
||||
"locked": {
|
||||
"lastModified": 1661088761,
|
||||
"narHash": "sha256-5DGKX81wIPAAiLwUmUYECpA3vop94AHHR7WmGXSsQok=",
|
||||
"lastModified": 1660305968,
|
||||
"narHash": "sha256-r0X1pZCSEA6mzt5OuTA7nHuLmvnbkwgpFAh1iLIx4GU=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "a7855f2235a1876f97473a76151fec2afa02b287",
|
||||
"rev": "c4a0efdd5a728e20791b8d8d2f26f90ac228ee8d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
inputs.nixpkgs.follows = "nixos-unstable";
|
||||
};
|
||||
krops = {
|
||||
url = "github:Mic92/krops";
|
||||
url = "github:kmein/krops";
|
||||
inputs.nixpkgs.follows = "nixos-stable";
|
||||
inputs.flake-utils.follows = "flake-utils";
|
||||
};
|
||||
@@ -152,6 +152,7 @@
|
||||
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
|
||||
|
||||
@@ -36,6 +36,7 @@ in {
|
||||
icons.name = "awesome6";
|
||||
icons.overrides.rss = "";
|
||||
icons.overrides.vpn = "";
|
||||
icons.overrides.irc = "";
|
||||
block = [
|
||||
{
|
||||
block = "weather";
|
||||
@@ -142,6 +143,19 @@ 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;
|
||||
|
||||
33
packages/weechatScripts/hotlist2extern.nix
Normal file
33
packages/weechatScripts/hotlist2extern.nix
Normal 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];
|
||||
};
|
||||
}
|
||||
@@ -103,5 +103,11 @@ in {
|
||||
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
|
||||
];
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
}: 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" ''
|
||||
@@ -31,6 +32,7 @@ in {
|
||||
pkgs.weechatScripts.weechat-autosort
|
||||
pkgs.weechatScripts.colorize_nicks
|
||||
pkgs.weechatScripts.weechat-matrix
|
||||
(pkgs.callPackage <niveum/packages/weechatScripts/hotlist2extern.nix> {})
|
||||
];
|
||||
settings = let
|
||||
nick = "kmein";
|
||||
@@ -106,6 +108,13 @@ 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;
|
||||
@@ -163,7 +172,7 @@ in {
|
||||
wantedBy = ["multi-user.target"];
|
||||
restartIfChanged = true;
|
||||
path = [pkgs.alacritty.terminfo];
|
||||
environment.WEECHAT_HOME = "/var/lib/weechat";
|
||||
environment.WEECHAT_HOME = weechatHome;
|
||||
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