mirror of
https://github.com/kmein/niveum
synced 2026-03-16 10:11:08 +01:00
format
This commit is contained in:
@@ -3,14 +3,16 @@
|
||||
haskell,
|
||||
haskellPackages,
|
||||
}:
|
||||
writers.writeHaskellBin "betacode" {
|
||||
libraries = [
|
||||
(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)
|
||||
''
|
||||
writers.writeHaskellBin "betacode"
|
||||
{
|
||||
libraries = [
|
||||
(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)
|
||||
''
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
{ writers, flite, netcat, gnused, ... }:
|
||||
{
|
||||
writers,
|
||||
flite,
|
||||
netcat,
|
||||
gnused,
|
||||
...
|
||||
}:
|
||||
writers.writeDashBin "brainmelter" ''
|
||||
SERVER="brockman.news"
|
||||
PORT=6667
|
||||
|
||||
@@ -6,8 +6,15 @@
|
||||
writers.writeDashBin "closest" ''
|
||||
${
|
||||
writers.writeHaskellBin "closest" {
|
||||
libraries = with haskellPackages; [parallel optparse-applicative edit-distance];
|
||||
ghcArgs = ["-O3" "-threaded"];
|
||||
libraries = with haskellPackages; [
|
||||
parallel
|
||||
optparse-applicative
|
||||
edit-distance
|
||||
];
|
||||
ghcArgs = [
|
||||
"-O3"
|
||||
"-threaded"
|
||||
];
|
||||
} (builtins.readFile ./distance.hs)
|
||||
}/bin/closest +RTS -N4 -RTS --dictionary ${
|
||||
fetchurl {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{pkgs}:
|
||||
{ pkgs }:
|
||||
pkgs.symlinkJoin {
|
||||
name = "cyberlocker-tools";
|
||||
paths = [
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
{
|
||||
lib,
|
||||
writeShellScriptBin,
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
aliasFlag = name: value: "-c alias.${name}=${lib.escapeShellArg value}";
|
||||
aliases = {
|
||||
eroeffne = "init";
|
||||
@@ -23,10 +24,10 @@
|
||||
zustand = "status";
|
||||
};
|
||||
in
|
||||
writeShellScriptBin "depp" ''
|
||||
if [ $# -gt 0 ]; then
|
||||
git ${lib.concatStringsSep " " (lib.attrsets.mapAttrsToList aliasFlag aliases)} "$@"
|
||||
else
|
||||
printf "${lib.concatStringsSep "\n" (lib.attrsets.mapAttrsToList (n: v: n + " " + v) aliases)}\n"
|
||||
fi
|
||||
''
|
||||
writeShellScriptBin "depp" ''
|
||||
if [ $# -gt 0 ]; then
|
||||
git ${lib.concatStringsSep " " (lib.attrsets.mapAttrsToList aliasFlag aliases)} "$@"
|
||||
else
|
||||
printf "${lib.concatStringsSep "\n" (lib.attrsets.mapAttrsToList (n: v: n + " " + v) aliases)}\n"
|
||||
fi
|
||||
''
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{yarn2nix-moretea, lib}:
|
||||
{ yarn2nix-moretea, lib }:
|
||||
yarn2nix-moretea.mkYarnPackage {
|
||||
name = "devanagari";
|
||||
src = lib.fileset.toSource {
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
linkFarm,
|
||||
runCommandNoCC,
|
||||
gnutar,
|
||||
}: rec {
|
||||
}:
|
||||
rec {
|
||||
offline_cache = linkFarm "offline" packages;
|
||||
packages = [
|
||||
{
|
||||
|
||||
@@ -16,8 +16,8 @@ stdenv.mkDerivation {
|
||||
sha256 = "0f2jb8knx7lqy6wmf3rchgq2n2dj496lm8vgcs58rppzrmsk59d5";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [makeWrapper];
|
||||
buildInputs = [xdo];
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
buildInputs = [ xdo ];
|
||||
|
||||
DESTDIR = "$(out)";
|
||||
|
||||
|
||||
@@ -15,7 +15,20 @@
|
||||
writers.writeDashBin "dmenu-randr" ''
|
||||
#!/bin/sh
|
||||
|
||||
export PATH=${lib.makeBinPath [dmenu bc psmisc util-linux xorg.xrandr gawk libnotify arandr gnugrep coreutils]}
|
||||
export PATH=${
|
||||
lib.makeBinPath [
|
||||
dmenu
|
||||
bc
|
||||
psmisc
|
||||
util-linux
|
||||
xorg.xrandr
|
||||
gawk
|
||||
libnotify
|
||||
arandr
|
||||
gnugrep
|
||||
coreutils
|
||||
]
|
||||
}
|
||||
|
||||
# A UI for detecting and selecting all displays. Probes xrandr for connected
|
||||
# displays and lets user select one to use. User may also select "manual
|
||||
|
||||
@@ -10,7 +10,15 @@
|
||||
}:
|
||||
writers.writeDashBin "emailmenu" ''
|
||||
history_file=$HOME/.cache/emailmenu
|
||||
PATH=${lib.makeBinPath [coreutils dmenu gawk libnotify xclip]}
|
||||
PATH=${
|
||||
lib.makeBinPath [
|
||||
coreutils
|
||||
dmenu
|
||||
gawk
|
||||
libnotify
|
||||
xclip
|
||||
]
|
||||
}
|
||||
chosen=$(${khard}/bin/khard email --parsable | awk '!seen[$0]++' | dmenu -i -p 📧 -1 -l 10 | tee --append "$history_file" | cut -f1)
|
||||
[ "$chosen" != "" ] || exit
|
||||
echo "$chosen" | tr -d '\n' | xclip -selection clipboard
|
||||
|
||||
@@ -7,7 +7,14 @@
|
||||
fzf,
|
||||
}:
|
||||
writers.writeBashBin "fkill" ''
|
||||
PATH=$PATH:${lib.makeBinPath [procps gawk gnused fzf]}
|
||||
PATH=$PATH:${
|
||||
lib.makeBinPath [
|
||||
procps
|
||||
gawk
|
||||
gnused
|
||||
fzf
|
||||
]
|
||||
}
|
||||
|
||||
if [ "$UID" != "0" ]; then
|
||||
pid=$(ps -f -u "$UID" | sed 1d | fzf -m | awk '{print $2}')
|
||||
|
||||
@@ -10,7 +10,13 @@ writers.writeBashBin "fzfmenu" ''
|
||||
# https://github.com/junegunn/fzf/wiki/Examples#fzf-as-dmenu-replacement
|
||||
set -efu
|
||||
|
||||
PATH=$PATH:${lib.makeBinPath [st fzf dash]}
|
||||
PATH=$PATH:${
|
||||
lib.makeBinPath [
|
||||
st
|
||||
fzf
|
||||
dash
|
||||
]
|
||||
}
|
||||
|
||||
input=$(mktemp -p "$XDG_RUNTIME_DIR" -u --suffix .fzfmenu.input)
|
||||
output=$(mktemp -p "$XDG_RUNTIME_DIR" -u --suffix .fzfmenu.output)
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
fetchzip,
|
||||
symlinkJoin,
|
||||
lib,
|
||||
}: let
|
||||
gfs-font = name: sha256:
|
||||
}:
|
||||
let
|
||||
gfs-font =
|
||||
name: sha256:
|
||||
fetchzip {
|
||||
inherit name sha256;
|
||||
url = "http://www.greekfontsociety-gfs.gr/_assets/fonts/${name}.zip";
|
||||
@@ -14,40 +16,40 @@
|
||||
'';
|
||||
};
|
||||
in
|
||||
symlinkJoin {
|
||||
name = "gfs-fonts";
|
||||
paths = lib.mapAttrsToList gfs-font {
|
||||
GFS_Artemisia = "1q39086pr2jhv118fjfv6l1li6japv4pdjnhh1scqw06mqrmydf4";
|
||||
GFS_Baskerville = "07gx5b9b43zv74d2lay37sajd4ba2wqn3b7xzvyhn265ds9x7cxk";
|
||||
GFS_Bodoni = "0jhl0728ikzha1krm01sk52nz3jzibidwmyvgidg61d87l8nbf2p";
|
||||
GFS_Bodoni_Classic = "06jw2irskn75s50mgwkx08rzwqi82gpc6lgjsimsi8p81566gfrh";
|
||||
GFS_Complutum = "1q7dxs2z3yrgchd2pz9h72mjrk62kdc2mmqw8kg9q76k28f8n3p0"; # -> GFSPolyglot.otf
|
||||
GFS_Decker = "016v1j5n9ph4i2cpmlk26pcxhp3q2fjwlaryppd5akl84dfkpncl";
|
||||
GFS_Didot = "0ysvrp527wm0wxfp6wmlgmxfx7ysr5mwpmjmqp1h605cy44jblfm";
|
||||
GFS_Didot_Classic = "0n5awqksvday3l3d85yhwmbmfj9bcpxivy4wpd4zrkgl7b85af2c";
|
||||
GFS_Didot_Display = "0n2di2zyc76w6f8mc6hfilc2ir6igks7ldjp9fkw1gjp06330fi7";
|
||||
GFS_Elpis = "02l7wd3nbn1kpv7ghxh19k4dbvd49ijyxd6gq83gcr9vlmxcq2s2";
|
||||
GFS_Gazis = "0x9iwj6pinaykrds0iw6552hf256d0dr41sipdb1jnnlr2d3bf9w";
|
||||
GFS_Goschen = "1jvbn33wzq2yj0aygwy9pd2msg3wkmdp0npjzazadrmfjpnpkcy9";
|
||||
GFS_NeoHellenic = "1ixm2frdc6i5lbn9h0h4gdsvsw2k4hny75q8ig4kgs28ac3dbzq3";
|
||||
GFS_Olga = "1qaxaw3ngnbr1gb1xyk5f2z647zklg6sl3bqwi28l47j9mp0f8aj";
|
||||
GFS_Orpheus = "18n6fag4pyr8jdwnsz0vixf47jz4ym8mjmppc1w3k7v27cg1z9dz";
|
||||
GFS_Orpheus_Classic = "1rqy1kf7slw56zfhbv264yzarjisnqbqydj4f7hghiknhnmdakps";
|
||||
GFS_Orpheus_Sans = "02rh7z8c3h3xyfi52rn47z4finizx636d05bg5g23v0l0mqs6nkg";
|
||||
GFS_Philostratos = "0zh3d0cn6b2fjbwnvmg379z20zh7w626w2bnj19xcazjvqkwhzx1";
|
||||
GFS_Porson = "0c2axagkm6wxv8na2q11k6c5dmgkwx5hn9sh9qy82gbips9blnda";
|
||||
GFS_Pyrsos = "0y0dv7y3n01bbhhnczflx1zcc7by56cffmr2xqixj2rd1nvchx0j";
|
||||
GFS_Solomos = "1mpx9mw566awvfjdfx5sbz3wz5gbnjjw56gz30mk1lw06vxf0dxz";
|
||||
GFS_Theokritos = "0haasx819x8c8yvna6pqywgi4060av2570jm34cddnz1fgnhv1b8";
|
||||
# Heraklit
|
||||
# Galatea
|
||||
# Georgiou
|
||||
# Ambrosia
|
||||
# Fleischman
|
||||
# Eustace
|
||||
# Nicefore
|
||||
# Jackson
|
||||
# Garaldus
|
||||
# Ignacio
|
||||
};
|
||||
}
|
||||
symlinkJoin {
|
||||
name = "gfs-fonts";
|
||||
paths = lib.mapAttrsToList gfs-font {
|
||||
GFS_Artemisia = "1q39086pr2jhv118fjfv6l1li6japv4pdjnhh1scqw06mqrmydf4";
|
||||
GFS_Baskerville = "07gx5b9b43zv74d2lay37sajd4ba2wqn3b7xzvyhn265ds9x7cxk";
|
||||
GFS_Bodoni = "0jhl0728ikzha1krm01sk52nz3jzibidwmyvgidg61d87l8nbf2p";
|
||||
GFS_Bodoni_Classic = "06jw2irskn75s50mgwkx08rzwqi82gpc6lgjsimsi8p81566gfrh";
|
||||
GFS_Complutum = "1q7dxs2z3yrgchd2pz9h72mjrk62kdc2mmqw8kg9q76k28f8n3p0"; # -> GFSPolyglot.otf
|
||||
GFS_Decker = "016v1j5n9ph4i2cpmlk26pcxhp3q2fjwlaryppd5akl84dfkpncl";
|
||||
GFS_Didot = "0ysvrp527wm0wxfp6wmlgmxfx7ysr5mwpmjmqp1h605cy44jblfm";
|
||||
GFS_Didot_Classic = "0n5awqksvday3l3d85yhwmbmfj9bcpxivy4wpd4zrkgl7b85af2c";
|
||||
GFS_Didot_Display = "0n2di2zyc76w6f8mc6hfilc2ir6igks7ldjp9fkw1gjp06330fi7";
|
||||
GFS_Elpis = "02l7wd3nbn1kpv7ghxh19k4dbvd49ijyxd6gq83gcr9vlmxcq2s2";
|
||||
GFS_Gazis = "0x9iwj6pinaykrds0iw6552hf256d0dr41sipdb1jnnlr2d3bf9w";
|
||||
GFS_Goschen = "1jvbn33wzq2yj0aygwy9pd2msg3wkmdp0npjzazadrmfjpnpkcy9";
|
||||
GFS_NeoHellenic = "1ixm2frdc6i5lbn9h0h4gdsvsw2k4hny75q8ig4kgs28ac3dbzq3";
|
||||
GFS_Olga = "1qaxaw3ngnbr1gb1xyk5f2z647zklg6sl3bqwi28l47j9mp0f8aj";
|
||||
GFS_Orpheus = "18n6fag4pyr8jdwnsz0vixf47jz4ym8mjmppc1w3k7v27cg1z9dz";
|
||||
GFS_Orpheus_Classic = "1rqy1kf7slw56zfhbv264yzarjisnqbqydj4f7hghiknhnmdakps";
|
||||
GFS_Orpheus_Sans = "02rh7z8c3h3xyfi52rn47z4finizx636d05bg5g23v0l0mqs6nkg";
|
||||
GFS_Philostratos = "0zh3d0cn6b2fjbwnvmg379z20zh7w626w2bnj19xcazjvqkwhzx1";
|
||||
GFS_Porson = "0c2axagkm6wxv8na2q11k6c5dmgkwx5hn9sh9qy82gbips9blnda";
|
||||
GFS_Pyrsos = "0y0dv7y3n01bbhhnczflx1zcc7by56cffmr2xqixj2rd1nvchx0j";
|
||||
GFS_Solomos = "1mpx9mw566awvfjdfx5sbz3wz5gbnjjw56gz30mk1lw06vxf0dxz";
|
||||
GFS_Theokritos = "0haasx819x8c8yvna6pqywgi4060av2570jm34cddnz1fgnhv1b8";
|
||||
# Heraklit
|
||||
# Galatea
|
||||
# Georgiou
|
||||
# Ambrosia
|
||||
# Fleischman
|
||||
# Eustace
|
||||
# Nicefore
|
||||
# Jackson
|
||||
# Garaldus
|
||||
# Ignacio
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
{ gimp, fetchurl, runCommand, symlinkJoin, writers }:
|
||||
{
|
||||
gimp,
|
||||
fetchurl,
|
||||
runCommand,
|
||||
symlinkJoin,
|
||||
writers,
|
||||
}:
|
||||
let
|
||||
bring-out-the-gimp = fetchurl {
|
||||
url = "https://c.krebsco.de/bring-out-the-gimp.png";
|
||||
@@ -8,13 +14,14 @@ let
|
||||
data-dir = symlinkJoin {
|
||||
name = "gimp";
|
||||
paths = [
|
||||
(runCommand "splash" {} ''
|
||||
(runCommand "splash" { } ''
|
||||
mkdir -p $out/${data-dir-prefix}/images
|
||||
install ${bring-out-the-gimp} $out/share/gimp/2.0/images/gimp-splash.png
|
||||
'')
|
||||
gimp
|
||||
];
|
||||
};
|
||||
in writers.writeDashBin "gimp" ''
|
||||
in
|
||||
writers.writeDashBin "gimp" ''
|
||||
exec env GIMP2_DATADIR=${data-dir}/${data-dir-prefix} ${gimp}/bin/gimp "$@"
|
||||
''
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
{ buildGoModule, fetchgit, lib }:
|
||||
{
|
||||
buildGoModule,
|
||||
fetchgit,
|
||||
lib,
|
||||
}:
|
||||
buildGoModule {
|
||||
pname = "go-webring";
|
||||
version = "2024-12-18";
|
||||
|
||||
@@ -3,12 +3,13 @@
|
||||
fetchurl,
|
||||
xan,
|
||||
util-linux,
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
database = fetchurl {
|
||||
url = "http://c.krebsco.de/greek.csv";
|
||||
hash = "sha256-SYL10kerNI0HzExG6JXh765+CBBCHLO95B6OKErQ/sU=";
|
||||
};
|
||||
in
|
||||
writers.writeDashBin "heuretes" ''
|
||||
${xan}/bin/xan search -s simple "$*" ${database} | ${util-linux}/bin/column -s, -t
|
||||
''
|
||||
writers.writeDashBin "heuretes" ''
|
||||
${xan}/bin/xan search -s simple "$*" ${database} | ${util-linux}/bin/column -s, -t
|
||||
''
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
{ symlinkJoin
|
||||
, hledger
|
||||
, writers
|
||||
, lib
|
||||
, git
|
||||
, coreutils
|
||||
, gnugrep
|
||||
, timeLedger
|
||||
, ...
|
||||
{
|
||||
symlinkJoin,
|
||||
hledger,
|
||||
writers,
|
||||
lib,
|
||||
git,
|
||||
coreutils,
|
||||
gnugrep,
|
||||
timeLedger,
|
||||
...
|
||||
}:
|
||||
let
|
||||
date = "${coreutils}/bin/date +'%Y-%m-%d %H:%M:%S'";
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
writers,
|
||||
lib,
|
||||
xlockmore,
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
xlockModes = lib.concatStringsSep "\\n" [
|
||||
# "braid"
|
||||
"galaxy"
|
||||
@@ -12,18 +13,18 @@
|
||||
"space"
|
||||
];
|
||||
in
|
||||
writers.writeDashBin "k-lock" ''
|
||||
MODE=$(printf "${xlockModes}" | shuf -n 1)
|
||||
writers.writeDashBin "k-lock" ''
|
||||
MODE=$(printf "${xlockModes}" | shuf -n 1)
|
||||
|
||||
${xlockmore}/bin/xlock \
|
||||
-saturation 0.4 \
|
||||
-erasemode no_fade \
|
||||
+description \
|
||||
-showdate \
|
||||
-username " " \
|
||||
-password " " \
|
||||
-info " " \
|
||||
-validate "..." \
|
||||
-invalid "Computer says no." \
|
||||
-mode "$MODE"
|
||||
''
|
||||
${xlockmore}/bin/xlock \
|
||||
-saturation 0.4 \
|
||||
-erasemode no_fade \
|
||||
+description \
|
||||
-showdate \
|
||||
-username " " \
|
||||
-password " " \
|
||||
-info " " \
|
||||
-validate "..." \
|
||||
-invalid "Computer says no." \
|
||||
-mode "$MODE"
|
||||
''
|
||||
|
||||
@@ -10,15 +10,20 @@
|
||||
writers,
|
||||
options ? { },
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
eval = lib.evalModules {
|
||||
modules = [
|
||||
{
|
||||
imports = [options];
|
||||
imports = [ options ];
|
||||
options = {
|
||||
selection = lib.mkOption {
|
||||
default = "clipboard";
|
||||
type = lib.types.enum ["primary" "secondary" "clipboard"];
|
||||
type = lib.types.enum [
|
||||
"primary"
|
||||
"secondary"
|
||||
"clipboard"
|
||||
];
|
||||
};
|
||||
dmenu = lib.mkOption {
|
||||
default = "${dmenu}/bin/dmenu -i -p klem";
|
||||
@@ -41,19 +46,19 @@
|
||||
|
||||
cfg = eval.config;
|
||||
in
|
||||
writers.writeDashBin "klem" ''
|
||||
set -efu
|
||||
writers.writeDashBin "klem" ''
|
||||
set -efu
|
||||
|
||||
${xclip}/bin/xclip -selection ${cfg.selection} -out \
|
||||
| case $(echo "${
|
||||
lib.concatStringsSep "\n" (lib.attrNames cfg.scripts)
|
||||
}" | ${cfg.dmenu}) in
|
||||
${lib.concatStringsSep "\n" (lib.mapAttrsToList (option: script: ''
|
||||
${xclip}/bin/xclip -selection ${cfg.selection} -out \
|
||||
| case $(echo "${lib.concatStringsSep "\n" (lib.attrNames cfg.scripts)}" | ${cfg.dmenu}) in
|
||||
${lib.concatStringsSep "\n" (
|
||||
lib.mapAttrsToList (option: script: ''
|
||||
'${option}') ${toString script} ;;
|
||||
'') cfg.scripts)}
|
||||
*) ${coreutils}/bin/cat ;;
|
||||
esac \
|
||||
| ${xclip}/bin/xclip -selection ${cfg.selection} -in
|
||||
'') cfg.scripts
|
||||
)}
|
||||
*) ${coreutils}/bin/cat ;;
|
||||
esac \
|
||||
| ${xclip}/bin/xclip -selection ${cfg.selection} -in
|
||||
|
||||
${libnotify}/bin/notify-send --app-name="klem" "Result copied to clipboard."
|
||||
''
|
||||
${libnotify}/bin/notify-send --app-name="klem" "Result copied to clipboard."
|
||||
''
|
||||
|
||||
@@ -6,7 +6,13 @@
|
||||
gnused,
|
||||
}:
|
||||
writers.writeDashBin "literature-quote" ''
|
||||
PATH=$PATH:${lib.makeBinPath [xan curl gnused]}
|
||||
PATH=$PATH:${
|
||||
lib.makeBinPath [
|
||||
xan
|
||||
curl
|
||||
gnused
|
||||
]
|
||||
}
|
||||
ROW=$(curl -Ls http://kmein.github.io/logotheca/quotes.csv | shuf -n1)
|
||||
(
|
||||
QUOTE="$(echo "$ROW" | xan select 3)"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{writers}:
|
||||
writers.writeHaskellBin "manual-sort" {} ''
|
||||
{ writers }:
|
||||
writers.writeHaskellBin "manual-sort" { } ''
|
||||
{-# LANGUAGE LambdaCase #-}
|
||||
import Data.Char (toLower)
|
||||
import System.Environment (getArgs)
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
m3u-to-tsv = ''
|
||||
${pkgs.gnused}/bin/sed '/#EXTM3U/d;/#EXTINF/s/.*,//g' $out | ${pkgs.coreutils}/bin/paste -d'\t' - - > $out.tmp
|
||||
mv $out.tmp $out
|
||||
@@ -19,6 +20,6 @@
|
||||
postFetch = m3u-to-tsv;
|
||||
};
|
||||
in
|
||||
pkgs.writers.writeDashBin "mpv-tv" ''
|
||||
cat ${kodi-tv} ${live-tv} | ${pkgs.mpv}/bin/mpv --force-window=yes "$(${pkgs.dmenu}/bin/dmenu -i -l 5 | ${pkgs.coreutils}/bin/cut -f2)"
|
||||
''
|
||||
pkgs.writers.writeDashBin "mpv-tv" ''
|
||||
cat ${kodi-tv} ${live-tv} | ${pkgs.mpv}/bin/mpv --force-window=yes "$(${pkgs.dmenu}/bin/dmenu -i -l 5 | ${pkgs.coreutils}/bin/cut -f2)"
|
||||
''
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
{ sox, mpv, writers, coreutils }:
|
||||
{
|
||||
sox,
|
||||
mpv,
|
||||
writers,
|
||||
coreutils,
|
||||
}:
|
||||
# ref https://askubuntu.com/a/789472
|
||||
writers.writeDashBin "noise-waves" ''
|
||||
file="/tmp/noise-$(${coreutils}/bin/date +%s | ${coreutils}/bin/md5sum | ${coreutils}/bin/cut -d' ' -f1).wav"
|
||||
|
||||
@@ -6,20 +6,24 @@
|
||||
coreutils,
|
||||
noteDirectory ? "~/state/obsidian",
|
||||
currentDates ? false,
|
||||
obsidian-vim
|
||||
obsidian-vim,
|
||||
}:
|
||||
writers.writeDashBin "notemenu" ''
|
||||
set -efu
|
||||
PATH=$PATH:${
|
||||
lib.makeBinPath [rofi findutils coreutils]
|
||||
lib.makeBinPath [
|
||||
rofi
|
||||
findutils
|
||||
coreutils
|
||||
]
|
||||
}
|
||||
|
||||
cd ${noteDirectory}
|
||||
note_file=$({
|
||||
${lib.optionalString currentDates ''
|
||||
echo $(date -I).md
|
||||
echo $(date -I -d yesterday).md
|
||||
''}
|
||||
echo $(date -I).md
|
||||
echo $(date -I -d yesterday).md
|
||||
''}
|
||||
find . -not -path '*/.*' -type f -printf "%T@ %p\n" | sort --reverse --numeric-sort | cut --delimiter=" " --fields=2-
|
||||
} | rofi -dmenu -i -p 'notes')
|
||||
if test "$note_file"
|
||||
|
||||
@@ -23,9 +23,12 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
|
||||
doCheck = true;
|
||||
|
||||
buildInputs = [libogg];
|
||||
buildInputs = [ libogg ];
|
||||
|
||||
nativeBuildInputs = [cmake pkg-config];
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
pkg-config
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://github.com/fmang/opustags";
|
||||
|
||||
@@ -6,8 +6,9 @@
|
||||
gnused,
|
||||
curl,
|
||||
nur,
|
||||
downloadDirectory ? "~/mobile/audio/Musik/radiomitschnitt"
|
||||
}: let
|
||||
downloadDirectory ? "~/mobile/audio/Musik/radiomitschnitt",
|
||||
}:
|
||||
let
|
||||
playlistAPI = "https://radio.lassul.us";
|
||||
|
||||
sendIRC = writers.writeDash "send-irc" ''
|
||||
@@ -102,42 +103,42 @@
|
||||
${yt-dlp}/bin/yt-dlp --add-metadata --audio-format mp3 --audio-quality 0 -xic "$@"
|
||||
'';
|
||||
in
|
||||
writers.writeDashBin "pls" ''
|
||||
case "$1" in
|
||||
good|like|cool|nice|noice|top|yup|yass|yes|+)
|
||||
response=$(${curl}/bin/curl -sS -XPOST "${playlistAPI}/good")
|
||||
echo ${lib.escapeShellArg (lib.concatStringsSep "\n" messages.good)} | shuf -n1 | ${sendIRC}
|
||||
writers.writeDashBin "pls" ''
|
||||
case "$1" in
|
||||
good|like|cool|nice|noice|top|yup|yass|yes|+)
|
||||
response=$(${curl}/bin/curl -sS -XPOST "${playlistAPI}/good")
|
||||
echo ${lib.escapeShellArg (lib.concatStringsSep "\n" messages.good)} | shuf -n1 | ${sendIRC}
|
||||
|
||||
# Download the song if a download URL is provided in the string (youtu.be)
|
||||
downloadUrl=$(echo "$response" | grep -oE 'https?://(www\.)?(youtube\.com|youtu\.be)/[^\s]+')
|
||||
if [ -n "$downloadUrl" ]; then
|
||||
echo "Downloading song from URL: $downloadUrl"
|
||||
mkdir -p ${lib.escapeShellArg downloadDirectory}
|
||||
cd ${lib.escapeShellArg downloadDirectory}
|
||||
${download} "$downloadUrl"
|
||||
else
|
||||
echo "No download URL found in the response: $response"
|
||||
fi
|
||||
;;
|
||||
skip|next|bad|sucks|no|nope|flop|-)
|
||||
${curl}/bin/curl -sS -XPOST "${playlistAPI}/skip"
|
||||
echo ${lib.escapeShellArg (lib.concatStringsSep "\n" messages.bad)} | shuf -n1 | ${sendIRC}
|
||||
;;
|
||||
0|meh|neutral)
|
||||
echo ${lib.escapeShellArg (lib.concatStringsSep "\n" messages.neutral)} | shuf -n1 | ${sendIRC}
|
||||
;;
|
||||
say|msg)
|
||||
shift
|
||||
echo "$@" | ${sendIRC}
|
||||
;;
|
||||
recent)
|
||||
${curl}/bin/curl -sS -XGET "${playlistAPI}/recent" | tac | head
|
||||
;;
|
||||
*)
|
||||
${curl}/bin/curl -sS -XGET "${playlistAPI}/current" \
|
||||
| ${miller}/bin/mlr --ijson --oxtab cat \
|
||||
| ${gnused}/bin/sed -n '/artist\|title\|youtube/p'
|
||||
;;
|
||||
esac
|
||||
wait
|
||||
''
|
||||
# Download the song if a download URL is provided in the string (youtu.be)
|
||||
downloadUrl=$(echo "$response" | grep -oE 'https?://(www\.)?(youtube\.com|youtu\.be)/[^\s]+')
|
||||
if [ -n "$downloadUrl" ]; then
|
||||
echo "Downloading song from URL: $downloadUrl"
|
||||
mkdir -p ${lib.escapeShellArg downloadDirectory}
|
||||
cd ${lib.escapeShellArg downloadDirectory}
|
||||
${download} "$downloadUrl"
|
||||
else
|
||||
echo "No download URL found in the response: $response"
|
||||
fi
|
||||
;;
|
||||
skip|next|bad|sucks|no|nope|flop|-)
|
||||
${curl}/bin/curl -sS -XPOST "${playlistAPI}/skip"
|
||||
echo ${lib.escapeShellArg (lib.concatStringsSep "\n" messages.bad)} | shuf -n1 | ${sendIRC}
|
||||
;;
|
||||
0|meh|neutral)
|
||||
echo ${lib.escapeShellArg (lib.concatStringsSep "\n" messages.neutral)} | shuf -n1 | ${sendIRC}
|
||||
;;
|
||||
say|msg)
|
||||
shift
|
||||
echo "$@" | ${sendIRC}
|
||||
;;
|
||||
recent)
|
||||
${curl}/bin/curl -sS -XGET "${playlistAPI}/recent" | tac | head
|
||||
;;
|
||||
*)
|
||||
${curl}/bin/curl -sS -XGET "${playlistAPI}/current" \
|
||||
| ${miller}/bin/mlr --ijson --oxtab cat \
|
||||
| ${gnused}/bin/sed -n '/artist\|title\|youtube/p'
|
||||
;;
|
||||
esac
|
||||
wait
|
||||
''
|
||||
|
||||
@@ -1,107 +1,108 @@
|
||||
{
|
||||
writers,
|
||||
mpv,
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
arabicStories = "/home/kfm/cloud/syncthing/music/Arabic/Stories";
|
||||
levantineTextbook = "/home/kfm/cloud/syncthing/music/Arabic/Damaszenisch";
|
||||
in
|
||||
writers.writeDashBin "polyglot" ''
|
||||
languages='persian
|
||||
arabic
|
||||
coptic
|
||||
sanskrit
|
||||
levantine
|
||||
hebrew'
|
||||
writers.writeDashBin "polyglot" ''
|
||||
languages='persian
|
||||
arabic
|
||||
coptic
|
||||
sanskrit
|
||||
levantine
|
||||
hebrew'
|
||||
|
||||
kurdish="https://www.youtube.com/channel/UCvutKJerMREoQtzXiQaDNBQ
|
||||
https://www.youtube.com/channel/UCdqSEXLhnsltwN4IESMInDA"
|
||||
kurdish="https://www.youtube.com/channel/UCvutKJerMREoQtzXiQaDNBQ
|
||||
https://www.youtube.com/channel/UCdqSEXLhnsltwN4IESMInDA"
|
||||
|
||||
persian="https://www.youtube.com/playlist?list=PL4aDVDOklYH5MnXNjCeRalFuRZ46I_p8Q
|
||||
https://www.youtube.com/playlist?list=PL4aDVDOklYH404fg2zZoUQR6YcQp4UUrW
|
||||
https://www.youtube.com/playlist?list=PL4aDVDOklYH4FhJZ4cX14HuUVsDJKUifr
|
||||
https://www.youtube.com/playlist?list=PL4aDVDOklYH6i_Od0zD4ZFNqmZVBOTo4z
|
||||
https://www.youtube.com/playlist?list=PL4aDVDOklYH5NuhQvc52KCPO0X64FU_bd
|
||||
https://www.youtube.com/playlist?list=PL4aDVDOklYH6MFQfuQ5VIJmwuKfR1kgUR
|
||||
https://www.youtube.com/playlist?list=PL4aDVDOklYH48_uuVl-AAPbkemzZFvnHH
|
||||
https://www.youtube.com/playlist?list=PL4aDVDOklYH61WM-WmzjZyTFAE7AILb7j
|
||||
https://www.youtube.com/channel/UCGY0LHNDQjt3GQrrc3r3Atw
|
||||
https://www.youtube.com/channel/UC4jgHye1-kjDlY-2StrtVtA
|
||||
https://www.youtube.com/channel/UCf67DKdLhpFW-7c7FZre2Ww
|
||||
https://www.youtube.com/channel/UCLOGyLCPJL99gNriGAhwl7g
|
||||
https://www.youtube.com/channel/UCxV5ZfGJjJhrzy_9am-S4QQ
|
||||
https://www.youtube.com/channel/UCBSF89JJieetWjJTGZhGKJA
|
||||
https://www.youtube.com/channel/UCFGB29XZkEGS1Vw7WplBqIg
|
||||
https://www.youtube.com/channel/UChiyq4qjnAWMNhwPu2KL4yg
|
||||
https://www.youtube.com/channel/UCULxPJn3NjsaXt4Nc-sIZrw
|
||||
https://www.youtube.com/channel/UCYRyoX3ru_BfMiXVCGgRS6w
|
||||
https://www.youtube.com/channel/UCbCvjr0v_-8LmZh9431N84w"
|
||||
persian="https://www.youtube.com/playlist?list=PL4aDVDOklYH5MnXNjCeRalFuRZ46I_p8Q
|
||||
https://www.youtube.com/playlist?list=PL4aDVDOklYH404fg2zZoUQR6YcQp4UUrW
|
||||
https://www.youtube.com/playlist?list=PL4aDVDOklYH4FhJZ4cX14HuUVsDJKUifr
|
||||
https://www.youtube.com/playlist?list=PL4aDVDOklYH6i_Od0zD4ZFNqmZVBOTo4z
|
||||
https://www.youtube.com/playlist?list=PL4aDVDOklYH5NuhQvc52KCPO0X64FU_bd
|
||||
https://www.youtube.com/playlist?list=PL4aDVDOklYH6MFQfuQ5VIJmwuKfR1kgUR
|
||||
https://www.youtube.com/playlist?list=PL4aDVDOklYH48_uuVl-AAPbkemzZFvnHH
|
||||
https://www.youtube.com/playlist?list=PL4aDVDOklYH61WM-WmzjZyTFAE7AILb7j
|
||||
https://www.youtube.com/channel/UCGY0LHNDQjt3GQrrc3r3Atw
|
||||
https://www.youtube.com/channel/UC4jgHye1-kjDlY-2StrtVtA
|
||||
https://www.youtube.com/channel/UCf67DKdLhpFW-7c7FZre2Ww
|
||||
https://www.youtube.com/channel/UCLOGyLCPJL99gNriGAhwl7g
|
||||
https://www.youtube.com/channel/UCxV5ZfGJjJhrzy_9am-S4QQ
|
||||
https://www.youtube.com/channel/UCBSF89JJieetWjJTGZhGKJA
|
||||
https://www.youtube.com/channel/UCFGB29XZkEGS1Vw7WplBqIg
|
||||
https://www.youtube.com/channel/UChiyq4qjnAWMNhwPu2KL4yg
|
||||
https://www.youtube.com/channel/UCULxPJn3NjsaXt4Nc-sIZrw
|
||||
https://www.youtube.com/channel/UCYRyoX3ru_BfMiXVCGgRS6w
|
||||
https://www.youtube.com/channel/UCbCvjr0v_-8LmZh9431N84w"
|
||||
|
||||
hebrew="https://www.youtube.com/playlist?list=PLXU4ackZsIPp2G8XjfpsYso2p3IHyl-bJ
|
||||
https://www.youtube.com/playlist?list=PLXU4ackZsIPqLOWeWZc1frv3VCAohi90p
|
||||
https://www.youtube.com/playlist?list=PLXU4ackZsIPpWWdWvtM3UtZHFKFhmI2mj
|
||||
https://www.youtube.com/playlist?list=PLXU4ackZsIPoz05eaLCHsCv4Wrk4n1g34
|
||||
https://www.youtube.com/channel/UCrMYJpbMhhQZhXi4ui3FKEw
|
||||
https://www.youtube.com/playlist?list=PLXU4ackZsIPombqx98SIPanShjSUSlBW-
|
||||
https://www.youtube.com/playlist?list=PLXU4ackZsIPrdSFUjNdw3eGK-qbtgqt-6
|
||||
https://www.youtube.com/playlist?list=PLXU4ackZsIPrVHjB4P9QrYzJvBKD3MLuA
|
||||
https://www.youtube.com/playlist?list=PLXU4ackZsIPp_7fb7TMyOaaX_ORI6vH29
|
||||
https://www.youtube.com/channel/UCkKmeTinUEU27syZPKrzWQQ
|
||||
https://www.youtube.com/channel/UC2gy2POCchS7JM_UCsZx5dw
|
||||
https://www.youtube.com/channel/UCb2bkA-kSUz4Mj5YJv0zpJQ"
|
||||
hebrew="https://www.youtube.com/playlist?list=PLXU4ackZsIPp2G8XjfpsYso2p3IHyl-bJ
|
||||
https://www.youtube.com/playlist?list=PLXU4ackZsIPqLOWeWZc1frv3VCAohi90p
|
||||
https://www.youtube.com/playlist?list=PLXU4ackZsIPpWWdWvtM3UtZHFKFhmI2mj
|
||||
https://www.youtube.com/playlist?list=PLXU4ackZsIPoz05eaLCHsCv4Wrk4n1g34
|
||||
https://www.youtube.com/channel/UCrMYJpbMhhQZhXi4ui3FKEw
|
||||
https://www.youtube.com/playlist?list=PLXU4ackZsIPombqx98SIPanShjSUSlBW-
|
||||
https://www.youtube.com/playlist?list=PLXU4ackZsIPrdSFUjNdw3eGK-qbtgqt-6
|
||||
https://www.youtube.com/playlist?list=PLXU4ackZsIPrVHjB4P9QrYzJvBKD3MLuA
|
||||
https://www.youtube.com/playlist?list=PLXU4ackZsIPp_7fb7TMyOaaX_ORI6vH29
|
||||
https://www.youtube.com/channel/UCkKmeTinUEU27syZPKrzWQQ
|
||||
https://www.youtube.com/channel/UC2gy2POCchS7JM_UCsZx5dw
|
||||
https://www.youtube.com/channel/UCb2bkA-kSUz4Mj5YJv0zpJQ"
|
||||
|
||||
arabic="https://www.youtube.com/channel/UCbqqV0gO5QbV9iGITdxp-cw
|
||||
https://www.youtube.com/channel/UCxNwNoGEhHg7lGOhthG4r6A
|
||||
https://www.youtube.com/channel/UCmYYUdR85LRVB5yT1Y7DjFA
|
||||
https://www.youtube.com/channel/UCIgFDroRoDYnxBlOGmwJ78A
|
||||
https://www.youtube.com/channel/UCn5ASYdp7CzbFH2qtqjIJ9w
|
||||
https://www.youtube.com/channel/UCD8N8HjsCkCmykfPnVleVRg
|
||||
https://www.youtube.com/channel/UCEmWUZanVYXEzZXYDHzD-iA
|
||||
https://www.youtube.com/channel/UC9rnrMdYzfqdjiuNXV7q8oQ
|
||||
https://live-hls-audio-web-aja.getaj.net/VOICE-AJA/01.m3u8
|
||||
http://asima.out.airtime.pro:8000/asima_a
|
||||
http://edge.mixlr.com/channel/qtgru
|
||||
http://ninarfm.grtvstream.com:8896/stream
|
||||
http://andromeda.shoutca.st:8189/stream
|
||||
http://www.dreamsiteradiocp4.com:8014/stream
|
||||
http://n02.radiojar.com/sxfbks1vfy8uv.mp3
|
||||
http://stream-025.zeno.fm/5y95pu36sm0uv
|
||||
${arabicStories}"
|
||||
arabic="https://www.youtube.com/channel/UCbqqV0gO5QbV9iGITdxp-cw
|
||||
https://www.youtube.com/channel/UCxNwNoGEhHg7lGOhthG4r6A
|
||||
https://www.youtube.com/channel/UCmYYUdR85LRVB5yT1Y7DjFA
|
||||
https://www.youtube.com/channel/UCIgFDroRoDYnxBlOGmwJ78A
|
||||
https://www.youtube.com/channel/UCn5ASYdp7CzbFH2qtqjIJ9w
|
||||
https://www.youtube.com/channel/UCD8N8HjsCkCmykfPnVleVRg
|
||||
https://www.youtube.com/channel/UCEmWUZanVYXEzZXYDHzD-iA
|
||||
https://www.youtube.com/channel/UC9rnrMdYzfqdjiuNXV7q8oQ
|
||||
https://live-hls-audio-web-aja.getaj.net/VOICE-AJA/01.m3u8
|
||||
http://asima.out.airtime.pro:8000/asima_a
|
||||
http://edge.mixlr.com/channel/qtgru
|
||||
http://ninarfm.grtvstream.com:8896/stream
|
||||
http://andromeda.shoutca.st:8189/stream
|
||||
http://www.dreamsiteradiocp4.com:8014/stream
|
||||
http://n02.radiojar.com/sxfbks1vfy8uv.mp3
|
||||
http://stream-025.zeno.fm/5y95pu36sm0uv
|
||||
${arabicStories}"
|
||||
|
||||
levantine_general="https://www.youtube.com/channel/UCe6YxTdT2zsbhG8ThAEssLw
|
||||
https://www.youtube.com/channel/UC8IsrQ3Fvg1X2QboSRIMBHA
|
||||
https://www.youtube.com/channel/UCo65IZihlwP204bleDDuAyA
|
||||
https://www.youtube.com/channel/UCDXBymJu72YX2LzKVlZyZaA
|
||||
https://www.youtube.com/channel/UCpovzufzZSP3kCYm16B5Hyw
|
||||
https://www.youtube.com/channel/UCKkKlH7eJFBWhofiP5kQEFQ
|
||||
https://www.youtube.com/channel/UC-YYp3mws0sa9vI3VUCWqhw
|
||||
https://www.youtube.com/channel/UCpa9WD4btPSyn0h-DZSATGw
|
||||
https://www.youtube.com/channel/UCb7oMrqwZnr3ZCayqnkkb8w
|
||||
https://www.youtube.com/channel/UCuLNZirpkm2HYxq-tTiXnOA
|
||||
https://www.youtube.com/channel/UCSGBoIBGUxUmpTYJfYZXs-A
|
||||
https://www.youtube.com/channel/UCPINCItSdAc7SBXxi6AcWpw
|
||||
https://www.youtube.com/channel/UCbZvzUBn04a_a95HFMX6eTA
|
||||
https://www.youtube.com/channel/UChJs6Kqju9BmN5FMHhBfRSA
|
||||
https://www.youtube.com/channel/UCyC7OV3gEQkguVwl9qDGuTQ
|
||||
https://www.youtube.com/channel/UCwv1qu4iX6Bm6X-uSSB2eBQ
|
||||
${levantineTextbook}"
|
||||
levantine_general="https://www.youtube.com/channel/UCe6YxTdT2zsbhG8ThAEssLw
|
||||
https://www.youtube.com/channel/UC8IsrQ3Fvg1X2QboSRIMBHA
|
||||
https://www.youtube.com/channel/UCo65IZihlwP204bleDDuAyA
|
||||
https://www.youtube.com/channel/UCDXBymJu72YX2LzKVlZyZaA
|
||||
https://www.youtube.com/channel/UCpovzufzZSP3kCYm16B5Hyw
|
||||
https://www.youtube.com/channel/UCKkKlH7eJFBWhofiP5kQEFQ
|
||||
https://www.youtube.com/channel/UC-YYp3mws0sa9vI3VUCWqhw
|
||||
https://www.youtube.com/channel/UCpa9WD4btPSyn0h-DZSATGw
|
||||
https://www.youtube.com/channel/UCb7oMrqwZnr3ZCayqnkkb8w
|
||||
https://www.youtube.com/channel/UCuLNZirpkm2HYxq-tTiXnOA
|
||||
https://www.youtube.com/channel/UCSGBoIBGUxUmpTYJfYZXs-A
|
||||
https://www.youtube.com/channel/UCPINCItSdAc7SBXxi6AcWpw
|
||||
https://www.youtube.com/channel/UCbZvzUBn04a_a95HFMX6eTA
|
||||
https://www.youtube.com/channel/UChJs6Kqju9BmN5FMHhBfRSA
|
||||
https://www.youtube.com/channel/UCyC7OV3gEQkguVwl9qDGuTQ
|
||||
https://www.youtube.com/channel/UCwv1qu4iX6Bm6X-uSSB2eBQ
|
||||
${levantineTextbook}"
|
||||
|
||||
sanskrit="https://www.youtube.com/channel/UCTnCQNG_1WIlunxbp1SAOvw
|
||||
https://stream-23.zeno.fm/m08mkwsyw8quv
|
||||
https://www.youtube.com/channel/UCqFg6QnwgtVHo1iFgpxrx-A"
|
||||
sanskrit="https://www.youtube.com/channel/UCTnCQNG_1WIlunxbp1SAOvw
|
||||
https://stream-23.zeno.fm/m08mkwsyw8quv
|
||||
https://www.youtube.com/channel/UCqFg6QnwgtVHo1iFgpxrx-A"
|
||||
|
||||
language="$(echo "$languages" | shuf -n1)"
|
||||
case "$language" in
|
||||
arabic)
|
||||
${mpv}/bin/mpv --shuffle $arabic;;
|
||||
persian)
|
||||
${mpv}/bin/mpv --shuffle $persian;;
|
||||
coptic)
|
||||
;;
|
||||
sanskrit)
|
||||
${mpv}/bin/mpv --shuffle $sanskrit;;
|
||||
levantine)
|
||||
${mpv}/bin/mpv --shuffle $levantine;;
|
||||
hebrew)
|
||||
${mpv}/bin/mpv --shuffle $hebrew;;
|
||||
esac
|
||||
''
|
||||
language="$(echo "$languages" | shuf -n1)"
|
||||
case "$language" in
|
||||
arabic)
|
||||
${mpv}/bin/mpv --shuffle $arabic;;
|
||||
persian)
|
||||
${mpv}/bin/mpv --shuffle $persian;;
|
||||
coptic)
|
||||
;;
|
||||
sanskrit)
|
||||
${mpv}/bin/mpv --shuffle $sanskrit;;
|
||||
levantine)
|
||||
${mpv}/bin/mpv --shuffle $levantine;;
|
||||
hebrew)
|
||||
${mpv}/bin/mpv --shuffle $hebrew;;
|
||||
esac
|
||||
''
|
||||
|
||||
@@ -15,7 +15,11 @@ buildPythonPackage (finalAttrs: {
|
||||
rev = "2ea25a03af15937916b6768835e056166986c567";
|
||||
sha256 = "1pcf800hl0zkcffc47mkjq9mizsxdi0hwxlnij5bvbqdshd3w9ll";
|
||||
};
|
||||
patches = [./regex-version.patch];
|
||||
propagatedBuildInputs = [backports_functools_lru_cache selenium regex];
|
||||
patches = [ ./regex-version.patch ];
|
||||
propagatedBuildInputs = [
|
||||
backports_functools_lru_cache
|
||||
selenium
|
||||
regex
|
||||
];
|
||||
doCheck = false;
|
||||
})
|
||||
|
||||
@@ -1,6 +1,22 @@
|
||||
{ writers, lib, todoman, khal, util-linux, wego, pass }:
|
||||
{
|
||||
writers,
|
||||
lib,
|
||||
todoman,
|
||||
khal,
|
||||
util-linux,
|
||||
wego,
|
||||
pass,
|
||||
}:
|
||||
writers.writeDashBin "q" ''
|
||||
export PATH=$PATH:${lib.makeBinPath [todoman khal util-linux wego pass]}
|
||||
export PATH=$PATH:${
|
||||
lib.makeBinPath [
|
||||
todoman
|
||||
khal
|
||||
util-linux
|
||||
wego
|
||||
pass
|
||||
]
|
||||
}
|
||||
(todo list --due 240; echo) &
|
||||
(khal list today today; echo) &
|
||||
(cal -3; echo) &
|
||||
|
||||
@@ -1,7 +1,21 @@
|
||||
{ writers, lib, gnused, curl, jq, yq }:
|
||||
{
|
||||
writers,
|
||||
lib,
|
||||
gnused,
|
||||
curl,
|
||||
jq,
|
||||
yq,
|
||||
}:
|
||||
writers.writeBashBin "radio-news" ''
|
||||
set -efu
|
||||
PATH=$PATH:${lib.makeBinPath [gnused curl jq yq]}
|
||||
PATH=$PATH:${
|
||||
lib.makeBinPath [
|
||||
gnused
|
||||
curl
|
||||
jq
|
||||
yq
|
||||
]
|
||||
}
|
||||
|
||||
EVENTS=$(
|
||||
curl https://www.goodnewsnetwork.org/feed/ \
|
||||
|
||||
@@ -1,8 +1,28 @@
|
||||
{ writers, lib, curl, pup, gnused, coreutils, pandoc, gawk, jq }:
|
||||
{
|
||||
writers,
|
||||
lib,
|
||||
curl,
|
||||
pup,
|
||||
gnused,
|
||||
coreutils,
|
||||
pandoc,
|
||||
gawk,
|
||||
jq,
|
||||
}:
|
||||
writers.writeDashBin "random-zeno" ''
|
||||
set -efu
|
||||
|
||||
export PATH=${lib.makeBinPath [ curl pup gnused coreutils pandoc gawk jq ]}
|
||||
export PATH=${
|
||||
lib.makeBinPath [
|
||||
curl
|
||||
pup
|
||||
gnused
|
||||
coreutils
|
||||
pandoc
|
||||
gawk
|
||||
jq
|
||||
]
|
||||
}
|
||||
|
||||
root="http://www.zeno.org"
|
||||
character_limit=350
|
||||
|
||||
@@ -3,10 +3,15 @@
|
||||
writers,
|
||||
imagemagick,
|
||||
ghostscript,
|
||||
lib
|
||||
lib,
|
||||
}:
|
||||
writers.writeDashBin "scanned" ''
|
||||
export PATH=${lib.makeBinPath [ imagemagick ghostscript ]}:$PATH
|
||||
export PATH=${
|
||||
lib.makeBinPath [
|
||||
imagemagick
|
||||
ghostscript
|
||||
]
|
||||
}:$PATH
|
||||
|
||||
[ $# -eq 1 -a -f "$1" -a -r "$1" ] || exit 1
|
||||
|
||||
|
||||
@@ -21,9 +21,16 @@ stdenv.mkDerivation {
|
||||
which
|
||||
libtool
|
||||
];
|
||||
buildInputs = [glib zlib gtk3 libmysqlclient pcre libxml2];
|
||||
buildInputs = [
|
||||
glib
|
||||
zlib
|
||||
gtk3
|
||||
libmysqlclient
|
||||
pcre
|
||||
libxml2
|
||||
];
|
||||
buildPhase = "make";
|
||||
configureFlags = ["--disable-dict"];
|
||||
configureFlags = [ "--disable-dict" ];
|
||||
env.NIX_CFLAGS_COMPILE = toString [
|
||||
"-Wno-error=format-security"
|
||||
];
|
||||
@@ -31,7 +38,7 @@ stdenv.mkDerivation {
|
||||
substituteInPlace tools/src/Makefile.am \
|
||||
--replace-fail noinst_PROGRAMS bin_PROGRAMS
|
||||
'';
|
||||
installFlags = ["INSTALL_PREFIX=$(out)"];
|
||||
installFlags = [ "INSTALL_PREFIX=$(out)" ];
|
||||
autoreconfPhase = ''
|
||||
patchShebangs ./autogen.sh
|
||||
./autogen.sh
|
||||
|
||||
@@ -2582,8 +2582,7 @@ in
|
||||
...
|
||||
}:
|
||||
"${station}\t${desc}\t${stream}"
|
||||
)
|
||||
streams
|
||||
) streams
|
||||
);
|
||||
playlist = writeText "streams.txt" (lib.concatMapStringsSep "\n" (station: station.stream) streams);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ stdenv.mkDerivation {
|
||||
sha256 = "08bzkva9a6b2cfl38p9m22b1cf6yv27xsw6nrvq5ly5nffjm32hv";
|
||||
};
|
||||
dontUnpack = true;
|
||||
buildInputs = [mupdf];
|
||||
buildInputs = [ mupdf ];
|
||||
buildPhase = ''
|
||||
mutool extract $src
|
||||
'';
|
||||
@@ -23,6 +23,6 @@ stdenv.mkDerivation {
|
||||
meta = with lib; {
|
||||
description = "Tocharian font by Lee Wilson";
|
||||
platforms = platforms.all;
|
||||
maintainers = with maintainers; [kmein];
|
||||
maintainers = with maintainers; [ kmein ];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2,12 +2,13 @@
|
||||
fetchurl,
|
||||
writers,
|
||||
gawk,
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
script = fetchurl {
|
||||
url = "https://raw.githubusercontent.com/soimort/translate-shell/gh-pages/trans.awk";
|
||||
hash = "sha256-KT5iRRGtHpBTrPfs0L2e4JW6JrXVTVvgCXeFKFcr1P4=";
|
||||
};
|
||||
in
|
||||
writers.writeDashBin "trans" ''
|
||||
exec ${gawk}/bin/gawk -f ${script} -- "$@"
|
||||
''
|
||||
writers.writeDashBin "trans" ''
|
||||
exec ${gawk}/bin/gawk -f ${script} -- "$@"
|
||||
''
|
||||
|
||||
@@ -8,4 +8,3 @@ writers.writeDashBin "ttspaste" ''
|
||||
''
|
||||
# curl, mpv,
|
||||
# ${curl}/bin/curl -G http://tts.r/api/tts --data-urlencode 'text@-' | ${mpv}/bin/mpv -
|
||||
|
||||
|
||||
@@ -12,41 +12,57 @@
|
||||
xdotool,
|
||||
gawk,
|
||||
fetchFromGitHub,
|
||||
}: let
|
||||
emoji-flags = builtins.fromJSON (builtins.readFile "${fetchFromGitHub {
|
||||
owner = "matiassingers";
|
||||
repo = "emoji-flags";
|
||||
rev = "93ae74505d09bb55a3eb3a511f1dfc0dd60a5347";
|
||||
sha256 = "10j73sx6jb250v37bz2p7w8big0v8da3r6kpqz9xcl667gl8svwx";
|
||||
}}/data.json");
|
||||
emoji-flags-file = writeText "emoji-flags.txt" (lib.strings.concatMapStringsSep "\n" ({
|
||||
emoji,
|
||||
title,
|
||||
...
|
||||
}: "${emoji} ${title}")
|
||||
emoji-flags);
|
||||
unicode-file = runCommand "unicode.txt" {} ''
|
||||
}:
|
||||
let
|
||||
emoji-flags = builtins.fromJSON (
|
||||
builtins.readFile "${
|
||||
fetchFromGitHub {
|
||||
owner = "matiassingers";
|
||||
repo = "emoji-flags";
|
||||
rev = "93ae74505d09bb55a3eb3a511f1dfc0dd60a5347";
|
||||
sha256 = "10j73sx6jb250v37bz2p7w8big0v8da3r6kpqz9xcl667gl8svwx";
|
||||
}
|
||||
}/data.json"
|
||||
);
|
||||
emoji-flags-file = writeText "emoji-flags.txt" (
|
||||
lib.strings.concatMapStringsSep "\n" (
|
||||
{
|
||||
emoji,
|
||||
title,
|
||||
...
|
||||
}:
|
||||
"${emoji} ${title}"
|
||||
) emoji-flags
|
||||
);
|
||||
unicode-file = runCommand "unicode.txt" { } ''
|
||||
${
|
||||
writers.writePython3 "generate.py" {flakeIgnore = ["E501" "E722"];} ''
|
||||
import csv
|
||||
writers.writePython3 "generate.py"
|
||||
{
|
||||
flakeIgnore = [
|
||||
"E501"
|
||||
"E722"
|
||||
];
|
||||
}
|
||||
''
|
||||
import csv
|
||||
|
||||
with open("${
|
||||
fetchurl {
|
||||
url = "https://unicode.org/Public/UCD/latest/ucd/UnicodeData.txt";
|
||||
sha256 = "0wva6ygnh3wrzpzy0kcbc32hz1ydx3k2pqc5xkqrfw83cpnrlvl0";
|
||||
}
|
||||
}", "r") as unicode_data:
|
||||
reader = csv.reader(unicode_data, delimiter=";")
|
||||
next(reader) # skip first row containing \0
|
||||
for row in reader:
|
||||
codepoint = row[0]
|
||||
name = row[1]
|
||||
alternate_name = row[10]
|
||||
try:
|
||||
print(chr(int(codepoint, 16)), codepoint, name, alternate_name, sep=" ")
|
||||
except:
|
||||
continue
|
||||
''
|
||||
with open("${
|
||||
fetchurl {
|
||||
url = "https://unicode.org/Public/UCD/latest/ucd/UnicodeData.txt";
|
||||
sha256 = "0wva6ygnh3wrzpzy0kcbc32hz1ydx3k2pqc5xkqrfw83cpnrlvl0";
|
||||
}
|
||||
}", "r") as unicode_data:
|
||||
reader = csv.reader(unicode_data, delimiter=";")
|
||||
next(reader) # skip first row containing \0
|
||||
for row in reader:
|
||||
codepoint = row[0]
|
||||
name = row[1]
|
||||
alternate_name = row[10]
|
||||
try:
|
||||
print(chr(int(codepoint, 16)), codepoint, name, alternate_name, sep=" ")
|
||||
except:
|
||||
continue
|
||||
''
|
||||
} > $out
|
||||
'';
|
||||
kaomoji-file = writeText "kaomoji.txt" ''
|
||||
@@ -86,26 +102,36 @@
|
||||
𓂸 penis
|
||||
'';
|
||||
in
|
||||
# ref https://github.com/LukeSmithxyz/voidrice/blob/9fe6802122f6e0392c7fe20eefd30437771d7f8e/.local/bin/dmenuunicode
|
||||
writers.writeDashBin "unicodmenu" ''
|
||||
history_file=$HOME/.cache/unicodmenu
|
||||
touch "$history_file"
|
||||
PATH=${lib.makeBinPath [coreutils dmenu gawk gnused libnotify xclip xdotool]}
|
||||
# ref https://github.com/LukeSmithxyz/voidrice/blob/9fe6802122f6e0392c7fe20eefd30437771d7f8e/.local/bin/dmenuunicode
|
||||
writers.writeDashBin "unicodmenu" ''
|
||||
history_file=$HOME/.cache/unicodmenu
|
||||
touch "$history_file"
|
||||
PATH=${
|
||||
lib.makeBinPath [
|
||||
coreutils
|
||||
dmenu
|
||||
gawk
|
||||
gnused
|
||||
libnotify
|
||||
xclip
|
||||
xdotool
|
||||
]
|
||||
}
|
||||
|
||||
all_characters() {
|
||||
tac "$history_file"
|
||||
cat ${kaomoji-file} ${unicode-file} ${emoji-flags-file}
|
||||
}
|
||||
all_characters() {
|
||||
tac "$history_file"
|
||||
cat ${kaomoji-file} ${unicode-file} ${emoji-flags-file}
|
||||
}
|
||||
|
||||
chosen=$(all_characters | awk '!seen[$0]++' | dmenu -p unicode -i -l 10 | tee --append "$history_file" | sed "s/ .*//")
|
||||
chosen=$(all_characters | awk '!seen[$0]++' | dmenu -p unicode -i -l 10 | tee --append "$history_file" | sed "s/ .*//")
|
||||
|
||||
[ "$chosen" != "" ] || exit
|
||||
[ "$chosen" != "" ] || exit
|
||||
|
||||
echo "$chosen" | tr -d '\n' | xclip -selection clipboard
|
||||
echo "$chosen" | tr -d '\n' | xclip -selection clipboard
|
||||
|
||||
if [ -n "$1" ]; then
|
||||
xdotool key Shift+Insert
|
||||
else
|
||||
notify-send --app-name="$(basename "$0")" "'$chosen' copied to clipboard." &
|
||||
fi
|
||||
''
|
||||
if [ -n "$1" ]; then
|
||||
xdotool key Shift+Insert
|
||||
else
|
||||
notify-send --app-name="$(basename "$0")" "'$chosen' copied to clipboard." &
|
||||
fi
|
||||
''
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{pkgs, ...}:
|
||||
{ pkgs, ... }:
|
||||
pkgs.writers.writeDashBin "untilport" ''
|
||||
set -euf
|
||||
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
colorscheme ? null,
|
||||
lib,
|
||||
...
|
||||
}: neovim.override {
|
||||
}:
|
||||
neovim.override {
|
||||
configure = {
|
||||
vimAlias = true;
|
||||
viAlias = true;
|
||||
@@ -17,16 +18,21 @@
|
||||
source ${./init.vim}
|
||||
let g:snippet_directory = '${vimPlugins.friendly-snippets}'
|
||||
luafile ${./init.lua}
|
||||
'' + lib.optionalString (stylixColors != null) (with stylixColors.withHashtag; ''
|
||||
luafile ${writeText "colors.lua" ''
|
||||
require('base16-colorscheme').setup({
|
||||
base00 = '${base00}', base01 = '${base01}', base02 = '${base02}', base03 = '${base03}',
|
||||
base04 = '${base04}', base05 = '${base05}', base06 = '${base06}', base07 = '${base07}',
|
||||
base08 = '${base08}', base09 = '${base09}', base0A = '${base0A}', base0B = '${base0B}',
|
||||
base0C = '${base0C}', base0D = '${base0D}', base0E = '${base0E}', base0F = '${base0F}'
|
||||
})
|
||||
''}
|
||||
'') + lib.optionalString (colorscheme != null) ''
|
||||
''
|
||||
+ lib.optionalString (stylixColors != null) (
|
||||
with stylixColors.withHashtag;
|
||||
''
|
||||
luafile ${writeText "colors.lua" ''
|
||||
require('base16-colorscheme').setup({
|
||||
base00 = '${base00}', base01 = '${base01}', base02 = '${base02}', base03 = '${base03}',
|
||||
base04 = '${base04}', base05 = '${base05}', base06 = '${base06}', base07 = '${base07}',
|
||||
base08 = '${base08}', base09 = '${base09}', base0A = '${base0A}', base0B = '${base0B}',
|
||||
base0C = '${base0C}', base0D = '${base0D}', base0E = '${base0E}', base0F = '${base0F}'
|
||||
})
|
||||
''}
|
||||
''
|
||||
)
|
||||
+ lib.optionalString (colorscheme != null) ''
|
||||
colorscheme ${colorscheme}
|
||||
'';
|
||||
packages.nvim = with vimPlugins; {
|
||||
@@ -60,16 +66,22 @@
|
||||
vim-repeat
|
||||
vim-sensible
|
||||
vim-surround
|
||||
(let version = "1.1.0"; pname = "vim-dim"; in vimUtils.buildVimPlugin {
|
||||
pname = "vim-dim";
|
||||
version = version;
|
||||
src = fetchFromGitHub {
|
||||
owner = "jeffkreeftmeijer";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
sha256 = "sha256-lyTZUgqUEEJRrzGo1FD8/t8KBioPrtB3MmGvPeEVI/g=";
|
||||
};
|
||||
})
|
||||
(
|
||||
let
|
||||
version = "1.1.0";
|
||||
pname = "vim-dim";
|
||||
in
|
||||
vimUtils.buildVimPlugin {
|
||||
pname = "vim-dim";
|
||||
version = version;
|
||||
src = fetchFromGitHub {
|
||||
owner = "jeffkreeftmeijer";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
sha256 = "sha256-lyTZUgqUEEJRrzGo1FD8/t8KBioPrtB3MmGvPeEVI/g=";
|
||||
};
|
||||
}
|
||||
)
|
||||
];
|
||||
opt = [
|
||||
csv
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
{
|
||||
vimUtils,
|
||||
fetchFromGitHub,
|
||||
}: (vimUtils.buildVimPlugin {
|
||||
}:
|
||||
(vimUtils.buildVimPlugin {
|
||||
pname = "cheat.sh-vim";
|
||||
version = "826219d1";
|
||||
src = fetchFromGitHub {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
{
|
||||
vimUtils,
|
||||
fetchFromGitHub,
|
||||
}: (vimUtils.buildVimPlugin {
|
||||
}:
|
||||
(vimUtils.buildVimPlugin {
|
||||
pname = "icalendar.vim";
|
||||
version = "542fff45";
|
||||
src = fetchFromGitHub {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
{
|
||||
vimUtils,
|
||||
fetchFromGitHub,
|
||||
}: (vimUtils.buildVimPlugin {
|
||||
}:
|
||||
(vimUtils.buildVimPlugin {
|
||||
pname = "mdwa.nvim";
|
||||
version = "9f37270";
|
||||
src = fetchFromGitHub {
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
vimUtils,
|
||||
fetchFromGitHub,
|
||||
lib,
|
||||
}: (vimUtils.buildVimPlugin {
|
||||
}:
|
||||
(vimUtils.buildVimPlugin {
|
||||
pname = "vim-ernest";
|
||||
version = "4b99bc3";
|
||||
src = fetchFromGitHub {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
{
|
||||
vimUtils,
|
||||
fetchFromGitHub,
|
||||
}: (vimUtils.buildVimPlugin {
|
||||
}:
|
||||
(vimUtils.buildVimPlugin {
|
||||
pname = "vim-fetch";
|
||||
version = "76c08586";
|
||||
src = fetchFromGitHub {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
{
|
||||
vimUtils,
|
||||
fetchFromGitHub,
|
||||
}: (vimUtils.buildVimPlugin {
|
||||
}:
|
||||
(vimUtils.buildVimPlugin {
|
||||
pname = "vim-reason-plus";
|
||||
version = "c11a2940";
|
||||
src = fetchFromGitHub {
|
||||
|
||||
@@ -12,14 +12,14 @@ stdenv.mkDerivation {
|
||||
rev = "4152496c1946f68a13c648fb7e583ef23dac4eb8";
|
||||
sha256 = "1fsrfx2gs6bqx7wk7pgcji2i2x4alqpsi66aif4kqvnpqfhcfzjd";
|
||||
};
|
||||
phases = ["installPhase"];
|
||||
phases = [ "installPhase" ];
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
sed 's:#!/bin/bash:#!${bash}/bin/bash:' $src/vimv > $out/bin/vimv
|
||||
chmod 755 $out/bin/vimv
|
||||
'';
|
||||
meta = with lib; {
|
||||
homepage = https://github.com/thameera/vimv;
|
||||
homepage = "https://github.com/thameera/vimv";
|
||||
description = "Batch-rename files using Vim";
|
||||
license = licenses.mit;
|
||||
platforms = platforms.all;
|
||||
|
||||
@@ -2,39 +2,51 @@
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
} @ args: let
|
||||
}@args:
|
||||
let
|
||||
# config cannot be declared in the input attribute set because that would
|
||||
# cause callPackage to inject the wrong config. Instead, get it from ...
|
||||
# via args.
|
||||
config = args.config or {};
|
||||
config = args.config or { };
|
||||
|
||||
lib =
|
||||
args.lib //
|
||||
(let
|
||||
attrPaths = let
|
||||
recurse = path: value:
|
||||
if builtins.isAttrs value
|
||||
then lib.mapAttrsToList (name: recurse (path ++ [name])) value
|
||||
else [(lib.nameValuePair path value)];
|
||||
args.lib
|
||||
// (
|
||||
let
|
||||
attrPaths =
|
||||
let
|
||||
recurse =
|
||||
path: value:
|
||||
if builtins.isAttrs value then
|
||||
lib.mapAttrsToList (name: recurse (path ++ [ name ])) value
|
||||
else
|
||||
[ (lib.nameValuePair path value) ];
|
||||
in
|
||||
attrs: lib.flatten (recurse [ ] attrs);
|
||||
toWeechatValue =
|
||||
x:
|
||||
{
|
||||
bool = builtins.toJSON x;
|
||||
string = x;
|
||||
list = lib.concatMapStringsSep "," toWeechatValue x;
|
||||
int = toString x;
|
||||
}
|
||||
.${builtins.typeOf x};
|
||||
in
|
||||
attrs: lib.flatten (recurse [] attrs);
|
||||
toWeechatValue = x:
|
||||
{
|
||||
bool = builtins.toJSON x;
|
||||
string = x;
|
||||
list = lib.concatMapStringsSep "," toWeechatValue x;
|
||||
int = toString x;
|
||||
}
|
||||
.${builtins.typeOf x};
|
||||
in {
|
||||
inherit attrPaths toWeechatValue;
|
||||
{
|
||||
inherit attrPaths toWeechatValue;
|
||||
|
||||
attrPathsSep = sep: attrs: lib.listToAttrs (map (x: x // {name = lib.concatStringsSep sep x.name;}) (attrPaths attrs));
|
||||
attrPathsSep =
|
||||
sep: attrs:
|
||||
lib.listToAttrs (map (x: x // { name = lib.concatStringsSep sep x.name; }) (attrPaths attrs));
|
||||
|
||||
setCommand = name: value: "/set ${name} \"${toWeechatValue value}\"";
|
||||
setCommand = name: value: "/set ${name} \"${toWeechatValue value}\"";
|
||||
|
||||
filterAddreplace = name: filter: "/filter addreplace ${name} ${filter.buffer} ${toWeechatValue filter.tags} ${filter.regex}";
|
||||
});
|
||||
filterAddreplace =
|
||||
name: filter:
|
||||
"/filter addreplace ${name} ${filter.buffer} ${toWeechatValue filter.tags} ${filter.regex}";
|
||||
}
|
||||
);
|
||||
|
||||
cfg = eval.config;
|
||||
|
||||
@@ -45,18 +57,18 @@
|
||||
options = {
|
||||
scripts = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.package;
|
||||
default = [];
|
||||
default = [ ];
|
||||
description = ''
|
||||
some stuff from pkgs.weechatScripts
|
||||
'';
|
||||
};
|
||||
settings = lib.mkOption {
|
||||
type = (pkgs.formats.json {}).type;
|
||||
type = (pkgs.formats.json { }).type;
|
||||
description = ''
|
||||
your weechat config in nix-style syntax.
|
||||
secrets can be defined with \''${my.secret.value}
|
||||
'';
|
||||
default = {};
|
||||
default = { };
|
||||
example = {
|
||||
irc.server_default.nicks = "rick_\\\${sec.data.foo}";
|
||||
irc.server_default.msg_part = "ciao kakao";
|
||||
@@ -69,7 +81,7 @@
|
||||
address = "irc.hackint.org/6697";
|
||||
ssl = true;
|
||||
autoconnect = true;
|
||||
autojoin = ["#krebs"];
|
||||
autojoin = [ "#krebs" ];
|
||||
};
|
||||
weechat.bar.buflist.hidden = true;
|
||||
irc.server.hackint.command = lib.concatStringsSep "\\;" [
|
||||
@@ -78,7 +90,7 @@
|
||||
];
|
||||
filters.playlist_topic = {
|
||||
buffer = "irc.*.#the_playlist";
|
||||
tags = ["irc_topic"];
|
||||
tags = [ "irc_topic" ];
|
||||
regex = "*";
|
||||
};
|
||||
relay = {
|
||||
@@ -95,7 +107,7 @@
|
||||
};
|
||||
files = lib.mkOption {
|
||||
type = lib.types.attrsOf lib.types.str;
|
||||
default = {};
|
||||
default = { };
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
"sec.conf" = toString (pkgs.writeText "sec.conf" '''
|
||||
@@ -117,24 +129,25 @@
|
||||
};
|
||||
|
||||
setFile = pkgs.writeText "weechat.set" (
|
||||
lib.optionalString (cfg.settings != {})
|
||||
(lib.concatStringsSep "\n" (
|
||||
lib.optionals
|
||||
(cfg.settings.irc or {} != {})
|
||||
(lib.mapAttrsToList
|
||||
(name: server: "/server add ${name} ${lib.toWeechatValue server.addresses}")
|
||||
cfg.settings.irc.server)
|
||||
++ lib.optionals
|
||||
(cfg.settings.matrix or {} != {})
|
||||
(lib.mapAttrsToList
|
||||
(name: server: "/matrix server add ${name} ${server.address}")
|
||||
cfg.settings.matrix.server)
|
||||
++ lib.mapAttrsToList lib.setCommand (lib.attrPathsSep "." cfg.settings)
|
||||
++ lib.optionals
|
||||
(cfg.settings.filters or {} != {})
|
||||
(lib.mapAttrsToList lib.filterAddreplace cfg.settings.filters)
|
||||
++ lib.singleton cfg.extraCommands
|
||||
))
|
||||
lib.optionalString (cfg.settings != { }) (
|
||||
lib.concatStringsSep "\n" (
|
||||
lib.optionals (cfg.settings.irc or { } != { }) (
|
||||
lib.mapAttrsToList (
|
||||
name: server: "/server add ${name} ${lib.toWeechatValue server.addresses}"
|
||||
) cfg.settings.irc.server
|
||||
)
|
||||
++ lib.optionals (cfg.settings.matrix or { } != { }) (
|
||||
lib.mapAttrsToList (
|
||||
name: server: "/matrix server add ${name} ${server.address}"
|
||||
) cfg.settings.matrix.server
|
||||
)
|
||||
++ lib.mapAttrsToList lib.setCommand (lib.attrPathsSep "." cfg.settings)
|
||||
++ lib.optionals (cfg.settings.filters or { } != { }) (
|
||||
lib.mapAttrsToList lib.filterAddreplace cfg.settings.filters
|
||||
)
|
||||
++ lib.singleton cfg.extraCommands
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
weechatPkg = pkgs.weechat.override {
|
||||
@@ -148,31 +161,22 @@
|
||||
wrapper = pkgs.writers.writeDashBin "weechat" ''
|
||||
CONFDIR=''${XDG_CONFIG_HOME:-$HOME/.config}/weechat
|
||||
${pkgs.coreutils}/bin/mkdir -p "$CONFDIR"
|
||||
${
|
||||
lib.concatStringsSep "\n"
|
||||
(
|
||||
lib.mapAttrsToList
|
||||
(name: target:
|
||||
/*
|
||||
sh
|
||||
*/
|
||||
''
|
||||
${pkgs.coreutils}/bin/cp ${lib.escapeShellArg target} "$CONFDIR"/${lib.escapeShellArg name}
|
||||
${pkgs.coreutils}/bin/chmod -w "$CONFDIR"/${lib.escapeShellArg name}
|
||||
'')
|
||||
cfg.files
|
||||
)
|
||||
}
|
||||
${lib.concatStringsSep "\n" (
|
||||
lib.mapAttrsToList (name: target: /* sh */ ''
|
||||
${pkgs.coreutils}/bin/cp ${lib.escapeShellArg target} "$CONFDIR"/${lib.escapeShellArg name}
|
||||
${pkgs.coreutils}/bin/chmod -w "$CONFDIR"/${lib.escapeShellArg name}
|
||||
'') cfg.files
|
||||
)}
|
||||
exec ${weechatPkg}/bin/weechat "$@"
|
||||
'';
|
||||
in
|
||||
pkgs.symlinkJoin {
|
||||
name = "weechat-configured";
|
||||
paths = [
|
||||
wrapper
|
||||
weechatPkg
|
||||
];
|
||||
postBuild = ''
|
||||
ln -s ${setFile} $out/weechat.set
|
||||
'';
|
||||
}
|
||||
pkgs.symlinkJoin {
|
||||
name = "weechat-configured";
|
||||
paths = [
|
||||
wrapper
|
||||
weechatPkg
|
||||
];
|
||||
postBuild = ''
|
||||
ln -s ${setFile} $out/weechat.set
|
||||
'';
|
||||
}
|
||||
|
||||
@@ -21,13 +21,13 @@ stdenv.mkDerivation {
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
scripts = ["hotlist2extern.pl"];
|
||||
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];
|
||||
maintainers = with maintainers; [ kmein ];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
jq,
|
||||
runCommand,
|
||||
fetchFromGitHub,
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
online-radio = fetchFromGitHub {
|
||||
owner = "kmein";
|
||||
repo = "online-radio";
|
||||
@@ -10,12 +11,11 @@
|
||||
sha256 = "1q0iagx7df0sd6vl5anvpzyiw4jdwa6c67z45rx622a6cr6m4zzl";
|
||||
};
|
||||
in
|
||||
runCommand "worldradio.m3u" {} ''
|
||||
${jq}/bin/jq --raw-output --slurp 'flatten | map(.url_resolved) | .[]' ${online-radio}/src/data/countries/*.json \
|
||||
| sort \
|
||||
| uniq \
|
||||
> $out
|
||||
''
|
||||
runCommand "worldradio.m3u" { } ''
|
||||
${jq}/bin/jq --raw-output --slurp 'flatten | map(.url_resolved) | .[]' ${online-radio}/src/data/countries/*.json \
|
||||
| sort \
|
||||
| uniq \
|
||||
> $out
|
||||
''
|
||||
# anthoer method for running a world radio using Icecast Directory
|
||||
# curl http://dir.xiph.org/ | pup 'a[href^=http]:contains("Play") attr{href}'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user