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

5 Commits

Author SHA1 Message Date
2565bfbc27 feat(streams): explore more 2022-03-13 11:17:28 +01:00
a4d002e293 chore: format 2022-03-13 10:31:19 +01:00
730070bc9d feat: rofi-hass 2022-03-13 10:30:42 +01:00
6f1f1887b9 feat(pass): install import and genphrase extensions, kill bitwarden 2022-03-13 10:29:50 +01:00
github-actions[bot]
68f8bb06f4 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/47cd6702934434dd02bc53a67dbce3e5493e33a2' (2022-03-04)
  → 'github:NixOS/nixpkgs/bacbfd713b4781a4a82c1f390f8fe21ae3b8b95b' (2022-03-10)
• Updated input 'nixpkgs-unstable':
    'github:NixOS/nixpkgs/a173e92ee458878651356b9bcfb1e2b5145f76af' (2022-03-05)
  → 'github:NixOS/nixpkgs/b783c48432cdfc35224a39bd95666daa62fef126' (2022-03-13)
• Updated input 'retiolum':
    'github:krebs/retiolum/259d60325310b728f79c68dc1148f597e097d1b2' (2022-02-28)
  → 'github:krebs/retiolum/e488402be7f60a478c95a4bad6d6e2c67f2b55f9' (2022-03-10)
• Updated input 'stockholm':
    'git+https://cgit.lassul.us/stockholm?ref=master&rev=87a44dd1573cbdc8f0fc3553b0896b470bcfa44d' (2022-03-03)
  → 'git+https://cgit.lassul.us/stockholm?ref=master&rev=2dc05dbafbd5490be6a9754a55679a6576efbad1' (2022-03-11)
2022-03-13 00:38:35 +00:00
15 changed files with 255 additions and 167 deletions

56
ci.nix
View File

@@ -19,12 +19,12 @@
}
'';
nixPath = nixpkgs.lib.concatStringsSep ":" ([
"niveum=${toString ./.}"
"nixos-config=${toString ./.}/systems/${name}/configuration.nix"
"system-secrets=${systemSecrets}"
"secrets=${sharedSecrets}"
]
++ nixpkgs.lib.mapAttrsToList (name: value: "${name}=${value}") inputs);
"niveum=${toString ./.}"
"nixos-config=${toString ./.}/systems/${name}/configuration.nix"
"system-secrets=${systemSecrets}"
"secrets=${sharedSecrets}"
]
++ nixpkgs.lib.mapAttrsToList (name: value: "${name}=${value}") inputs);
# cd ~/.password-store/shared && find * -type f | sed 's/.gpg$//'
sharedSecrets = ensureFiles [
"di.fm/key"
@@ -54,28 +54,28 @@
kabsa = ensureFiles basic;
manakish = ensureFiles basic;
makanek = ensureFiles ([
"irc/retiolum"
"irc/hackint"
"irc/libera"
"irc/oftc"
"matrix/nibbana"
"maxmind/license.key"
"moodle-dl/faye.token"
"nextcloud/admin"
"nextcloud/database"
"telegram/nachtischsatan.token"
"telegram/reverse.token"
"telegram/odyssey.token"
"telegram/betacode.token"
"telegram/moodle-dl.token"
"telegram/proverb.token"
"telegram/menstruation.token"
"telegram/cool_village.token"
"telegram/kmein.token"
"telegram/prometheus.token"
"weechat/relay"
]
++ basic);
"irc/retiolum"
"irc/hackint"
"irc/libera"
"irc/oftc"
"matrix/nibbana"
"maxmind/license.key"
"moodle-dl/faye.token"
"nextcloud/admin"
"nextcloud/database"
"telegram/nachtischsatan.token"
"telegram/reverse.token"
"telegram/odyssey.token"
"telegram/betacode.token"
"telegram/moodle-dl.token"
"telegram/proverb.token"
"telegram/menstruation.token"
"telegram/cool_village.token"
"telegram/kmein.token"
"telegram/prometheus.token"
"weechat/relay"
]
++ basic);
}
.${name};
in

View File

