mirror of
https://github.com/kmein/niveum
synced 2026-03-16 10:11:08 +01:00
format
This commit is contained in:
@@ -1,50 +1,81 @@
|
||||
let
|
||||
lib = import <nixpkgs/lib>;
|
||||
in rec {
|
||||
in
|
||||
rec {
|
||||
inherit lib;
|
||||
|
||||
input = [
|
||||
{
|
||||
x = ["pool" "zfs"];
|
||||
y = ["mdadm" "raid1"];
|
||||
x = [
|
||||
"pool"
|
||||
"zfs"
|
||||
];
|
||||
y = [
|
||||
"mdadm"
|
||||
"raid1"
|
||||
];
|
||||
}
|
||||
{
|
||||
x = ["pool" "zfs"];
|
||||
y = ["disk" "sda"];
|
||||
x = [
|
||||
"pool"
|
||||
"zfs"
|
||||
];
|
||||
y = [
|
||||
"disk"
|
||||
"sda"
|
||||
];
|
||||
}
|
||||
{
|
||||
x = ["mdadm" "raid1"];
|
||||
y = ["disk" "sdb"];
|
||||
x = [
|
||||
"mdadm"
|
||||
"raid1"
|
||||
];
|
||||
y = [
|
||||
"disk"
|
||||
"sdb"
|
||||
];
|
||||
}
|
||||
{
|
||||
x = ["mdadm" "raid1"];
|
||||
y = ["disk" "sdc"];
|
||||
x = [
|
||||
"mdadm"
|
||||
"raid1"
|
||||
];
|
||||
y = [
|
||||
"disk"
|
||||
"sdc"
|
||||
];
|
||||
}
|
||||
];
|
||||
|
||||
outNodes = node: graph:
|
||||
lib.unique
|
||||
(builtins.map (e: e.y)
|
||||
(builtins.filter (v: v.x == node) graph));
|
||||
outNodes = node: graph: lib.unique (builtins.map (e: e.y) (builtins.filter (v: v.x == node) graph));
|
||||
|
||||
vertices = graph:
|
||||
lib.unique
|
||||
(builtins.map (x: x.y) graph ++ builtins.map (x: x.x) graph);
|
||||
vertices = graph: lib.unique (builtins.map (x: x.y) graph ++ builtins.map (x: x.x) graph);
|
||||
|
||||
deleteVertex = node: graph: (builtins.filter (v: v.x != node && v.y != node) graph);
|
||||
|
||||
findSink = graph:
|
||||
lib.findFirst
|
||||
(v: outNodes v graph == [])
|
||||
(lib.trace graph (builtins.abort "No sink found"))
|
||||
(vertices graph);
|
||||
findSink =
|
||||
graph:
|
||||
lib.findFirst (v: outNodes v graph == [ ]) (lib.trace graph (builtins.abort "No sink found")) (
|
||||
vertices graph
|
||||
);
|
||||
|
||||
topSort = graph:
|
||||
if graph == []
|
||||
then []
|
||||
else if builtins.length graph == 1
|
||||
then let only = builtins.head graph; in [only.y only.x]
|
||||
else let sink = findSink graph; in [sink] ++ topSort (deleteVertex sink graph);
|
||||
topSort =
|
||||
graph:
|
||||
if graph == [ ] then
|
||||
[ ]
|
||||
else if builtins.length graph == 1 then
|
||||
let
|
||||
only = builtins.head graph;
|
||||
in
|
||||
[
|
||||
only.y
|
||||
only.x
|
||||
]
|
||||
else
|
||||
let
|
||||
sink = findSink graph;
|
||||
in
|
||||
[ sink ] ++ topSort (deleteVertex sink graph);
|
||||
|
||||
output = topSort input;
|
||||
}
|
||||
|
||||
@@ -2,11 +2,12 @@
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
darwin = lib.strings.hasSuffix "-darwin" pkgs.stdenv.hostPlatform.system;
|
||||
in {
|
||||
environment.systemPackages =
|
||||
[
|
||||
in
|
||||
{
|
||||
environment.systemPackages = [
|
||||
pkgs.htop
|
||||
pkgs.w3m
|
||||
pkgs.wget
|
||||
@@ -52,7 +53,6 @@ in {
|
||||
pkgs.psmisc # for killall, pstree
|
||||
];
|
||||
|
||||
|
||||
security.wrappers = {
|
||||
pmount = {
|
||||
setuid = true;
|
||||
@@ -75,7 +75,8 @@ in {
|
||||
fi
|
||||
'';
|
||||
|
||||
environment.shellAliases = let
|
||||
environment.shellAliases =
|
||||
let
|
||||
take = pkgs.writers.writeDash "take" ''
|
||||
mkdir "$1" && cd "$1"
|
||||
'';
|
||||
@@ -110,9 +111,10 @@ in {
|
||||
la = "${pkgs.coreutils}/bin/ls --color=auto --time-style=long-iso --almost-all -l";
|
||||
}
|
||||
// (
|
||||
if darwin
|
||||
then {}
|
||||
else {
|
||||
if darwin then
|
||||
{ }
|
||||
else
|
||||
{
|
||||
"ß" = "${pkgs.util-linux}/bin/setsid";
|
||||
ip = "${pkgs.iproute2}/bin/ip -c";
|
||||
# systemd
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
in {
|
||||
}:
|
||||
let
|
||||
in
|
||||
{
|
||||
environment.variables.TERMINAL = "alacritty";
|
||||
|
||||
home-manager.users.me = {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{pkgs, ...}: {
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
programs.bash = {
|
||||
promptInit = ''
|
||||
PS1="$(${pkgs.ncurses}/bin/tput bold)\w \$([[ \$? == 0 ]] && echo \"\[\033[1;32m\]\" || echo \"\[\033[1;31m\]\")\$$(${pkgs.ncurses}/bin/tput sgr0) "'';
|
||||
promptInit = ''PS1="$(${pkgs.ncurses}/bin/tput bold)\w \$([[ \$? == 0 ]] && echo \"\[\033[1;32m\]\" || echo \"\[\033[1;31m\]\")\$$(${pkgs.ncurses}/bin/tput sgr0) "'';
|
||||
interactiveShellInit = ''
|
||||
set -o vi
|
||||
'';
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{pkgs, ...}: {
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
hardware.bluetooth = {
|
||||
enable = true;
|
||||
settings.general = {
|
||||
|
||||
@@ -2,9 +2,11 @@
|
||||
config,
|
||||
inputs,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
autorenkalender = inputs.autorenkalender.packages.x86_64-linux.default;
|
||||
in {
|
||||
in
|
||||
{
|
||||
niveum.bots.autorenkalender = {
|
||||
enable = true;
|
||||
time = "07:00";
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
niveum.bots.celan = {
|
||||
enable = true;
|
||||
time = "08:00";
|
||||
@@ -17,7 +18,8 @@
|
||||
tokenFile = config.age.secrets.mastodon-token-celan.path;
|
||||
language = "de";
|
||||
};
|
||||
command = toString (pkgs.writers.writePython3 "random-celan.py" { libraries = [pkgs.python3Packages.lxml]; } ''
|
||||
command = toString (
|
||||
pkgs.writers.writePython3 "random-celan.py" { libraries = [ pkgs.python3Packages.lxml ]; } ''
|
||||
from lxml import etree
|
||||
import random
|
||||
|
||||
@@ -26,10 +28,12 @@
|
||||
return "".join("".join(t.itertext()) for t in elements).strip()
|
||||
|
||||
|
||||
tree = etree.parse('${pkgs.fetchurl {
|
||||
tree = etree.parse('${
|
||||
pkgs.fetchurl {
|
||||
url = "http://c.krebsco.de/celan.tei.xml";
|
||||
hash = "sha256-HgNmJYfhuwyfm+FcNtnnYWpJpIIU1ElHLeLiIFjF9mE=";
|
||||
}}')
|
||||
}
|
||||
}')
|
||||
root = tree.getroot()
|
||||
|
||||
tei = {"tei": "http://www.tei-c.org/ns/1.0"}
|
||||
@@ -60,7 +64,8 @@
|
||||
current_element = current_element.getparent()
|
||||
|
||||
print("\n\n#PaulCelan #Celan #Lyrik #poetry")
|
||||
'');
|
||||
''
|
||||
);
|
||||
};
|
||||
|
||||
age.secrets = {
|
||||
|
||||
@@ -4,11 +4,13 @@
|
||||
lib,
|
||||
inputs,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
telebots = inputs.telebots.defaultPackage.x86_64-linux;
|
||||
reverseDirectory = "/run/telegram-reverse";
|
||||
proverbDirectory = "/run/telegram-proverb";
|
||||
in {
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./logotheca.nix
|
||||
./transits.nix
|
||||
@@ -25,13 +27,21 @@ in {
|
||||
telegram-token-kmein.file = ../../secrets/telegram-token-kmein.age;
|
||||
};
|
||||
|
||||
systemd.tmpfiles.rules = map (path:
|
||||
systemd.tmpfiles.rules =
|
||||
map
|
||||
(
|
||||
path:
|
||||
pkgs.lib.niveum.tmpfilesConfig {
|
||||
type = "d";
|
||||
mode = "0750";
|
||||
age = "1h";
|
||||
inherit path;
|
||||
}) [reverseDirectory proverbDirectory];
|
||||
}
|
||||
)
|
||||
[
|
||||
reverseDirectory
|
||||
proverbDirectory
|
||||
];
|
||||
|
||||
niveum.passport.services = [
|
||||
{
|
||||
|
||||
@@ -4,9 +4,11 @@
|
||||
inputs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
hesychius = inputs.scripts.outPath + "/hesychius/hesychius.txt";
|
||||
in {
|
||||
in
|
||||
{
|
||||
niveum.bots.hesychius = {
|
||||
enable = true;
|
||||
time = "08:00";
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
niveum.bots.logotheca = {
|
||||
enable = true;
|
||||
time = "08/6:00";
|
||||
|
||||
@@ -3,11 +3,15 @@
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
nachtischsatan-bot = {tokenFile}:
|
||||
pkgs.writers.writePython3 "nachtischsatan-bot" {
|
||||
}:
|
||||
let
|
||||
nachtischsatan-bot =
|
||||
{ tokenFile }:
|
||||
pkgs.writers.writePython3 "nachtischsatan-bot"
|
||||
{
|
||||
libraries = [ pkgs.python3Packages.python-telegram-bot ];
|
||||
} ''
|
||||
}
|
||||
''
|
||||
from telegram.ext import Application, ContextTypes, MessageHandler, filters
|
||||
from telegram import Update
|
||||
import random
|
||||
@@ -25,7 +29,8 @@
|
||||
application.add_handler(MessageHandler(filters.ALL, flubber))
|
||||
application.run_polling()
|
||||
'';
|
||||
in {
|
||||
in
|
||||
{
|
||||
systemd.services.telegram-nachtischsatan = {
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
description = "*flubberflubber*";
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
niveum.bots.nietzsche = {
|
||||
enable = true;
|
||||
time = "08:00";
|
||||
@@ -11,7 +12,8 @@
|
||||
tokenFile = config.age.secrets.mastodon-token-nietzsche.path;
|
||||
language = "de";
|
||||
};
|
||||
command = toString (pkgs.writers.writeBash "random-nietzsche" ''
|
||||
command = toString (
|
||||
pkgs.writers.writeBash "random-nietzsche" ''
|
||||
set -efu
|
||||
random_number=$(( ($RANDOM % 10) + 1 ))
|
||||
if [ "$random_number" -eq 1 ]; then
|
||||
@@ -19,7 +21,8 @@
|
||||
else
|
||||
${pkgs.random-zeno}/bin/random-zeno "/Philosophie/M/Nietzsche,+Friedrich"
|
||||
fi
|
||||
'');
|
||||
''
|
||||
);
|
||||
};
|
||||
|
||||
systemd.timers.bot-nietzsche.timerConfig.RandomizedDelaySec = "10h";
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
niveum.bots.smyth = {
|
||||
enable = true;
|
||||
time = "08:00";
|
||||
@@ -17,7 +18,8 @@
|
||||
tokenFile = config.age.secrets.telegram-token-kmein.path;
|
||||
chatIds = [ "@HerbertWeirSmyth" ];
|
||||
};
|
||||
command = toString (pkgs.writers.writeDash "random-smyth" ''
|
||||
command = toString (
|
||||
pkgs.writers.writeDash "random-smyth" ''
|
||||
set -efu
|
||||
|
||||
good_curl() {
|
||||
@@ -50,7 +52,8 @@
|
||||
| ${pkgs.pandoc}/bin/pandoc -f html -t plain --wrap=none
|
||||
|
||||
printf '\n%s\n\n#AncientGreek' "$url"
|
||||
'');
|
||||
''
|
||||
);
|
||||
};
|
||||
|
||||
systemd.timers.bot-smyth.timerConfig.RandomizedDelaySec = "10h";
|
||||
|
||||
@@ -2,16 +2,27 @@
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
mastodonEndpoint = "https://social.krebsco.de";
|
||||
in {
|
||||
in
|
||||
{
|
||||
systemd.services.bot-tlg-wotd = {
|
||||
# TODO reenable
|
||||
# once https://github.com/NixOS/nixpkgs/pull/462893 is in stable NixOS
|
||||
enable = true;
|
||||
wants = [ "network-online.target" ];
|
||||
startAt = "9:30";
|
||||
path = [ pkgs.jq pkgs.curl pkgs.recode pkgs.deno pkgs.imagemagick pkgs.gawk pkgs.gnugrep pkgs.coreutils ];
|
||||
path = [
|
||||
pkgs.jq
|
||||
pkgs.curl
|
||||
pkgs.recode
|
||||
pkgs.deno
|
||||
pkgs.imagemagick
|
||||
pkgs.gawk
|
||||
pkgs.gnugrep
|
||||
pkgs.coreutils
|
||||
];
|
||||
environment = {
|
||||
NPM_CONFIG_CACHE = "/tmp";
|
||||
CLTK_DATA = "/tmp";
|
||||
@@ -42,9 +53,12 @@ in {
|
||||
|
||||
#ancientgreek #classics #wotd #wordoftheday
|
||||
|
||||
transliteration=$(${pkgs.writers.writePython3 "translit.py" {
|
||||
transliteration=$(${
|
||||
pkgs.writers.writePython3 "translit.py"
|
||||
{
|
||||
libraries = py: [ py.cltk ];
|
||||
} ''
|
||||
}
|
||||
''
|
||||
import sys
|
||||
from cltk.phonology.grc.transcription import Transcriber
|
||||
|
||||
@@ -53,7 +67,8 @@ in {
|
||||
ipa = probert.transcribe(text)
|
||||
|
||||
print(ipa)
|
||||
''} "$compact_word")
|
||||
''
|
||||
} "$compact_word")
|
||||
|
||||
|
||||
photo_path=/tmp/output.png
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
toSymbols = pkgs.writers.writeDash "to-symbols" ''
|
||||
${pkgs.gnused}/bin/sed '
|
||||
s/\bTri\b/△/;
|
||||
@@ -40,7 +41,8 @@
|
||||
s/^\s*//
|
||||
'
|
||||
'';
|
||||
in {
|
||||
in
|
||||
{
|
||||
niveum.bots.transits = {
|
||||
enable = true;
|
||||
time = "*:0/1";
|
||||
@@ -53,7 +55,8 @@ in {
|
||||
tokenFile = config.age.secrets.telegram-token-kmein.path;
|
||||
chatIds = [ "-1001796440545" ];
|
||||
};
|
||||
command = toString (pkgs.writers.writeDash "common-transits" ''
|
||||
command = toString (
|
||||
pkgs.writers.writeDash "common-transits" ''
|
||||
set -efu
|
||||
|
||||
now=$(${pkgs.coreutils}/bin/date +%_H:%M | ${pkgs.gnused}/bin/sed 's/^\s*//')
|
||||
@@ -63,7 +66,8 @@ in {
|
||||
# ./astrolog -Yt -Yd -q 10 22 1999 6:32 -zN Kassel -td $date -R Uranus Neptune Pluto "North Node"
|
||||
./astrolog -qd $date -zN Berlin -Yt -Yd -d -R Uranus Neptune Pluto "North Node" -A 2
|
||||
) | ${toSymbols} | ${pkgs.coreutils}/bin/sort -n | ${pkgs.gnugrep}/bin/grep "^$now" || :
|
||||
'');
|
||||
''
|
||||
);
|
||||
};
|
||||
|
||||
age.secrets = {
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
environment.systemPackages = [
|
||||
pkgs.cro
|
||||
pkgs.tor-browser
|
||||
@@ -13,7 +14,8 @@
|
||||
home-manager.users.me = {
|
||||
programs.firefox = {
|
||||
enable = true;
|
||||
profiles = let
|
||||
profiles =
|
||||
let
|
||||
defaultSettings = {
|
||||
"beacon.enabled" = false;
|
||||
"browser.bookmarks.showMobileBookmarks" = true;
|
||||
@@ -58,7 +60,8 @@
|
||||
"toolkit.telemetry.updatePing.enabled" = false;
|
||||
"ui.prefersReducedMotion" = 1;
|
||||
};
|
||||
in {
|
||||
in
|
||||
{
|
||||
default = {
|
||||
id = 0;
|
||||
isDefault = true;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
services.clipmenu.enable = true;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
systemd.user.services.systemd-tmpfiles-clean = {
|
||||
enable = true;
|
||||
wantedBy = [ "default.target" ];
|
||||
@@ -14,7 +15,8 @@
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.tmpfiles.users.me.rules = map pkgs.lib.niveum.tmpfilesConfig [
|
||||
systemd.user.tmpfiles.users.me.rules =
|
||||
map pkgs.lib.niveum.tmpfilesConfig [
|
||||
{
|
||||
type = "d";
|
||||
mode = "0755";
|
||||
@@ -27,14 +29,26 @@
|
||||
age = "7d";
|
||||
path = "${config.users.users.me.home}/cloud/nextcloud/tmp";
|
||||
}
|
||||
] ++ map (path: pkgs.lib.niveum.tmpfilesConfig {
|
||||
]
|
||||
++
|
||||
map
|
||||
(
|
||||
path:
|
||||
pkgs.lib.niveum.tmpfilesConfig {
|
||||
type = "L+";
|
||||
user = config.users.users.me.name;
|
||||
group = config.users.users.me.group;
|
||||
mode = "0755";
|
||||
argument = "${config.users.users.me.home}/sync/${path}";
|
||||
path = "${config.users.users.me.home}/${path}";
|
||||
}) [".ssh" ".gnupg" ".pki" ".local/share/aerc"];
|
||||
}
|
||||
)
|
||||
[
|
||||
".ssh"
|
||||
".gnupg"
|
||||
".pki"
|
||||
".local/share/aerc"
|
||||
];
|
||||
|
||||
services.gnome.gnome-keyring.enable = true;
|
||||
security.pam.services.lightdm.enableGnomeKeyring = true;
|
||||
@@ -51,14 +65,16 @@
|
||||
wants = [ "network-online.target" ];
|
||||
wantedBy = [ "default.target" ];
|
||||
startAt = "*:00/10";
|
||||
script = let
|
||||
script =
|
||||
let
|
||||
kieran = {
|
||||
user = "kieran";
|
||||
passwordFile = config.age.secrets.nextcloud-password-kieran.path;
|
||||
endpoint = "https://cloud.kmein.de";
|
||||
target = "${config.users.users.me.home}/notes";
|
||||
};
|
||||
in ''
|
||||
in
|
||||
''
|
||||
mkdir -p ${lib.escapeShellArg kieran.target}
|
||||
${pkgs.nextcloud-client}/bin/nextcloudcmd --non-interactive --user ${kieran.user} --password "$(cat ${kieran.passwordFile})" --path /Notes ${lib.escapeShellArg kieran.target} ${kieran.endpoint}
|
||||
'';
|
||||
@@ -77,12 +93,15 @@
|
||||
} | ${pkgs.fzf}/bin/fzf)"
|
||||
exec ${pkgs.zathura}/bin/zathura "$book"
|
||||
'')
|
||||
(let
|
||||
(
|
||||
let
|
||||
kieran = {
|
||||
user = "kieran.meinhardt@gmail.com";
|
||||
passwordFile = config.age.secrets.mega-password.path;
|
||||
};
|
||||
megatools = command: ''${pkgs.megatools}/bin/megatools ${command} --username ${lib.escapeShellArg kieran.user} --password "$(cat ${kieran.passwordFile})"'';
|
||||
megatools =
|
||||
command:
|
||||
''${pkgs.megatools}/bin/megatools ${command} --username ${lib.escapeShellArg kieran.user} --password "$(cat ${kieran.passwordFile})"'';
|
||||
in
|
||||
pkgs.writers.writeDashBin "book-mega" ''
|
||||
set -efu
|
||||
@@ -100,7 +119,8 @@
|
||||
${megatools "get"} "$selection"
|
||||
exec ${pkgs.zathura}/bin/zathura "$(basename "$selection")"
|
||||
)
|
||||
'')
|
||||
''
|
||||
)
|
||||
];
|
||||
|
||||
age.secrets.mega-password = {
|
||||
@@ -122,13 +142,22 @@
|
||||
devices = pkgs.lib.niveum.syncthingIds;
|
||||
folders = {
|
||||
"${config.users.users.me.home}/sync" = {
|
||||
devices = ["kabsa" "manakish" "fatteh"];
|
||||
devices = [
|
||||
"kabsa"
|
||||
"manakish"
|
||||
"fatteh"
|
||||
];
|
||||
label = "sync";
|
||||
versioning.type = "trashcan";
|
||||
versioning.params.cleanoutDays = 100;
|
||||
};
|
||||
"${config.users.users.me.home}/mobile" = {
|
||||
devices = ["kabsa" "manakish" "fatteh" "kibbeh"];
|
||||
devices = [
|
||||
"kabsa"
|
||||
"manakish"
|
||||
"fatteh"
|
||||
"kibbeh"
|
||||
];
|
||||
id = "mobile";
|
||||
label = "mobile";
|
||||
versioning.type = "trashcan";
|
||||
|
||||
@@ -137,7 +137,11 @@ in
|
||||
agent = {
|
||||
enable = true;
|
||||
pinentryPackage = pkgs.pinentry-qt;
|
||||
settings = let defaultCacheTtl = 2 * 60 * 60; in {
|
||||
settings =
|
||||
let
|
||||
defaultCacheTtl = 2 * 60 * 60;
|
||||
in
|
||||
{
|
||||
default-cache-ttl = defaultCacheTtl;
|
||||
max-cache-ttl = 4 * defaultCacheTtl;
|
||||
};
|
||||
@@ -253,7 +257,11 @@ in
|
||||
./mastodon-bot.nix
|
||||
{
|
||||
home-manager.users.me = {
|
||||
xdg.userDirs = let pictures = "${config.users.users.me.home}/cloud/nextcloud/Bilder"; in {
|
||||
xdg.userDirs =
|
||||
let
|
||||
pictures = "${config.users.users.me.home}/cloud/nextcloud/Bilder";
|
||||
in
|
||||
{
|
||||
enable = true;
|
||||
documents = "${config.users.users.me.home}/cloud/nextcloud/Documents";
|
||||
desktop = "/tmp";
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{pkgs, ...}: let
|
||||
{ pkgs, ... }:
|
||||
let
|
||||
nixify = pkgs.writers.writeDashBin "nixify" ''
|
||||
set -efuC
|
||||
|
||||
@@ -16,8 +17,12 @@
|
||||
''${EDITOR:-vim} shell.nix
|
||||
fi
|
||||
'';
|
||||
in {
|
||||
environment.systemPackages = [pkgs.direnv nixify];
|
||||
in
|
||||
{
|
||||
environment.systemPackages = [
|
||||
pkgs.direnv
|
||||
nixify
|
||||
];
|
||||
|
||||
home-manager.users.me.programs.direnv = {
|
||||
enable = true;
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
virtualisation.docker = {
|
||||
enable = true;
|
||||
# for ICE wifi, ref https://gist.github.com/sunsided/7840e89ff4e11b64a2d7503fafa0290c
|
||||
@@ -12,5 +13,8 @@
|
||||
];
|
||||
};
|
||||
users.users.me.extraGroups = [ "docker" ];
|
||||
environment.systemPackages = [pkgs.docker pkgs.docker-compose];
|
||||
environment.systemPackages = [
|
||||
pkgs.docker
|
||||
pkgs.docker-compose
|
||||
];
|
||||
}
|
||||
|
||||
@@ -2,9 +2,11 @@
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
sgr = code: string: ''\u001b[${code}m${string}\u001b[0m'';
|
||||
in {
|
||||
in
|
||||
{
|
||||
environment.systemPackages = [
|
||||
(pkgs.writers.writeDashBin "notifications" ''
|
||||
${pkgs.dunst}/bin/dunstctl history \
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
home-manager.users.me = {
|
||||
services.flameshot = {
|
||||
enable = true;
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
{
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
zip-font = name: arguments: let
|
||||
}:
|
||||
let
|
||||
zip-font =
|
||||
name: arguments:
|
||||
let
|
||||
directory = pkgs.fetchzip arguments;
|
||||
in
|
||||
pkgs.runCommand name { } ''
|
||||
@@ -11,7 +14,9 @@
|
||||
${pkgs.findutils}/bin/find ${directory} -name '*.otf' -exec install '{}' $out/share/fonts/opentype \;
|
||||
${pkgs.findutils}/bin/find ${directory} -name '*.woff' -exec install '{}' $out/share/fonts/woff \;
|
||||
'';
|
||||
simple-ttf = name: arguments: let
|
||||
simple-ttf =
|
||||
name: arguments:
|
||||
let
|
||||
file = pkgs.fetchurl arguments;
|
||||
in
|
||||
pkgs.runCommand name { } ''
|
||||
@@ -57,7 +62,8 @@
|
||||
url = "https://github.com/microsoft/font-tools/raw/1092cb23520967830001a0807eb21d6a44dda522/EgyptianOpenType/font/eot.ttf";
|
||||
sha256 = "1n294vhcx90270pnsw1dbk6izd61fjvbnjrh4hcf98ff3s540x0c";
|
||||
};
|
||||
in {
|
||||
in
|
||||
{
|
||||
fonts = {
|
||||
enableDefaultPackages = true;
|
||||
fontDir.enable = true;
|
||||
@@ -117,10 +123,26 @@ in {
|
||||
vollkorn
|
||||
zilla-slab
|
||||
]; # google-fonts league-of-moveable-type
|
||||
fontconfig.defaultFonts = let emoji = ["Noto Color Emoji"]; in {
|
||||
fontconfig.defaultFonts =
|
||||
let
|
||||
emoji = [ "Noto Color Emoji" ];
|
||||
in
|
||||
{
|
||||
monospace = [ "Noto Sans Mono" ] ++ emoji;
|
||||
serif = ["Noto Serif" "Noto Naskh Arabic" "Noto Serif Devanagari"];
|
||||
sansSerif = ["Noto Sans Display" "Noto Naskh Arabic" "Noto Sans Hebrew" "Noto Sans Devanagari" "Noto Sans CJK JP" "Noto Sans Coptic" "Noto Sans Syriac Western"];
|
||||
serif = [
|
||||
"Noto Serif"
|
||||
"Noto Naskh Arabic"
|
||||
"Noto Serif Devanagari"
|
||||
];
|
||||
sansSerif = [
|
||||
"Noto Sans Display"
|
||||
"Noto Naskh Arabic"
|
||||
"Noto Sans Hebrew"
|
||||
"Noto Sans Devanagari"
|
||||
"Noto Sans CJK JP"
|
||||
"Noto Sans Coptic"
|
||||
"Noto Sans Syriac Western"
|
||||
];
|
||||
inherit emoji;
|
||||
};
|
||||
# xelatex fails with woff files
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
{pkgs, ...}: {
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
programs.fzf = {
|
||||
fuzzyCompletion = true;
|
||||
keybindings = true;
|
||||
};
|
||||
|
||||
home-manager.users.me = {
|
||||
programs.fzf = let
|
||||
programs.fzf =
|
||||
let
|
||||
defaultCommand = "${pkgs.fd}/bin/fd --type f --strip-cwd-prefix --follow --no-ignore-vcs --exclude .git";
|
||||
in {
|
||||
in
|
||||
{
|
||||
enable = true;
|
||||
defaultCommand = defaultCommand;
|
||||
defaultOptions = [ "--height=40%" ];
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
{
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
ledgerDirectory = "/home/kfm/sync/src/ledger";
|
||||
hora = pkgs.callPackage ../packages/hora.nix { timeLedger = "${ledgerDirectory}/time.timeclock"; };
|
||||
in {
|
||||
environment.systemPackages = let
|
||||
in
|
||||
{
|
||||
environment.systemPackages =
|
||||
let
|
||||
git = "${pkgs.git}/bin/git -C ${ledgerDirectory}";
|
||||
in [
|
||||
in
|
||||
[
|
||||
hora
|
||||
pkgs.hledger
|
||||
(pkgs.writers.writeDashBin "hledger-git" ''
|
||||
|
||||
@@ -22,8 +22,18 @@
|
||||
sort_key = "PERCENT_CPU";
|
||||
tree_view = false;
|
||||
update_process_names = false;
|
||||
right_meters = ["Uptime" "Tasks" "LoadAverage" "Battery"];
|
||||
left_meters = ["LeftCPUs2" "RightCPUs2" "Memory" "Swap"];
|
||||
right_meters = [
|
||||
"Uptime"
|
||||
"Tasks"
|
||||
"LoadAverage"
|
||||
"Battery"
|
||||
];
|
||||
left_meters = [
|
||||
"LeftCPUs2"
|
||||
"RightCPUs2"
|
||||
"Memory"
|
||||
"Swap"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
klem = pkgs.klem.override {
|
||||
options.dmenu = "${pkgs.dmenu}/bin/dmenu -i -p klem";
|
||||
options.scripts = {
|
||||
@@ -51,7 +52,8 @@
|
||||
'';
|
||||
};
|
||||
};
|
||||
in {
|
||||
in
|
||||
{
|
||||
age.secrets = {
|
||||
github-token-i3status-rust = {
|
||||
file = ../secrets/github-token-i3status-rust.age;
|
||||
@@ -105,7 +107,8 @@ in {
|
||||
'';
|
||||
};
|
||||
|
||||
home-manager.users.me = let
|
||||
home-manager.users.me =
|
||||
let
|
||||
modifier = "Mod4";
|
||||
infoWorkspace = "ℹ";
|
||||
messageWorkspace = "✉";
|
||||
@@ -122,19 +125,27 @@ in {
|
||||
titlebar = false;
|
||||
border = 1;
|
||||
};
|
||||
bars = let position = "bottom"; in [
|
||||
(lib.recursiveUpdate config.home-manager.users.me.stylix.targets.i3.exportedBarConfig
|
||||
{
|
||||
bars =
|
||||
let
|
||||
position = "bottom";
|
||||
in
|
||||
[
|
||||
(lib.recursiveUpdate config.home-manager.users.me.stylix.targets.i3.exportedBarConfig {
|
||||
workspaceButtons = true;
|
||||
mode = "hide"; # "dock";
|
||||
inherit position;
|
||||
statusCommand = toString (pkgs.writers.writeDash "i3status-rust" ''
|
||||
statusCommand = toString (
|
||||
pkgs.writers.writeDash "i3status-rust" ''
|
||||
export I3RS_GITHUB_TOKEN="$(cat ${config.age.secrets.github-token-i3status-rust.path})"
|
||||
export OPENWEATHERMAP_API_KEY="$(cat ${config.age.secrets.openweathermap-api-key.path})"
|
||||
exec ${config.home-manager.users.me.programs.i3status-rust.package}/bin/i3status-rs ${config.home-manager.users.me.home.homeDirectory}/.config/i3status-rust/config-${position}.toml
|
||||
'');
|
||||
''
|
||||
);
|
||||
fonts = {
|
||||
names = ["${config.stylix.fonts.sansSerif.name}" "FontAwesome 6 Free"];
|
||||
names = [
|
||||
"${config.stylix.fonts.sansSerif.name}"
|
||||
"FontAwesome 6 Free"
|
||||
];
|
||||
size = config.stylix.fonts.sizes.desktop * 0.8;
|
||||
};
|
||||
})
|
||||
@@ -145,19 +156,27 @@ in {
|
||||
hideEdgeBorders = "smart";
|
||||
commands = [
|
||||
{
|
||||
criteria = {class = "floating";};
|
||||
criteria = {
|
||||
class = "floating";
|
||||
};
|
||||
command = "floating enable";
|
||||
}
|
||||
{
|
||||
criteria = {class = "fzfmenu";};
|
||||
criteria = {
|
||||
class = "fzfmenu";
|
||||
};
|
||||
command = "floating enable";
|
||||
}
|
||||
{
|
||||
criteria = {class = ".*";};
|
||||
criteria = {
|
||||
class = ".*";
|
||||
};
|
||||
command = "border pixel 2";
|
||||
}
|
||||
{
|
||||
criteria = {class = "mpv";};
|
||||
criteria = {
|
||||
class = "mpv";
|
||||
};
|
||||
command = lib.strings.concatStringsSep ", " [
|
||||
"floating enable"
|
||||
"sticky enable"
|
||||
@@ -168,17 +187,25 @@ in {
|
||||
}
|
||||
];
|
||||
};
|
||||
colors = let
|
||||
colors =
|
||||
let
|
||||
background = config.lib.stylix.colors.withHashtag.base00;
|
||||
in {
|
||||
in
|
||||
{
|
||||
unfocused = {
|
||||
border = lib.mkForce background;
|
||||
childBorder = lib.mkForce background;
|
||||
};
|
||||
};
|
||||
keybindings =
|
||||
lib.listToAttrs (map (x: lib.nameValuePair "${modifier}+Shift+${toString x}" "move container to workspace ${toString x}") (lib.range 1 9))
|
||||
// lib.listToAttrs (map (x: lib.nameValuePair "${modifier}+${toString x}" "workspace ${toString x}") (lib.range 1 9))
|
||||
lib.listToAttrs (
|
||||
map (
|
||||
x: lib.nameValuePair "${modifier}+Shift+${toString x}" "move container to workspace ${toString x}"
|
||||
) (lib.range 1 9)
|
||||
)
|
||||
// lib.listToAttrs (
|
||||
map (x: lib.nameValuePair "${modifier}+${toString x}" "workspace ${toString x}") (lib.range 1 9)
|
||||
)
|
||||
// {
|
||||
"${modifier}+i" = "workspace ${infoWorkspace}";
|
||||
"${modifier}+m" = "workspace ${messageWorkspace}";
|
||||
@@ -220,12 +247,14 @@ in {
|
||||
"${modifier}+t" = "exec ${lib.getExe pkgs.niveum-filemanager}";
|
||||
"${modifier}+y" = "exec ${lib.getExe pkgs.niveum-browser}";
|
||||
|
||||
"${modifier}+d" = "exec ${pkgs.writers.writeDash "run" ''exec rofi -modi run,ssh,window -show run''}";
|
||||
"${modifier}+d" =
|
||||
"exec ${pkgs.writers.writeDash "run" ''exec rofi -modi run,ssh,window -show run''}";
|
||||
"${modifier}+Shift+d" = "exec ${pkgs.notemenu}/bin/notemenu";
|
||||
"${modifier}+p" = "exec rofi-pass";
|
||||
"${modifier}+Shift+p" = "exec rofi-pass --insert";
|
||||
"${modifier}+u" = "exec ${pkgs.unicodmenu}/bin/unicodmenu";
|
||||
"${modifier}+Shift+u" = "exec ${pkgs.writers.writeDash "last-unicode" ''${pkgs.xdotool}/bin/xdotool type --delay 1000 "$(${pkgs.gawk}/bin/awk 'END{print $1}' ~/.cache/unicodmenu)"''}";
|
||||
"${modifier}+Shift+u" =
|
||||
"exec ${pkgs.writers.writeDash "last-unicode" ''${pkgs.xdotool}/bin/xdotool type --delay 1000 "$(${pkgs.gawk}/bin/awk 'END{print $1}' ~/.cache/unicodmenu)"''}";
|
||||
|
||||
"${modifier}+F7" = "exec ${pkgs.writers.writeDash "showkeys-toggle" ''
|
||||
if ${pkgs.procps}/bin/pgrep screenkey; then
|
||||
@@ -259,7 +288,8 @@ in {
|
||||
# XF86Back
|
||||
# XF86Launch1 (thinkvantage)
|
||||
};
|
||||
in {
|
||||
in
|
||||
{
|
||||
stylix.targets.i3.enable = true;
|
||||
|
||||
xsession.windowManager.i3 = {
|
||||
@@ -277,7 +307,15 @@ in {
|
||||
exec --no-startup-id ${pkgs.xss-lock}/bin/xss-lock -- xsecurelock
|
||||
'';
|
||||
config = {
|
||||
inherit modifier gaps modes bars floating window colors;
|
||||
inherit
|
||||
modifier
|
||||
gaps
|
||||
modes
|
||||
bars
|
||||
floating
|
||||
window
|
||||
colors
|
||||
;
|
||||
keybindings = keybindings // {
|
||||
"${modifier}+F6" = "exec ${pkgs.xorg.xkill}/bin/xkill";
|
||||
"${modifier}+F9" = "exec ${pkgs.redshift}/bin/redshift -O 4000 -b 0.85";
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
age.secrets = {
|
||||
miniflux-api-token = {
|
||||
file = ../secrets/miniflux-api-token.age;
|
||||
@@ -18,9 +19,11 @@
|
||||
bars.bottom = {
|
||||
icons = "awesome6";
|
||||
settings = {
|
||||
theme.overrides = let
|
||||
theme.overrides =
|
||||
let
|
||||
colours = config.lib.stylix.colors.withHashtag;
|
||||
in {
|
||||
in
|
||||
{
|
||||
idle_bg = colours.base00;
|
||||
idle_fg = colours.base05;
|
||||
good_bg = colours.base00;
|
||||
|
||||
@@ -3,14 +3,16 @@
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
davHome = "~/.local/share/dav";
|
||||
kmeinCloud = {
|
||||
davEndpoint = "https://cloud.kmein.de/remote.php/dav";
|
||||
username = "kieran";
|
||||
passwordFile = config.age.secrets.nextcloud-password-kieran.path;
|
||||
};
|
||||
in {
|
||||
in
|
||||
{
|
||||
age.secrets = {
|
||||
nextcloud-password-kieran = {
|
||||
file = ../secrets/nextcloud-password-kieran.age;
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
systemd.services.lb-subscription = {
|
||||
enable = true;
|
||||
wants = [ "network-online.target" ];
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{pkgs, ...}: {
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
systemd.services.imaginary-illuminations = {
|
||||
enable = false;
|
||||
wants = [ "network-online.target" ];
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
services.nginx.virtualHosts.default = {
|
||||
locations."= /stub_status".extraConfig = "stub_status;";
|
||||
};
|
||||
@@ -55,9 +56,7 @@
|
||||
clients = [
|
||||
{
|
||||
url = "http://${
|
||||
if config.networking.hostName == "makanek"
|
||||
then "127.0.0.1"
|
||||
else "makanek.r"
|
||||
if config.networking.hostName == "makanek" then "127.0.0.1" else "makanek.r"
|
||||
}:3100/loki/api/v1/push";
|
||||
}
|
||||
];
|
||||
|
||||
@@ -3,9 +3,11 @@
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
swallow = command: "${pkgs.swallow}/bin/swallow ${command}";
|
||||
in {
|
||||
in
|
||||
{
|
||||
environment.shellAliases.smpv = swallow "mpv";
|
||||
|
||||
nixpkgs.overlays = [
|
||||
@@ -19,7 +21,11 @@ in {
|
||||
enable = true;
|
||||
config = {
|
||||
ytdl-format = "bestvideo[height<=?720][fps<=?30][vcodec!=?vp9]+bestaudio/best";
|
||||
ytdl-raw-options = lib.concatStringsSep "," [''sub-lang="de,en"'' "write-sub=" "write-auto-sub="];
|
||||
ytdl-raw-options = lib.concatStringsSep "," [
|
||||
''sub-lang="de,en"''
|
||||
"write-sub="
|
||||
"write-auto-sub="
|
||||
];
|
||||
screenshot-template = "%F-%wH%wM%wS-%#04n";
|
||||
script-opts = "ytdl_hook-ytdl_path=${pkgs.yt-dlp}/bin/yt-dlp";
|
||||
ao = "pulse"; # no pipewire for me :(
|
||||
|
||||
@@ -3,12 +3,16 @@
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
vim-kmein = (pkgs.vim-kmein.override {
|
||||
}:
|
||||
let
|
||||
vim-kmein = (
|
||||
pkgs.vim-kmein.override {
|
||||
# stylixColors = config.lib.stylix.colors;
|
||||
colorscheme = "base16-gruvbox-dark-medium";
|
||||
});
|
||||
in {
|
||||
}
|
||||
);
|
||||
in
|
||||
{
|
||||
environment.variables.EDITOR = lib.getExe vim-kmein;
|
||||
environment.shellAliases.vi = "nvim";
|
||||
environment.shellAliases.vim = "nvim";
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
{
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
programs.nm-applet.enable = true;
|
||||
|
||||
networking.networkmanager = {
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
environment.systemPackages = [
|
||||
(pkgs.writers.writeDashBin "miniflux-watch-later" ''
|
||||
miniflux_api_token=$(cat ${config.age.secrets.miniflux-api-token.path})
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
nixpkgs = {
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
openweathermap-repo = pkgs.fetchFromGitHub {
|
||||
owner = "ip1981";
|
||||
repo = "openweathermap";
|
||||
@@ -11,7 +12,8 @@
|
||||
};
|
||||
openweathermap = pkgs.haskellPackages.callCabal2nix "openweathermap" openweathermap-repo { };
|
||||
openweathermap-key = lib.strings.fileContents <secrets/openweathermap.key>;
|
||||
in {
|
||||
in
|
||||
{
|
||||
nixpkgs.config.packageOverrides = pkgs: {
|
||||
weather = pkgs.writers.writeDashBin "weather" ''
|
||||
${openweathermap}/bin/openweathermap --api-key ${openweathermap-key} "$@"
|
||||
|
||||
@@ -4,13 +4,16 @@
|
||||
lib,
|
||||
inputs,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
worldradio = pkgs.callPackage ../packages/worldradio.nix { };
|
||||
|
||||
zoteroStyle = {
|
||||
zoteroStyle =
|
||||
{
|
||||
name,
|
||||
sha256,
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
name = "${name}.csl";
|
||||
path = pkgs.fetchurl {
|
||||
url = "https://www.zotero.org/styles/${name}";
|
||||
@@ -32,7 +35,8 @@
|
||||
})
|
||||
];
|
||||
|
||||
astrolog = pkgs.astrolog.overrideAttrs (old:
|
||||
astrolog = pkgs.astrolog.overrideAttrs (
|
||||
old:
|
||||
old
|
||||
// {
|
||||
installPhase = ''
|
||||
@@ -51,8 +55,10 @@
|
||||
/^:I /s/80/120/ # wider text output
|
||||
' $out/astrolog/astrolog.as
|
||||
'';
|
||||
});
|
||||
in {
|
||||
}
|
||||
);
|
||||
in
|
||||
{
|
||||
home-manager.users.me.home.file = {
|
||||
".csl".source = cslDirectory;
|
||||
".local/share/pandoc/csl".source = cslDirectory; # as of pandoc 2.11, it includes citeproc
|
||||
@@ -233,7 +239,11 @@ in {
|
||||
go
|
||||
texlive.combined.scheme-full
|
||||
latexrun
|
||||
(aspellWithDicts (dict: [dict.de dict.en dict.en-computers]))
|
||||
(aspellWithDicts (dict: [
|
||||
dict.de
|
||||
dict.en
|
||||
dict.en-computers
|
||||
]))
|
||||
# haskellPackages.pandoc-citeproc
|
||||
text2pdf
|
||||
lowdown
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
{config, ...}: let
|
||||
{ config, ... }:
|
||||
let
|
||||
user = config.users.users.me.name;
|
||||
in {
|
||||
in
|
||||
{
|
||||
security.polkit.extraConfig = ''
|
||||
polkit.addRule(function(action, subject) {
|
||||
if (subject.user == "${user}" && action.id == "org.freedesktop.systemd1.manage-units") {
|
||||
|
||||
@@ -2,9 +2,11 @@
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
suspend = pkgs.writers.writeDash "suspend" "${pkgs.systemd}/bin/systemctl suspend";
|
||||
in {
|
||||
in
|
||||
{
|
||||
services.power-action = {
|
||||
enable = true;
|
||||
plans.suspend = {
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
{pkgs, lib, ...}: let
|
||||
{ pkgs, lib, ... }:
|
||||
let
|
||||
hp-driver = pkgs.hplip;
|
||||
in {
|
||||
in
|
||||
{
|
||||
services.printing = {
|
||||
enable = true;
|
||||
drivers = [ hp-driver ];
|
||||
@@ -33,4 +35,3 @@ in {
|
||||
HP/hp-officejet_4650_series.ppd.gz
|
||||
drv:///hp/hpcups.drv/hp-officejet_4650_series.ppd
|
||||
*/
|
||||
|
||||
|
||||
@@ -2,8 +2,11 @@
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
networking.hosts = {"42:0:ca48:f98f:63d7:31ce:922b:245d" = ["go"];};
|
||||
}:
|
||||
{
|
||||
networking.hosts = {
|
||||
"42:0:ca48:f98f:63d7:31ce:922b:245d" = [ "go" ];
|
||||
};
|
||||
|
||||
services.tinc.networks.retiolum = {
|
||||
rsaPrivateKeyFile = config.age.secrets.retiolum-rsa.path;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{pkgs, ...}: {
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home-manager.users.me.programs.rofi = {
|
||||
enable = true;
|
||||
pass = {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{pkgs, ...}: {
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa = {
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
lib,
|
||||
inputs,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
locker = x: "https://c.krebsco.de/${x}";
|
||||
dictionaries = {
|
||||
lojban = {
|
||||
@@ -105,9 +106,11 @@
|
||||
sha256 = "0cx086zvb86bmz7i8vnsch4cj4fb0cp165g4hig4982zakj6f2jd";
|
||||
};
|
||||
};
|
||||
sanskrit = let
|
||||
sanskrit =
|
||||
let
|
||||
repo = "https://github.com/indic-dict/stardict-sanskrit/raw/4ebd2d3db5820f7cbe3a649c3d5aa8f83d19b29f";
|
||||
in {
|
||||
in
|
||||
{
|
||||
BoehtlingkRoth = pkgs.fetchzip {
|
||||
url = "${repo}/sa-head/german-entries/tars/Bohtlingk-and-Roth-Grosses-Petersburger-Worterbuch__2021-10-05_14-23-18Z__19MB.tar.gz";
|
||||
sha256 = "13414a8rgd7hd5ffar6nl68nk3ys60wjkgb7m11hp0ahaasmf6ly";
|
||||
@@ -178,9 +181,11 @@
|
||||
};
|
||||
};
|
||||
|
||||
makeStardictDataDir = dicts: pkgs.linkFarm "dictionaries" (lib.mapAttrsToList (name: path: {inherit name path;}) dicts);
|
||||
makeStardictDataDir =
|
||||
dicts: pkgs.linkFarm "dictionaries" (lib.mapAttrsToList (name: path: { inherit name path; }) dicts);
|
||||
|
||||
makeStardict = name: dicts:
|
||||
makeStardict =
|
||||
name: dicts:
|
||||
pkgs.writers.writeDashBin name ''
|
||||
set -efu
|
||||
export SDCV_PAGER=${toString sdcvPager}
|
||||
@@ -188,7 +193,13 @@
|
||||
'';
|
||||
|
||||
sdcvPager = pkgs.writers.writeDash "sdcvPager" ''
|
||||
export PATH=${lib.makeBinPath [pkgs.gnused pkgs.ncurses pkgs.less]}
|
||||
export PATH=${
|
||||
lib.makeBinPath [
|
||||
pkgs.gnused
|
||||
pkgs.ncurses
|
||||
pkgs.less
|
||||
]
|
||||
}
|
||||
sed "
|
||||
s!<sup>1</sup>!¹!gI
|
||||
s!<sup>2</sup>!²!gI
|
||||
@@ -291,7 +302,8 @@
|
||||
s!</\?p[^>]*>!!gI
|
||||
" | less -FR
|
||||
'';
|
||||
in {
|
||||
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";
|
||||
@@ -385,4 +397,3 @@ MacDonell = pkgs.fetchzip {
|
||||
stripRoot = false;
|
||||
};
|
||||
*/
|
||||
|
||||
|
||||
@@ -4,15 +4,17 @@
|
||||
lib,
|
||||
inputs,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
generatedWallpaper = pkgs.runCommand "wallpaper.png" { } ''
|
||||
${inputs.wallpaper-generator.packages.x86_64-linux.wp-gen}/bin/wallpaper-generator lines \
|
||||
--output $out \
|
||||
${lib.concatMapStringsSep " "
|
||||
(n: "--base0${lib.toHexString n}=${config.lib.stylix.colors.withHashtag."base0${lib.toHexString n}"}")
|
||||
(lib.range 0 15)}
|
||||
${lib.concatMapStringsSep " " (
|
||||
n: "--base0${lib.toHexString n}=${config.lib.stylix.colors.withHashtag."base0${lib.toHexString n}"}"
|
||||
) (lib.range 0 15)}
|
||||
'';
|
||||
in {
|
||||
in
|
||||
{
|
||||
# https://danth.github.io/stylix/tricks.html
|
||||
# stylix.image = inputs.wallpapers.outPath + "/meteora/rodrigo-soares-250630.jpg";
|
||||
stylix.enable = true;
|
||||
|
||||
@@ -2,13 +2,20 @@
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
boot.extraModulePackages = with config.boot.kernelPackages; [
|
||||
tp_smapi
|
||||
acpi_call
|
||||
];
|
||||
boot.kernelModules = ["tp_smapi" "acpi_call"];
|
||||
environment.systemPackages = [pkgs.tpacpi-bat pkgs.powertop];
|
||||
boot.kernelModules = [
|
||||
"tp_smapi"
|
||||
"acpi_call"
|
||||
];
|
||||
environment.systemPackages = [
|
||||
pkgs.tpacpi-bat
|
||||
pkgs.powertop
|
||||
];
|
||||
|
||||
services.tlp = {
|
||||
enable = true;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{pkgs, ...}: {
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
environment.systemPackages = [
|
||||
pkgs.tmuxp
|
||||
pkgs.reptyr # move programs over to a tmux session
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
{pkgs, ...}: {
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
services.tor.enable = true;
|
||||
services.tor.client.enable = true;
|
||||
environment.systemPackages = [pkgs.tor pkgs.torsocks];
|
||||
environment.systemPackages = [
|
||||
pkgs.tor
|
||||
pkgs.torsocks
|
||||
];
|
||||
}
|
||||
|
||||
@@ -3,9 +3,14 @@
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
username = "meinhak99";
|
||||
fu-defaults = let mailhost = "mail.zedat.fu-berlin.de"; in {
|
||||
fu-defaults =
|
||||
let
|
||||
mailhost = "mail.zedat.fu-berlin.de";
|
||||
in
|
||||
{
|
||||
imap.host = mailhost;
|
||||
imap.port = 993;
|
||||
imap.tls.enable = true;
|
||||
@@ -16,7 +21,8 @@
|
||||
folders.sent = "Gesendet";
|
||||
folders.trash = "Papierkorb";
|
||||
};
|
||||
in {
|
||||
in
|
||||
{
|
||||
home-manager.users.me = {
|
||||
programs.ssh = {
|
||||
matchBlocks = {
|
||||
@@ -28,9 +34,7 @@ in {
|
||||
};
|
||||
};
|
||||
accounts.email.accounts = {
|
||||
letos =
|
||||
lib.recursiveUpdate pkgs.lib.niveum.email.defaults
|
||||
{
|
||||
letos = lib.recursiveUpdate pkgs.lib.niveum.email.defaults {
|
||||
userName = "slfletos";
|
||||
address = "letos.sprachlit@hu-berlin.de";
|
||||
passwordCommand = "${pkgs.coreutils}/bin/cat ${config.age.secrets.email-password-letos.path}";
|
||||
@@ -40,10 +44,12 @@ in {
|
||||
smtp.port = 25;
|
||||
smtp.tls.useStartTls = true;
|
||||
};
|
||||
fu =
|
||||
lib.recursiveUpdate pkgs.lib.niveum.email.defaults
|
||||
(lib.recursiveUpdate fu-defaults
|
||||
(let userName = "meinhak99"; in {
|
||||
fu = lib.recursiveUpdate pkgs.lib.niveum.email.defaults (
|
||||
lib.recursiveUpdate fu-defaults (
|
||||
let
|
||||
userName = "meinhak99";
|
||||
in
|
||||
{
|
||||
userName = userName;
|
||||
address = "kieran.meinhardt@fu-berlin.de";
|
||||
aliases = [ "${userName}@fu-berlin.de" ];
|
||||
@@ -52,7 +58,9 @@ in {
|
||||
enable = true;
|
||||
settings.backend = "imap";
|
||||
};
|
||||
}));
|
||||
}
|
||||
)
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
@@ -82,7 +90,8 @@ in {
|
||||
system.fsPackages = [ pkgs.sshfs ];
|
||||
|
||||
# https://www.zedat.fu-berlin.de/tip4u_157.pdf
|
||||
fileSystems = let
|
||||
fileSystems =
|
||||
let
|
||||
fu-berlin-cifs-options = [
|
||||
"uid=${toString config.users.users.me.uid}"
|
||||
"gid=${toString config.users.groups.users.gid}"
|
||||
@@ -111,30 +120,27 @@ in {
|
||||
];
|
||||
};
|
||||
};
|
||||
in home-directory-mount "meinhak99";
|
||||
in
|
||||
home-directory-mount "meinhak99";
|
||||
|
||||
environment.systemPackages = [
|
||||
(pkgs.writers.writeDashBin "hu-vpn-split" ''
|
||||
${pkgs.openfortivpn}/bin/openfortivpn \
|
||||
--password="$(cat "${config.age.secrets.email-password-letos.path}")" \
|
||||
--config=${
|
||||
pkgs.writeText "hu-berlin-split.config" ''
|
||||
--config=${pkgs.writeText "hu-berlin-split.config" ''
|
||||
host = forti-ssl.vpn.hu-berlin.de
|
||||
port = 443
|
||||
username = slfletos@split_tunnel
|
||||
''
|
||||
}
|
||||
''}
|
||||
'')
|
||||
(pkgs.writers.writeDashBin "hu-vpn-full" ''
|
||||
${pkgs.openfortivpn}/bin/openfortivpn \
|
||||
--password="$(cat "${config.age.secrets.email-password-letos.path}")" \
|
||||
--config=${
|
||||
pkgs.writeText "hu-berlin-full.config" ''
|
||||
--config=${pkgs.writeText "hu-berlin-full.config" ''
|
||||
host = forti-ssl.vpn.hu-berlin.de
|
||||
port = 443
|
||||
username = slfletos@tunnel_all
|
||||
''
|
||||
}
|
||||
''}
|
||||
'')
|
||||
(pkgs.writers.writeDashBin "fu-vpn" ''
|
||||
if ${pkgs.wirelesstools}/bin/iwgetid | ${pkgs.gnugrep}/bin/grep --invert-match eduroam
|
||||
|
||||
@@ -1 +1,4 @@
|
||||
{pkgs, ...}: {environment.systemPackages = [pkgs.vscode];}
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
environment.systemPackages = [ pkgs.vscode ];
|
||||
}
|
||||
|
||||
@@ -2,11 +2,13 @@
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
# url = "http://wallpaper.r/realwallpaper-krebs-stars-berlin.png";
|
||||
url = "http://wallpaper.r/realwallpaper-krebs.png";
|
||||
stateDir = "~/.cache/wallpaper";
|
||||
in {
|
||||
in
|
||||
{
|
||||
systemd.user.services.wallpaper = {
|
||||
wantedBy = [ "graphical-session.target" ];
|
||||
after = [ "network.target" ];
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
environment.systemPackages = [ pkgs.watson ];
|
||||
|
||||
environment.variables.WATSON_DIR = "${config.users.users.me.home}/cloud/Seafile/Documents/watson";
|
||||
|
||||
@@ -2,23 +2,32 @@
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
promptColours.success = "cyan";
|
||||
promptColours.failure = "red";
|
||||
in {
|
||||
programs.zsh = let
|
||||
in
|
||||
{
|
||||
programs.zsh =
|
||||
let
|
||||
zsh-completions = pkgs.fetchFromGitHub {
|
||||
owner = "zsh-users";
|
||||
repo = "zsh-completions";
|
||||
rev = "cf565254e26bb7ce03f51889e9a29953b955b1fb";
|
||||
sha256 = "1yf4rz99acdsiy0y1v3bm65xvs2m0sl92ysz0rnnrlbd5amn283l";
|
||||
};
|
||||
in {
|
||||
in
|
||||
{
|
||||
enable = true;
|
||||
enableCompletion = true;
|
||||
autosuggestions.enable = true;
|
||||
syntaxHighlighting.enable = true;
|
||||
syntaxHighlighting.highlighters = ["main" "brackets" "pattern" "line"];
|
||||
syntaxHighlighting.highlighters = [
|
||||
"main"
|
||||
"brackets"
|
||||
"pattern"
|
||||
"line"
|
||||
];
|
||||
interactiveShellInit = ''
|
||||
setopt INTERACTIVE_COMMENTS CORRECT
|
||||
setopt MULTIOS
|
||||
|
||||
@@ -452,6 +452,8 @@
|
||||
};
|
||||
};
|
||||
|
||||
formatter = eachSupportedSystem (system: nixpkgs.legacyPackages.${system}.nixfmt-tree);
|
||||
|
||||
packages = eachSupportedSystem (
|
||||
system:
|
||||
let
|
||||
|
||||
@@ -2,26 +2,34 @@
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
# watcher scripts
|
||||
url = address:
|
||||
url =
|
||||
address:
|
||||
pkgs.writers.writeDash "watch-url" ''
|
||||
${pkgs.curl}/bin/curl -sSL ${lib.escapeShellArg address} \
|
||||
| ${pkgs.python3Packages.html2text}/bin/html2text --decode-errors=ignore
|
||||
'';
|
||||
urlSelector = selector: address:
|
||||
urlSelector =
|
||||
selector: address:
|
||||
pkgs.writers.writeDash "watch-url-selector" ''
|
||||
${pkgs.curl}/bin/curl -sSL ${lib.escapeShellArg address} \
|
||||
| ${pkgs.htmlq}/bin/htmlq ${lib.escapeShellArg selector} \
|
||||
| ${pkgs.python3Packages.html2text}/bin/html2text
|
||||
'';
|
||||
urlJSON = {jqScript ? "."}: address:
|
||||
urlJSON =
|
||||
{
|
||||
jqScript ? ".",
|
||||
}:
|
||||
address:
|
||||
pkgs.writers.writeDash "watch-url-json" ''
|
||||
${pkgs.curl}/bin/curl -sSL ${lib.escapeShellArg address} | ${pkgs.jq}/bin/jq -f ${pkgs.writeText "script.jq" jqScript}
|
||||
'';
|
||||
|
||||
# reporter scripts
|
||||
kpaste-irc = {
|
||||
kpaste-irc =
|
||||
{
|
||||
target,
|
||||
retiolumLink ? false,
|
||||
server ? "irc.r",
|
||||
@@ -30,11 +38,7 @@
|
||||
}:
|
||||
pkgs.writers.writeDash "kpaste-irc-reporter" ''
|
||||
KPASTE_CONTENT_TYPE=text/plain ${pkgs.kpaste}/bin/kpaste \
|
||||
| ${pkgs.gnused}/bin/sed -n "${
|
||||
if retiolumLink
|
||||
then "2"
|
||||
else "3"
|
||||
}s/^/${messagePrefix}/p" \
|
||||
| ${pkgs.gnused}/bin/sed -n "${if retiolumLink then "2" else "3"}s/^/${messagePrefix}/p" \
|
||||
| ${pkgs.nur.repos.mic92.ircsink}/bin/ircsink \
|
||||
--nick ${nick} \
|
||||
--server ${server} \
|
||||
|
||||
@@ -84,7 +84,11 @@ in
|
||||
Type = "simple";
|
||||
ExecStart = ''
|
||||
${lib.getExe cfg.package} \
|
||||
${lib.optionalString (cfg.contactInstructions != null) ("--contact " + lib.escapeShellArg cfg.contactInstructions)} \
|
||||
${
|
||||
lib.optionalString (cfg.contactInstructions != null) (
|
||||
"--contact " + lib.escapeShellArg cfg.contactInstructions
|
||||
)
|
||||
} \
|
||||
--host ${cfg.host} \
|
||||
--index ${pkgs.writeText "index.html" cfg.homePageTemplate} \
|
||||
--listen ${cfg.listenAddress} \
|
||||
|
||||
@@ -4,12 +4,14 @@
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
with lib;
|
||||
let
|
||||
cfg = config.services.moodle-dl;
|
||||
json = pkgs.formats.json { };
|
||||
moodle-dl-json = json.generate "moodle-dl.json" cfg.settings;
|
||||
stateDirectoryDefault = "/var/lib/moodle-dl";
|
||||
in {
|
||||
in
|
||||
{
|
||||
options = {
|
||||
services.moodle-dl = {
|
||||
enable = mkEnableOption "moodle-dl, a Moodle downloader";
|
||||
|
||||
@@ -3,11 +3,13 @@
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
options.services.panoptikon = {
|
||||
enable = lib.mkEnableOption "Generic command output / website watcher";
|
||||
watchers = lib.mkOption {
|
||||
type = lib.types.attrsOf (lib.types.submodule (watcher: {
|
||||
type = lib.types.attrsOf (
|
||||
lib.types.submodule (watcher: {
|
||||
options = {
|
||||
script = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
@@ -55,11 +57,13 @@
|
||||
};
|
||||
};
|
||||
config = { };
|
||||
}));
|
||||
})
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
config = let
|
||||
config =
|
||||
let
|
||||
cfg = config.services.panoptikon;
|
||||
in
|
||||
lib.mkIf cfg.enable {
|
||||
@@ -72,14 +76,15 @@
|
||||
|
||||
users.extraGroups.panoptikon = { };
|
||||
|
||||
systemd.timers = lib.attrsets.mapAttrs' (watcherName: _:
|
||||
systemd.timers = lib.attrsets.mapAttrs' (
|
||||
watcherName: _:
|
||||
lib.nameValuePair "panoptikon-${watcherName}" {
|
||||
timerConfig.RandomizedDelaySec = toString (60 * 60);
|
||||
})
|
||||
cfg.watchers;
|
||||
}
|
||||
) cfg.watchers;
|
||||
|
||||
systemd.services =
|
||||
lib.attrsets.mapAttrs' (watcherName: watcherOptions:
|
||||
systemd.services = lib.attrsets.mapAttrs' (
|
||||
watcherName: watcherOptions:
|
||||
lib.nameValuePair "panoptikon-${watcherName}" {
|
||||
enable = true;
|
||||
startAt = watcherOptions.frequency;
|
||||
@@ -101,14 +106,18 @@
|
||||
script = ''
|
||||
set -fux
|
||||
${watcherOptions.script} > ${lib.escapeShellArg watcherName}
|
||||
diff_output=$(${pkgs.diffutils}/bin/diff --new-file ${lib.escapeShellArg (watcherName + ".old")} ${lib.escapeShellArg watcherName} || :)
|
||||
diff_output=$(${pkgs.diffutils}/bin/diff --new-file ${
|
||||
lib.escapeShellArg (watcherName + ".old")
|
||||
} ${lib.escapeShellArg watcherName} || :)
|
||||
if [ -n "$diff_output" ]
|
||||
then
|
||||
${lib.strings.concatMapStringsSep "\n" (reporter: ''echo "$diff_output" | ${reporter} || :'') watcherOptions.reporters}
|
||||
${lib.strings.concatMapStringsSep "\n" (
|
||||
reporter: ''echo "$diff_output" | ${reporter} || :''
|
||||
) watcherOptions.reporters}
|
||||
fi
|
||||
mv ${lib.escapeShellArg watcherName} ${lib.escapeShellArg (watcherName + ".old")}
|
||||
'';
|
||||
})
|
||||
cfg.watchers;
|
||||
}
|
||||
) cfg.watchers;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
cfg = config.niveum.passport;
|
||||
sortOn = a: lib.sort (as1: as2: lib.lessThan (lib.getAttr a as1) (lib.getAttr a as2));
|
||||
css = ''
|
||||
@@ -52,7 +53,8 @@
|
||||
}
|
||||
'';
|
||||
in
|
||||
with lib; {
|
||||
with lib;
|
||||
{
|
||||
options.niveum.passport = {
|
||||
enable = mkEnableOption "server passport";
|
||||
|
||||
@@ -63,7 +65,8 @@ in
|
||||
};
|
||||
|
||||
services = mkOption {
|
||||
type = types.listOf (types.submodule {
|
||||
type = types.listOf (
|
||||
types.submodule {
|
||||
options = {
|
||||
title = mkOption { type = types.str; };
|
||||
link = mkOption {
|
||||
@@ -75,7 +78,8 @@ in
|
||||
default = "";
|
||||
};
|
||||
};
|
||||
});
|
||||
}
|
||||
);
|
||||
default = [ ];
|
||||
};
|
||||
};
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
with lib;
|
||||
let
|
||||
cfg = config.services.power-action;
|
||||
|
||||
out = {
|
||||
@@ -27,7 +28,8 @@ with lib; let
|
||||
default = "*:0/1";
|
||||
};
|
||||
plans = mkOption {
|
||||
type = with types;
|
||||
type =
|
||||
with types;
|
||||
attrsOf (submodule {
|
||||
options = {
|
||||
charging = mkOption {
|
||||
@@ -71,14 +73,18 @@ with lib; let
|
||||
state="$(${state})"
|
||||
${concatStringsSep "\n" (mapAttrsToList writeRule cfg.plans)}
|
||||
'';
|
||||
charging_check = plan:
|
||||
if (plan.charging == null)
|
||||
then ""
|
||||
else if plan.charging
|
||||
then ''&& [ "$state" = "true" ]''
|
||||
else ''&& ! [ "$state" = "true" ]'';
|
||||
charging_check =
|
||||
plan:
|
||||
if (plan.charging == null) then
|
||||
""
|
||||
else if plan.charging then
|
||||
''&& [ "$state" = "true" ]''
|
||||
else
|
||||
''&& ! [ "$state" = "true" ]'';
|
||||
|
||||
writeRule = _: plan: "if [ $power -ge ${toString plan.lowerLimit} ] && [ $power -le ${toString plan.upperLimit} ] ${charging_check plan}; then ${plan.action}; fi";
|
||||
writeRule =
|
||||
_: plan:
|
||||
"if [ $power -ge ${toString plan.lowerLimit} ] && [ $power -le ${toString plan.upperLimit} ] ${charging_check plan}; then ${plan.action}; fi";
|
||||
|
||||
powerlvl = pkgs.writers.writeDash "powerlvl" ''
|
||||
cat /sys/class/power_supply/${cfg.battery}/capacity
|
||||
|
||||
@@ -4,10 +4,12 @@
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
with lib;
|
||||
let
|
||||
netname = "retiolum";
|
||||
cfg = config.networking.retiolum;
|
||||
in {
|
||||
in
|
||||
{
|
||||
options = {
|
||||
networking.retiolum.ipv4 = mkOption {
|
||||
type = types.str;
|
||||
@@ -33,10 +35,9 @@ 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 = ''
|
||||
|
||||
@@ -4,13 +4,15 @@
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; {
|
||||
with lib;
|
||||
{
|
||||
options.niveum = {
|
||||
wirelessInterface = mkOption { type = types.str; };
|
||||
|
||||
batteryName = mkOption { type = types.str; };
|
||||
|
||||
promptColours = let
|
||||
promptColours =
|
||||
let
|
||||
colours16 = types.enum [
|
||||
"black"
|
||||
"red"
|
||||
@@ -21,7 +23,8 @@ with lib; {
|
||||
"cyan"
|
||||
"white"
|
||||
];
|
||||
in {
|
||||
in
|
||||
{
|
||||
success = mkOption {
|
||||
type = colours16;
|
||||
default = "green";
|
||||
|
||||
@@ -4,20 +4,25 @@
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
with lib;
|
||||
let
|
||||
cfg = config.niveum.bots;
|
||||
|
||||
botService = name: bot:
|
||||
botService =
|
||||
name: bot:
|
||||
nameValuePair "bot-${name}" {
|
||||
enable = bot.enable;
|
||||
startAt = bot.time;
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
LoadCredential = lib.optionals (bot.telegram.enable) [
|
||||
LoadCredential =
|
||||
lib.optionals (bot.telegram.enable) [
|
||||
"telegram-token:${bot.telegram.tokenFile}"
|
||||
] ++ lib.optionals (bot.mastodon.enable) [
|
||||
]
|
||||
++ lib.optionals (bot.mastodon.enable) [
|
||||
"mastodon-token:${bot.mastodon.tokenFile}"
|
||||
] ++ lib.optionals (bot.matrix.enable) [
|
||||
]
|
||||
++ lib.optionals (bot.matrix.enable) [
|
||||
"matrix-token:${bot.matrix.tokenFile}"
|
||||
];
|
||||
};
|
||||
@@ -30,12 +35,14 @@ with lib; let
|
||||
${lib.optionalString (bot.matrix.enable) ''
|
||||
export MATRIX_TOKEN="$(cat "$CREDENTIALS_DIRECTORY/matrix-token")"
|
||||
export JSON_PAYLOAD=$(${pkgs.jq}/bin/jq -n --arg msgtype "m.text" --arg body "$QUOTE" '{msgtype: $msgtype, body: $body}')
|
||||
${strings.concatStringsSep "\n" (map (chatId: ''
|
||||
${strings.concatStringsSep "\n" (
|
||||
map (chatId: ''
|
||||
${pkgs.curl}/bin/curl -X POST "https://${bot.matrix.homeserver}/_matrix/client/r0/rooms/${chatId}/send/m.room.message" \
|
||||
-d "$JSON_PAYLOAD" \
|
||||
-H "Authorization: Bearer $MATRIX_TOKEN" \
|
||||
-H "Content-Type: application/json"
|
||||
'') bot.matrix.chatIds)}
|
||||
'') bot.matrix.chatIds
|
||||
)}
|
||||
''}
|
||||
|
||||
${lib.optionalString (bot.mastodon.enable) ''
|
||||
@@ -49,22 +56,26 @@ with lib; let
|
||||
|
||||
${lib.optionalString (bot.telegram.enable) ''
|
||||
export TELEGRAM_TOKEN="$(cat "$CREDENTIALS_DIRECTORY/telegram-token")"
|
||||
${strings.concatStringsSep "\n" (map (chatId: ''
|
||||
${strings.concatStringsSep "\n" (
|
||||
map (chatId: ''
|
||||
${pkgs.curl}/bin/curl -X POST "https://api.telegram.org/bot''${TELEGRAM_TOKEN}/sendMessage" \
|
||||
-d chat_id="${chatId}" \
|
||||
-d text="$QUOTE" ${
|
||||
lib.strings.optionalString (bot.telegram.parseMode != null)
|
||||
"-d parse_mode=${bot.telegram.parseMode}"
|
||||
lib.strings.optionalString (
|
||||
bot.telegram.parseMode != null
|
||||
) "-d parse_mode=${bot.telegram.parseMode}"
|
||||
} | ${pkgs.jq}/bin/jq -e .ok
|
||||
'')
|
||||
bot.telegram.chatIds)}
|
||||
'') bot.telegram.chatIds
|
||||
)}
|
||||
''}
|
||||
fi
|
||||
'';
|
||||
};
|
||||
in {
|
||||
in
|
||||
{
|
||||
options.niveum.bots = mkOption {
|
||||
type = types.attrsOf (types.submodule {
|
||||
type = types.attrsOf (
|
||||
types.submodule {
|
||||
options = {
|
||||
enable = mkEnableOption "Mastodon and Telegram bot";
|
||||
time = mkOption { type = types.str; };
|
||||
@@ -111,16 +122,24 @@ in {
|
||||
type = types.listOf (types.strMatching "-?[0-9]+|@[A-Za-z0-9]+");
|
||||
};
|
||||
parseMode = mkOption {
|
||||
type = types.nullOr (types.enum ["HTML" "Markdown"]);
|
||||
type = types.nullOr (
|
||||
types.enum [
|
||||
"HTML"
|
||||
"Markdown"
|
||||
]
|
||||
);
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
});
|
||||
}
|
||||
);
|
||||
default = { };
|
||||
};
|
||||
|
||||
config = {systemd.services = attrsets.mapAttrs' botService cfg;};
|
||||
config = {
|
||||
systemd.services = attrsets.mapAttrs' botService cfg;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -3,12 +3,14 @@
|
||||
haskell,
|
||||
haskellPackages,
|
||||
}:
|
||||
writers.writeHaskellBin "betacode" {
|
||||
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
|
||||
|
||||
@@ -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,7 +1,8 @@
|
||||
{
|
||||
lib,
|
||||
writeShellScriptBin,
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
aliasFlag = name: value: "-c alias.${name}=${lib.escapeShellArg value}";
|
||||
aliases = {
|
||||
eroeffne = "init";
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
linkFarm,
|
||||
runCommandNoCC,
|
||||
gnutar,
|
||||
}: rec {
|
||||
}:
|
||||
rec {
|
||||
offline_cache = linkFarm "offline" packages;
|
||||
packages = [
|
||||
{
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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";
|
||||
@@ -15,6 +21,7 @@ let
|
||||
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,7 +3,8 @@
|
||||
fetchurl,
|
||||
xan,
|
||||
util-linux,
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
database = fetchurl {
|
||||
url = "http://c.krebsco.de/greek.csv";
|
||||
hash = "sha256-SYL10kerNI0HzExG6JXh765+CBBCHLO95B6OKErQ/sU=";
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
writers,
|
||||
options ? { },
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
eval = lib.evalModules {
|
||||
modules = [
|
||||
{
|
||||
@@ -18,7 +19,11 @@
|
||||
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";
|
||||
@@ -45,12 +50,12 @@ in
|
||||
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: ''
|
||||
| case $(echo "${lib.concatStringsSep "\n" (lib.attrNames cfg.scripts)}" | ${cfg.dmenu}) in
|
||||
${lib.concatStringsSep "\n" (
|
||||
lib.mapAttrsToList (option: script: ''
|
||||
'${option}') ${toString script} ;;
|
||||
'') cfg.scripts)}
|
||||
'') cfg.scripts
|
||||
)}
|
||||
*) ${coreutils}/bin/cat ;;
|
||||
esac \
|
||||
| ${xclip}/bin/xclip -selection ${cfg.selection} -in
|
||||
|
||||
@@ -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,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
|
||||
|
||||
@@ -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,12 +6,16 @@
|
||||
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}
|
||||
|
||||
@@ -25,7 +25,10 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
|
||||
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" ''
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
{
|
||||
writers,
|
||||
mpv,
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
arabicStories = "/home/kfm/cloud/syncthing/music/Arabic/Stories";
|
||||
levantineTextbook = "/home/kfm/cloud/syncthing/music/Arabic/Damaszenisch";
|
||||
in
|
||||
|
||||
@@ -16,6 +16,10 @@ buildPythonPackage (finalAttrs: {
|
||||
sha256 = "1pcf800hl0zkcffc47mkjq9mizsxdi0hwxlnij5bvbqdshd3w9ll";
|
||||
};
|
||||
patches = [ ./regex-version.patch ];
|
||||
propagatedBuildInputs = [backports_functools_lru_cache selenium regex];
|
||||
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,7 +21,14 @@ stdenv.mkDerivation {
|
||||
which
|
||||
libtool
|
||||
];
|
||||
buildInputs = [glib zlib gtk3 libmysqlclient pcre libxml2];
|
||||
buildInputs = [
|
||||
glib
|
||||
zlib
|
||||
gtk3
|
||||
libmysqlclient
|
||||
pcre
|
||||
libxml2
|
||||
];
|
||||
buildPhase = "make";
|
||||
configureFlags = [ "--disable-dict" ];
|
||||
env.NIX_CFLAGS_COMPILE = toString [
|
||||
|
||||
@@ -2582,8 +2582,7 @@ in
|
||||
...
|
||||
}:
|
||||
"${station}\t${desc}\t${stream}"
|
||||
)
|
||||
streams
|
||||
) streams
|
||||
);
|
||||
playlist = writeText "streams.txt" (lib.concatMapStringsSep "\n" (station: station.stream) streams);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
fetchurl,
|
||||
writers,
|
||||
gawk,
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
script = fetchurl {
|
||||
url = "https://raw.githubusercontent.com/soimort/translate-shell/gh-pages/trans.awk";
|
||||
hash = "sha256-KT5iRRGtHpBTrPfs0L2e4JW6JrXVTVvgCXeFKFcr1P4=";
|
||||
|
||||
@@ -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,22 +12,38 @@
|
||||
xdotool,
|
||||
gawk,
|
||||
fetchFromGitHub,
|
||||
}: let
|
||||
emoji-flags = builtins.fromJSON (builtins.readFile "${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" ({
|
||||
}
|
||||
}/data.json"
|
||||
);
|
||||
emoji-flags-file = writeText "emoji-flags.txt" (
|
||||
lib.strings.concatMapStringsSep "\n" (
|
||||
{
|
||||
emoji,
|
||||
title,
|
||||
...
|
||||
}: "${emoji} ${title}")
|
||||
emoji-flags);
|
||||
}:
|
||||
"${emoji} ${title}"
|
||||
) emoji-flags
|
||||
);
|
||||
unicode-file = runCommand "unicode.txt" { } ''
|
||||
${
|
||||
writers.writePython3 "generate.py" {flakeIgnore = ["E501" "E722"];} ''
|
||||
writers.writePython3 "generate.py"
|
||||
{
|
||||
flakeIgnore = [
|
||||
"E501"
|
||||
"E722"
|
||||
];
|
||||
}
|
||||
''
|
||||
import csv
|
||||
|
||||
with open("${
|
||||
@@ -90,7 +106,17 @@ in
|
||||
writers.writeDashBin "unicodmenu" ''
|
||||
history_file=$HOME/.cache/unicodmenu
|
||||
touch "$history_file"
|
||||
PATH=${lib.makeBinPath [coreutils dmenu gawk gnused libnotify xclip xdotool]}
|
||||
PATH=${
|
||||
lib.makeBinPath [
|
||||
coreutils
|
||||
dmenu
|
||||
gawk
|
||||
gnused
|
||||
libnotify
|
||||
xclip
|
||||
xdotool
|
||||
]
|
||||
}
|
||||
|
||||
all_characters() {
|
||||
tac "$history_file"
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
colorscheme ? null,
|
||||
lib,
|
||||
...
|
||||
}: neovim.override {
|
||||
}:
|
||||
neovim.override {
|
||||
configure = {
|
||||
vimAlias = true;
|
||||
viAlias = true;
|
||||
@@ -17,7 +18,10 @@
|
||||
source ${./init.vim}
|
||||
let g:snippet_directory = '${vimPlugins.friendly-snippets}'
|
||||
luafile ${./init.lua}
|
||||
'' + lib.optionalString (stylixColors != null) (with stylixColors.withHashtag; ''
|
||||
''
|
||||
+ lib.optionalString (stylixColors != null) (
|
||||
with stylixColors.withHashtag;
|
||||
''
|
||||
luafile ${writeText "colors.lua" ''
|
||||
require('base16-colorscheme').setup({
|
||||
base00 = '${base00}', base01 = '${base01}', base02 = '${base02}', base03 = '${base03}',
|
||||
@@ -26,7 +30,9 @@
|
||||
base0C = '${base0C}', base0D = '${base0D}', base0E = '${base0E}', base0F = '${base0F}'
|
||||
})
|
||||
''}
|
||||
'') + lib.optionalString (colorscheme != null) ''
|
||||
''
|
||||
)
|
||||
+ lib.optionalString (colorscheme != null) ''
|
||||
colorscheme ${colorscheme}
|
||||
'';
|
||||
packages.nvim = with vimPlugins; {
|
||||
@@ -60,7 +66,12 @@
|
||||
vim-repeat
|
||||
vim-sensible
|
||||
vim-surround
|
||||
(let version = "1.1.0"; pname = "vim-dim"; in vimUtils.buildVimPlugin {
|
||||
(
|
||||
let
|
||||
version = "1.1.0";
|
||||
pname = "vim-dim";
|
||||
in
|
||||
vimUtils.buildVimPlugin {
|
||||
pname = "vim-dim";
|
||||
version = version;
|
||||
src = fetchFromGitHub {
|
||||
@@ -69,7 +80,8 @@
|
||||
rev = version;
|
||||
sha256 = "sha256-lyTZUgqUEEJRrzGo1FD8/t8KBioPrtB3MmGvPeEVI/g=";
|
||||
};
|
||||
})
|
||||
}
|
||||
)
|
||||
];
|
||||
opt = [
|
||||
csv
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user