@@ -2,7 +2,7 @@
programs.chromium = {
enable = true;
extensions = [
"nngceckbapebfimnlniiiahkandclblb" # BitWarden
# "nngceckbapebfimnlniiiahkandclblb" # BitWarden
# "ihlenndgcmojhcghmfjfneahoeklbjjh" # cVim
# "fpnmgdkabkmnadcjpehmlllkndpkmiak" # Wayback Machine
"cjpalhdlnbpafiamejdnhcphjbkeiagm" # uBlock Origin

View File

@@ -181,7 +181,7 @@ in {
environment.systemPackages = [
pkgs.gnupg
(pkgs.pass.withExtensions (e: [e.pass-otp]))
(pkgs.pass.withExtensions (e: [e.pass-otp e.pass-import e.pass-genphrase]))
];
}
{
@@ -194,11 +194,12 @@ in {
};
}
{
networking.hosts = lib.mapAttrs' (name: address: {
name = address;
value = ["${name}.local"];
})
localAddresses;
networking.hosts =
lib.mapAttrs' (name: address: {
name = address;
value = ["${name}.local"];
})
localAddresses;
}
./alacritty.nix
./backup.nix

View File

@@ -191,14 +191,14 @@ in {
# set accordingly: postponed trash record
${
lib.concatStringsSep "\n\n" (lib.mapAttrsToList (name: account: let
imapRoot = "imaps://${account.user}@${account.imap}";
in ''
account-hook ${account.user}@${account.imap} 'set imap_user="${account.user}" imap_pass="${account.password}"'
account-hook ${account.user}@${account.smtp} 'set smtp_user="${account.user}" smtp_pass="${account.password}"'
folder-hook ${account.user}@${account.imap} 'set smtp_url="${account.smtpSettings "${account.user}@${account.smtp}"}" from="${account.address}" record="${imapRoot}/${account.folders.sent}" postponed="${imapRoot}/${account.folders.drafts}" trash="${imapRoot}/${account.folders.trash}"'
named-mailboxes "${name}" "${imapRoot}" "${name}" "${imapRoot}/${account.folders.sent}"
'')
accounts)
imapRoot = "imaps://${account.user}@${account.imap}";
in ''
account-hook ${account.user}@${account.imap} 'set imap_user="${account.user}" imap_pass="${account.password}"'
account-hook ${account.user}@${account.smtp} 'set smtp_user="${account.user}" smtp_pass="${account.password}"'
folder-hook ${account.user}@${account.imap} 'set smtp_url="${account.smtpSettings "${account.user}@${account.smtp}"}" from="${account.address}" record="${imapRoot}/${account.folders.sent}" postponed="${imapRoot}/${account.folders.drafts}" trash="${imapRoot}/${account.folders.trash}"'
named-mailboxes "${name}" "${imapRoot}" "${name}" "${imapRoot}/${account.folders.sent}"
'')
accounts)
}
''
}

View File

@@ -265,6 +265,7 @@ in {
(pkgs.writers.writeDashBin "hass-cli" ''
HASS_SERVER=http://zaatar.r:8123 HASS_TOKEN=${lib.strings.fileContents <secrets/hass/token>} exec ${pkgs.home-assistant-cli}/bin/hass-cli "$@"
'')
scripts.rofi-hass
];
home-manager.users.me.xdg.configFile."pycodestyle".text = ''

View File

@@ -275,24 +275,24 @@
'';
in {
environment.etc.stardict.source = toString (makeStardictDataDir ({
Crum = pkgs.fetchzip {
url = "http://download.huzheng.org/misc/stardict-Coptic-English_all_dialects-2.4.2.tar.bz2";
sha256 = "1fi281mb9yzv40wjsdapi8fzpa7x2yscz582lv2qnss9g8zzzzr9";
};
SmithBiographyMythology = pkgs.fetchzip {
url = "https://github.com/latin-dict/Smith1873/releases/download/v1.0/Smith1873-stardict.zip";
sha256 = "01h5fxacp2m60xir8kzslkfy772vs3vmz07zhdwfhcwdaxif2af2";
};
SmithAntiquities = pkgs.fetchzip {
url = "https://github.com/latin-dict/Smith1890/releases/download/v1.0/Smith1890-stardict.zip";
sha256 = "0vpsv62p2lrzmgys4d1swpnc6lqhdi7rxwkj2ngy3lz5dk3fysyb";
};
}
// dictionaries.classics
// dictionaries.sanskrit
// dictionaries.oed
// dictionaries.russian
// dictionaries.englishGerman));
Crum = pkgs.fetchzip {
url = "http://download.huzheng.org/misc/stardict-Coptic-English_all_dialects-2.4.2.tar.bz2";
sha256 = "1fi281mb9yzv40wjsdapi8fzpa7x2yscz582lv2qnss9g8zzzzr9";
};
SmithBiographyMythology = pkgs.fetchzip {
url = "https://github.com/latin-dict/Smith1873/releases/download/v1.0/Smith1873-stardict.zip";
sha256 = "01h5fxacp2m60xir8kzslkfy772vs3vmz07zhdwfhcwdaxif2af2";
};
SmithAntiquities = pkgs.fetchzip {
url = "https://github.com/latin-dict/Smith1890/releases/download/v1.0/Smith1890-stardict.zip";
sha256 = "0vpsv62p2lrzmgys4d1swpnc6lqhdi7rxwkj2ngy3lz5dk3fysyb";
};
}
// dictionaries.classics
// dictionaries.sanskrit
// dictionaries.oed
// dictionaries.russian
// dictionaries.englishGerman));
environment.systemPackages = [
pkgs.goldendict

View File

@@ -18,50 +18,49 @@ in {
environment.systemPackages = [pkgs.sxiv];
# TODO fix
home-manager.users.me.xdg.configFile."sxiv/exec/key-handler".source =
pkgs.writers.writeDash "key-handler" ''
PATH=$PATH:${
lib.makeBinPath [
pkgs.gnused
pkgs.gawk
pkgs.dmenu
pkgs.coreutils
pkgs.libnotify
pkgs.imagemagick
pkgs.xclip
]
}
home-manager.users.me.xdg.configFile."sxiv/exec/key-handler".source = pkgs.writers.writeDash "key-handler" ''
PATH=$PATH:${
lib.makeBinPath [
pkgs.gnused
pkgs.gawk
pkgs.dmenu
pkgs.coreutils
pkgs.libnotify
pkgs.imagemagick
pkgs.xclip
]
}
echo >&2 key "$1" pressed
while read file; do
case "$1" in
"c")
[ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ${important-directories} | awk '{print $2}' | dmenu -l 20 -i -p "Copy file(s) to where?" | sed "s|~|$HOME|g")"
[ -z "$destdir" ] && exit
[ ! -d "$destdir" ] && notify-send "$destdir is not a directory, cancelled." && exit
cp "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file copied to $destdir." &
;;
"m")
[ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ${important-directories} | awk '{print $2}' | dmenu -l 20 -i -p "Move file(s) to where?" | sed "s|~|$HOME|g")"
[ -z "$destdir" ] && exit
[ ! -d "$destdir" ] && notify-send "$destdir is not a directory, cancelled." && exit
mv "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file moved to $destdir." &
;;
"r")
convert -rotate 90 "$file" "$file" ;;
"R")
convert -rotate -90 "$file" "$file" ;;
"f")
convert -flop "$file" "$file" ;;
"y")
echo -n "$file" | xclip -selection clipboard &&
notify-send "$file copied to clipboard" & ;;
"Y")
readlink -f "$file" | xclip -selection clipboard &&
notify-send "$(readlink -f "$file") copied to clipboard" & ;;
"d")
[ "$(printf "No\\nYes" | dmenu -i -p "Really delete $file?")" = "Yes" ] && rm "$file" && notify-send "$file deleted." ;;
esac
done
'';
echo >&2 key "$1" pressed
while read file; do
case "$1" in
"c")
[ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ${important-directories} | awk '{print $2}' | dmenu -l 20 -i -p "Copy file(s) to where?" | sed "s|~|$HOME|g")"
[ -z "$destdir" ] && exit
[ ! -d "$destdir" ] && notify-send "$destdir is not a directory, cancelled." && exit
cp "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file copied to $destdir." &
;;
"m")
[ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ${important-directories} | awk '{print $2}' | dmenu -l 20 -i -p "Move file(s) to where?" | sed "s|~|$HOME|g")"
[ -z "$destdir" ] && exit
[ ! -d "$destdir" ] && notify-send "$destdir is not a directory, cancelled." && exit
mv "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file moved to $destdir." &
;;
"r")
convert -rotate 90 "$file" "$file" ;;
"R")
convert -rotate -90 "$file" "$file" ;;
"f")
convert -flop "$file" "$file" ;;
"y")
echo -n "$file" | xclip -selection clipboard &&
notify-send "$file copied to clipboard" & ;;
"Y")
readlink -f "$file" | xclip -selection clipboard &&
notify-send "$(readlink -f "$file") copied to clipboard" & ;;
"d")
[ "$(printf "No\\nYes" | dmenu -i -p "Really delete $file?")" = "Yes" ] && rm "$file" && notify-send "$file deleted." ;;
esac
done
'';
}

26
flake.lock generated
View File

@@ -109,11 +109,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1646406548,
"narHash": "sha256-xp+3f76ycZXNf9pG65Ef9KfDl1fas2UQu/cBe/pLd+c=",
"lastModified": 1646933238,
"narHash": "sha256-RZJnLN0o4B35eTnUc2tEAD12X5TNeeJhhvH3Fd6Pmdo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "47cd6702934434dd02bc53a67dbce3e5493e33a2",
"rev": "bacbfd713b4781a4a82c1f390f8fe21ae3b8b95b",
"type": "github"
},
"original": {
@@ -125,11 +125,11 @@
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1646523963,
"narHash": "sha256-ixFwYnaOycrzs0iN9RvyRMEGCkQ9Pj58x6V/qc2khy8=",
"lastModified": 1647130139,
"narHash": "sha256-m0yeKJJPub9Zv6N7KX/a36A3ocidWUnuyWVdLfNVjj8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a173e92ee458878651356b9bcfb1e2b5145f76af",
"rev": "b783c48432cdfc35224a39bd95666daa62fef126",
"type": "github"
},
"original": {
@@ -158,11 +158,11 @@
"retiolum": {
"flake": false,
"locked": {
"lastModified": 1646081604,
"narHash": "sha256-+o4I0UWPT2ZBr3oGF3vHGidfjbydkzyuFKWKDOzJo2U=",
"lastModified": 1646955706,
"narHash": "sha256-2wtMIXrozeO7qigFlRHp/53aSZMwcErH5zi14iwZV00=",
"owner": "krebs",
"repo": "retiolum",
"rev": "259d60325310b728f79c68dc1148f597e097d1b2",
"rev": "e488402be7f60a478c95a4bad6d6e2c67f2b55f9",
"type": "github"
},
"original": {
@@ -210,11 +210,11 @@
"stockholm": {
"flake": false,
"locked": {
"lastModified": 1646301205,
"narHash": "sha256-m3eG8L0PI9Y2R2ZRF5NHfIzvRGkOL7aUIl7i+UCxUGc=",
"lastModified": 1647025390,
"narHash": "sha256-98w91+xsqyus0uyxxQQ5roWx+tEyaAogiVyWgBsVVig=",
"ref": "master",
"rev": "87a44dd1573cbdc8f0fc3553b0896b470bcfa44d",
"revCount": 10431,
"rev": "2dc05dbafbd5490be6a9754a55679a6576efbad1",
"revCount": 10463,
"type": "git",
"url": "https://cgit.lassul.us/stockholm"
},

View File

@@ -598,6 +598,12 @@ in
station = soma-fm-name "Vaporwaves";
stream = soma-fm "vaporwaves";
}
{
desc = "Featuring the music from an independent record label focused on modern electronic ambient and space music.";
logo = "https://somafm.com/img3/synphaera120.jpg";
station = soma-fm-name "Synphaera";
stream = soma-fm "synphaera";
}
{
desc = "Emotional Experiments in Music: Ambient, modern composition, post-rock, & experimental electronic music";
logo = "http://soma.fm/img/n5md120.png";
@@ -1443,6 +1449,58 @@ in
stream = "http://91.121.59.45:8013/live";
station = "Feeling Floyd | Live";
}
{
station = "Chinese Music World";
stream = "https://radio.chinesemusicworld.com/chinesemusic.ogg";
}
{
stream = "https://live.hunter.fm/lofi_high";
station = "LoFi | Hunter FM";
}
{
stream = "https://live.hunter.fm/pisadinha_high";
station = "Pisadinha | Hunter FM";
}
{
stream = "https://classicfm.ice.infomaniak.ch/classic-fm.mp3";
station = "Classic FM";
}
{
station = "Digital Jazz";
stream = "http://stm01.virtualcast.com.br:8190/live";
}
{
station = "Jazz | Radio Monte Carlo";
stream = "http://edge.radiomontecarlo.net/rmcweb019";
}
{
station = "NRK Jazz";
stream = "http://lyd.nrk.no/nrk_radio_jazz_aac_h";
}
{
station = "Digital Impulse Classical Channel";
stream = "http://orion.shoutca.st:8978/stream";
}
{
station = "Старое радио (детское)";
stream = "http://195.91.237.50:8000/detskoe128";
}
{
station = "Старое радио";
stream = "http://195.91.237.50:8000/ices128";
}
{
station = "Старое радио (музыка)";
stream = "http://195.91.237.50:8000/music128";
}
{
station = "Fango Radio";
stream = "https://azuracast.streams.ovh/radio/8090/radio.mp3";
}
{
station = "Mikis Radio";
stream = "http://radio.hostchefs.net:8046/stream";
}
]
/*
(caster-fm "TODO" "noasrv" 10182) # https://github.com/cccruzr/albumsyoumusthear/blob/7e00baf575e4d357cd275d54d1aeb717321141a8/HLS/IBERO_90_1.m3u
@@ -1452,8 +1510,8 @@ in
http://cw.dimebank.com:8080/CNNslow
http://cw.dimebank.com:8080/CNNfast
Brazilian Jazz
http://stm01.virtualcast.com.br:8190/live
Orchestral
http://orion.shoutca.st:8978/stream
LoFi / Chill
http://ice55.securenetsystems.net/DASH76
@@ -1471,5 +1529,17 @@ in
http://185.105.4.53:2339//;stream.mp3
http://cast5.servcast.net:1390/;stream.mp3
Hard rock
http://andromeda.shoutca.st:9254/stream
Rock alternative
http://icy.unitedradio.it/VirginRockAlternative.mp3
American nautical weather news
http://ca.radioboss.fm:8149/stream
Christian radio in all languages
https://jesuscomingfm.com/#
tamazight http://live.jesuscomingfm.com:8462/;
*/

View File

@@ -15,14 +15,14 @@ with lib; let
mode = "0400"; # readonly (user)
text =
(foldlAttrs (accum: {
name,
value,
}: ''
${accum}
name,
value,
}: ''
${accum}
[${name}] ${mkProfileEntry value}'')
"# Generated by nixos-networkmanager-profiles"
profileAttrs)
[${name}] ${mkProfileEntry value}'')
"# Generated by nixos-networkmanager-profiles"
profileAttrs)
+ "\n";
};

View File

@@ -33,9 +33,10 @@ in {
config = {
services.tinc.networks.${netname} = {
name = cfg.nodename;
hosts = builtins.mapAttrs
(name: _: builtins.readFile "${<retiolum/hosts>}/${name}")
(builtins.readDir <retiolum/hosts>);
hosts =
builtins.mapAttrs
(name: _: builtins.readFile "${<retiolum/hosts>}/${name}")
(builtins.readDir <retiolum/hosts>);
rsaPrivateKeyFile = toString <system-secrets/retiolum.key>;
ed25519PrivateKeyFile = toString <system-secrets/retiolum.ed25519>;
extraConfig = ''

View File

@@ -14,16 +14,16 @@ with lib; let
serviceConfig.Type = "oneshot";
wants = ["network-online.target"];
script = strings.concatStringsSep "\n" (["QUOTE=$(${bot.command})" "if [ -n \"$QUOTE\" ]; then"]
++ map (chatId: ''
${pkgs.curl}/bin/curl -s -X POST "https://api.telegram.org/bot${bot.token}/sendMessage" \
-d chat_id="${chatId}" \
-d text="$QUOTE" ${
lib.strings.optionalString (bot.parseMode != null)
"-d parse_mode=${bot.parseMode}"
}
'')
bot.chatIds
++ ["fi"]);
++ map (chatId: ''
${pkgs.curl}/bin/curl -s -X POST "https://api.telegram.org/bot${bot.token}/sendMessage" \
-d chat_id="${chatId}" \
-d text="$QUOTE" ${
lib.strings.optionalString (bot.parseMode != null)
"-d parse_mode=${bot.parseMode}"
}
'')
bot.chatIds
++ ["fi"]);
};
in {
options.niveum.telegramBots = mkOption {

View File

@@ -1,6 +1,6 @@
self: super:
with super.lib; let
eval = import <nixpkgs/nixos/lib/eval-config.nix>;
paths = (eval {modules = [(import <nixos-config>)];}).config.nixpkgs.overlays;
in
foldl' (flip extends) (_: super) paths self
with super.lib; let
eval = import <nixpkgs/nixos/lib/eval-config.nix>;
paths = (eval {modules = [(import <nixos-config>)];}).config.nixpkgs.overlays;
in
foldl' (flip extends) (_: super) paths self

View File

@@ -307,31 +307,33 @@ in
packages = [pkgs.xdo];
};
ipa = pkgs.writers.writeHaskellBin "ipa" {
libraries = with pkgs; [haskellPackages.text haskellPackages.ipa];
} ''
import Data.Maybe (fromJust)
import Language.IPA
import qualified Data.Text as T
import qualified Data.Text.IO as T
main = T.interact (T.unwords . map (unIPA . fromJust . (xSampaToIpa =<<) . mkXSampa) . T.words)
'';
ipa =
pkgs.writers.writeHaskellBin "ipa" {
libraries = with pkgs; [haskellPackages.text haskellPackages.ipa];
} ''
import Data.Maybe (fromJust)
import Language.IPA
import qualified Data.Text as T
import qualified Data.Text.IO as T
main = T.interact (T.unwords . map (unIPA . fromJust . (xSampaToIpa =<<) . mkXSampa) . T.words)
'';
default-gateway = pkgs.writers.writeDashBin "default-gateway" ''
${pkgs.iproute}/bin/ip -json route | ${pkgs.jq}/bin/jq --raw-output '.[0].gateway'
'';
betacode = pkgs.writers.writeHaskellBin "betacode" {
libraries = with pkgs; [
(haskell.lib.unmarkBroken (haskell.lib.doJailbreak haskellPackages.betacode))
haskellPackages.text
];
} ''
import qualified Data.Text.IO as T
import qualified Data.Text as T
import Text.BetaCode
main = T.interact (either (error . T.unpack) id . fromBeta)
'';
betacode =
pkgs.writers.writeHaskellBin "betacode" {
libraries = with pkgs; [
(haskell.lib.unmarkBroken (haskell.lib.doJailbreak haskellPackages.betacode))
haskellPackages.text
];
} ''
import qualified Data.Text.IO as T
import qualified Data.Text as T
import Text.BetaCode
main = T.interact (either (error . T.unpack) id . fromBeta)
'';
devanagari = pkgs.callPackage ../devanagari {};
@@ -447,6 +449,20 @@ in
${pkgs.wget}/bin/wget -q -N https://github.com/Mic92/nix-index-database/releases/latest/download/$filename
ln -f $filename files
'';
rofi-hass = pkgs.writers.writeBashBin "rofi-hass" ''
export PATH=${lib.makeBinPath [pkgs.home-assistant-cli pkgs.jq pkgs.util-linux pkgs.rofi pkgs.gnused pkgs.libnotify]}
json=$(hass-cli -o json state list 2>/dev/null)
idx=$(jq -r '.[] | [.entity_id, .state] | join(" ")' <<< "$json" | column -t | rofi -dmenu -i -markup-rows -format d)
item=$(jq -r '.[].entity_id' <<< "$json" | sed "''${idx}q;d")
itype=$(sed -r 's/\..+$//' <<< "$item")
case "$itype" in
light) hass-cli state toggle "$item" &>/dev/null ;;
scene) hass-cli service call --arguments entity_id="$item" scene.turn_on &>/dev/null ;;
*) notify-send "Error" "Event type '$itype' not implemented yet. Do you have time to file an issue or write a PR?" ;;
esac
'';
}
// {
devour = pkgs.callPackage <niveum/packages/devour.nix> {};

View File

@@ -67,7 +67,7 @@ in {
autoconnect = true;
address = "irc.libera.chat/6697";
ssl = true;
autojoin = ["#flipdot" "#haskell" "#nixos" "#fysi" "#binaergewitter" "#neovim" "#lojban" "#vim" "#newsboat" ];
autojoin = ["#flipdot" "#haskell" "#nixos" "#fysi" "#binaergewitter" "#neovim" "#lojban" "#vim" "#newsboat"];
sasl_mechanism = "plain";
sasl_username = nick;
sasl_password = lib.strings.fileContents <system-secrets/irc/libera>;