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

85 Commits

Author SHA1 Message Date
2d063b0ac8 wip: package itools 2023-04-14 08:43:34 +02:00
9456adc0b5 chore: update 2023-04-14 08:42:59 +02:00
d6372b8d8e feat(stardict): add turkish 2023-04-14 08:42:22 +02:00
5da8218a8f feat(streams): add more 2023-04-01 17:46:56 +02:00
17cbff9917 feat(radio): add qasida arabic poetry radio 2023-04-01 17:46:48 +02:00
d72c234adb fix(weechat): disable matrix for now 2023-03-31 11:00:01 +02:00
ffc5f9b596 fix(panoptikon): add watcher name to commit message, random delay 1h, ignore html errors, #xxx notification 2023-03-31 10:59:52 +02:00
c20a9e3098 feat(flake): override mpv and dmenu for own packages 2023-03-30 19:16:54 +02:00
7759cfb35f feat(panoptikon): add library to flake outputs and use 2023-03-30 19:16:54 +02:00
b7a5c3c333 chore: update 2023-03-28 22:28:51 +02:00
672257fc04 fix: hu-vpn conflicts with hu-eduroam 2023-03-28 11:03:20 +02:00
fada909105 feat(panoptikon): setup in different service 2023-03-27 09:27:44 +02:00
96d44a52f0 feat: install agenix package 2023-03-27 09:27:30 +02:00
22f957ee1f fix(weechat): do not delete secrets on startup 2023-03-26 20:22:44 +02:00
13e674389d feat: independence from stockholm 2023-03-26 19:24:38 +02:00
f805550ff8 fix(panoptikon) 2023-03-26 19:14:57 +02:00
a8db4ab8a8 fix(panoptikon): tellonym has ads now 2023-03-26 00:41:59 +01:00
83efbcd61c feat(panoptikon): start more gentle 2023-03-26 00:26:57 +01:00
246b4e1cec chore: update secrets 2023-03-24 19:04:21 +01:00
29985fffc2 feat: replace urlwatch by panoptikon 2023-03-24 19:02:27 +01:00
85036b55a5 feat(i3): fix slock 2023-03-24 17:04:34 +01:00
15c7e5a35a feat: panoptikon urlwatcher 2023-03-24 17:00:51 +01:00
c829a3ecac chore: update 2023-03-24 00:12:31 +01:00
ee2b929838 feat: slock 2023-03-24 00:12:23 +01:00
36f5bc6dc0 fix(flix): flixmenu 2023-03-22 18:47:50 +01:00
54793196bc feat(radio): curl via tor 2023-03-22 07:48:13 +01:00
bbe6a9efec feat: update kmein ssh keys 2023-03-22 07:47:43 +01:00
eb5cedabf8 fix(picom): do not make lockscreen transparent 2023-03-21 19:14:32 +01:00
a294bf009d feat: use slock instead of k-lock 2023-03-21 19:13:48 +01:00
eb45fe28f6 fix(i3status-rust): no alternating tint; cool colours 2023-03-20 16:00:09 +01:00
5e8b1f37c6 feat(radio): move to ful to evade block, remove tor 2023-03-20 13:14:02 +01:00
7e86718b0f feat(radio): torify lyrikline 2023-03-20 12:25:43 +01:00
97ae9ec0bf feat(klem): add emojai script 2023-03-20 12:24:06 +01:00
a342aa687c feat(ssh): add kabsa key to agent 2023-03-20 12:23:49 +01:00
0a92d58d00 feat(klem): notify on success 2023-03-20 12:23:36 +01:00
0955b68054 feat(weechat): fix matrix server in sidebar 2023-03-20 12:23:25 +01:00
87ab995b82 feat(ssh): use gpg agent for agent 2023-03-12 18:26:58 +01:00
743a0f3239 chore: update secrets 2023-03-12 18:26:45 +01:00
fdaa98886e feat(manakish): add autorandr for dock switch 2023-03-12 18:26:07 +01:00
e07b053f6e fix(weechat): do not set passwords 2023-03-12 18:24:56 +01:00
ef08f4decd fix(streams): talk -> text 2023-03-11 08:27:20 +01:00
e6fb052ab8 chore: update 2023-03-11 06:36:29 +01:00
11f1be099e feat: gpg ssh key 2023-03-11 06:36:22 +01:00
dc267fc464 feat(manakish): sound via dock 2023-03-11 06:35:52 +01:00
24b552b966 feat(streams): add al jazeera 2023-03-10 20:33:11 +01:00
bc27b8bc64 fix(i3): correctly call dmenu-randr 2023-03-08 17:40:04 +01:00
58ceef04d6 feat(notmuch, mbsync): add fully qualified paths to dependent programs 2023-03-07 13:04:07 +01:00
bf62f74bc1 fix(notmuch): set name and email so it stops complaining 2023-03-06 22:30:09 +01:00
cbeffcdadd feat: install language servers 2023-03-06 22:07:57 +01:00
8f4019443d feat(neovim): hello lsp 2023-03-06 22:01:58 +01:00
eba8788547 fix(email): backup correctly
if mbsync is enabled for a homemanager account, aerc wants to use the
  maildir, which is stupid
2023-03-06 22:01:34 +01:00
3ebf717112 feat: backup email 2023-03-06 14:50:30 +01:00
4e6c8e13af feat(zsh): show hostname if in ssh 2023-03-06 11:44:38 +01:00
18ec46c773 feat(flix): update 2023-03-06 11:44:24 +01:00
9d61f006a6 feat: get krebs stuff from stockholm flake 2023-02-28 21:32:55 +01:00
d2fc37a70f fix(ttspaste): use espeak 2023-02-28 20:23:53 +01:00
e55a99f53d fix(retiolum): secret permissions 2023-02-28 17:13:12 +01:00
9d096ab4c4 fix(vdirsyncer): get password correctly 2023-02-28 17:13:12 +01:00
ed02741ee0 fix(hledger): install 2023-02-25 13:23:44 +01:00
cbd2b8edc2 fix: ci 2023-02-25 11:49:37 +01:00
bfd00e9a3b feat: bye krops 2023-02-25 09:19:11 +01:00
ad15c08c05 chore: update 2023-02-25 09:18:12 +01:00
749e783056 fix: do not build packages for mac 2023-02-25 08:57:50 +01:00
cc37e7ab00 chore: update secrets 2023-02-25 08:33:41 +01:00
0ba9124baa fix(moodle-dl): create config correctly 2023-02-25 08:32:38 +01:00
b3c996c154 feat(picom): make faster 2023-02-25 08:32:13 +01:00
b1743f031c feat: move ./modules to flake outputs 2023-02-24 23:49:00 +01:00
c9af430f31 feat: fix secrets permissions, move ./packages to flake outputs 2023-02-24 23:10:56 +01:00
c51db2b53c feat: convert inputs to flakes 2023-02-23 16:53:53 +01:00
b98ac4ebce chore: remove old ci.nix 2023-02-23 15:14:23 +01:00
d03c6bb0de feat: convert to flake
feat(zaatar): convert to flake

feat(tahina, tabula): convert to flake

feat(makanek): convert to flake

feat(manakish, zaatar): convert to flake

feat(ci): build flake systems

fix: ci build

feat: secrets via submodule

foo

foo

foo
2023-02-23 15:12:53 +01:00
ba27e98297 fix(email): show new stuff in info bar and remove gmail accounts 2023-02-22 09:37:30 +01:00
08cd4b0202 fix(aerc): hu accounts, khard, signatures 2023-02-21 22:29:41 +01:00
708e2ab1f4 feat: neomutt -> aerc 2023-02-21 12:07:06 +01:00
2e482d3fec feat(urlwatch): tatort 2023-02-19 15:05:16 +01:00
4fae6d1ed0 fix(mpv): support only pulse 2023-02-19 11:52:00 +01:00
9a80eb84d4 chore: update 2023-02-16 14:43:08 +01:00
f7cb9b8957 feat(weechat): join #hsmr-moin 2023-02-16 14:39:03 +01:00
e7c050c1c4 feat(moinbot): move to #hsmr-moin 2023-02-16 14:32:42 +01:00
c6ab8b4eb7 feat(ssh): add one more fysiweb host 2023-02-16 12:10:52 +01:00
7d0a802d30 feat(zaatar): allow ful to backup 2023-02-16 08:52:54 +01:00
eec6cf1bf9 feat(zaatar): tuna -> mpd, disable tuna 2023-02-16 08:52:44 +01:00
0698624eb8 feat(ful): add matomo and backup 2023-02-16 08:46:23 +01:00
d0eb69229d feat(picom): make animations faster, rename module 2023-02-13 23:19:44 +01:00
0f88954989 fix(ci): add grafana secret to makanek 2023-02-09 09:48:36 +01:00
216 changed files with 4106 additions and 4013 deletions

8
.bin/unicode Normal file
View File

@@ -0,0 +1,8 @@
import sys
import unicodedata
for index, character in enumerate(sys.stdin.read().strip()):
try:
print(index, character, hex(ord(character)), unicodedata.category(character), unicodedata.name(character))
except:
print(index, character, hex(ord(character)))

View File

@@ -11,4 +11,4 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: cachix/install-nix-action@v16 - uses: cachix/install-nix-action@v16
- run: nix run .#build-${{matrix.system}} - run: nix run .?submodules=1#apps.nixinate.${{matrix.system}}-dry-run

3
.gitmodules vendored Normal file
View File

@@ -0,0 +1,3 @@
[submodule "secrets"]
path = secrets
url = ssh://gitea@code.kmein.de:22022/kfm/niveum-secrets.git

98
ci.nix
View File

@@ -1,98 +0,0 @@
{
inputs,
system,
name,
}: let
nixpkgs = inputs.nixos-stable;
pkgs = nixpkgs.legacyPackages.${system};
ensureFiles = paths:
pkgs.runCommand "directory" {} ''
set -efu
mkdir $out
cd $out
${
nixpkgs.lib.concatMapStringsSep "\n" (path: ''
mkdir -p "$(dirname ${nixpkgs.lib.escapeShellArg path})"
echo foo > ${nixpkgs.lib.escapeShellArg path}
'')
paths
}
'';
nixPath = nixpkgs.lib.concatStringsSep ":" ([
"niveum=${toString ./.}"
"nixos-config=${toString ./.}/systems/${name}/configuration.nix"
"system-secrets=${systemSecrets}"
"secrets=${sharedSecrets}"
"nixpkgs=${
toString (
if name == "kabsa" || name == "manakish"
then inputs.nixos-unstable
else inputs.nixos-stable
)
}"
]
++ nixpkgs.lib.mapAttrsToList (name: value: "${name}=${value}") inputs);
# cd ~/.password-store/shared && find * -type f | sed 's/.gpg$//'
sharedSecrets = ensureFiles [
"di.fm/key"
"eduroam/identity"
"eduroam/password"
"github/notification.token"
"hass/token"
"mail/cock"
"mail/fastmail"
"mail/gmail/amroplay"
"mail/gmail/kieran.meinhardt"
"mail/meinhaki"
"mail/dslalewa"
"mail/fsklassp"
"mail/posteo"
"mega/password"
"nextcloud-fysi/password"
"nextcloud/password"
"openweathermap.key"
"restic/password"
"traadfri.key"
"miniflux/password"
"wifi/Aether.psk"
"spotify/username"
"spotify/password"
];
systemSecrets = let
basic = ["retiolum.ed25519" "retiolum.key" "syncthing/cert.pem" "syncthing/key.pem" "ssh/passphrase"];
in
{
zaatar = ensureFiles (["moodle.token" "telegram/moodle-dl.token" "mpd-web.key"] ++ basic);
kabsa = ensureFiles basic;
manakish = ensureFiles basic;
tahina = ensureFiles basic;
tabula = ensureFiles basic;
ful = ensureFiles (["root.password"] ++ basic);
makanek = ensureFiles ([
"irc/retiolum"
"irc/hackint"
"irc/libera"
"irc/oftc"
"matrix/nibbana"
"maxmind/license.key"
"moodle-dl/faye.token"
"nextcloud/admin"
"nextcloud/database"
"telegram/nachtischsatan.token"
"telegram/reverse.token"
"telegram/odyssey.token"
"telegram/betacode.token"
"telegram/moodle-dl.token"
"telegram/proverb.token"
"telegram/menstruation.token"
"telegram/cool_village.token"
"telegram/kmein.token"
"telegram/krebs.token"
"telegram/prometheus.token"
"weechat/relay"
]
++ basic);
}
.${name};
in
toString (pkgs.writers.writeDash "build" "NIX_PATH=${nixPath} nix-build '<nixpkgs/nixos>' -A system --dry-run")

394
configs/aerc.nix Normal file
View File

@@ -0,0 +1,394 @@
{
pkgs,
config,
lib,
...
}: let
defaults = {
aerc.enable = true;
realName = "Kierán Meinhardt";
folders.inbox = "INBOX";
};
hu-defaults = {
imap.host = "mailbox.cms.hu-berlin.de";
imap.port = 993;
smtp.host = "mailhost.cms.hu-berlin.de";
smtp.port = 25;
smtp.tls.useStartTls = true;
};
in {
age.secrets = {
email-password-cock = {
file = ../secrets/email-password-cock.age;
owner = config.users.users.me.name;
group = config.users.users.me.group;
mode = "400";
};
email-password-fysi = {
file = ../secrets/email-password-fysi.age;
owner = config.users.users.me.name;
group = config.users.users.me.group;
mode = "400";
};
email-password-posteo = {
file = ../secrets/email-password-posteo.age;
owner = config.users.users.me.name;
group = config.users.users.me.group;
mode = "400";
};
email-password-meinhark = {
file = ../secrets/email-password-meinhark.age;
owner = config.users.users.me.name;
group = config.users.users.me.group;
mode = "400";
};
email-password-meinhaki = {
file = ../secrets/email-password-meinhaki.age;
owner = config.users.users.me.name;
group = config.users.users.me.group;
mode = "400";
};
email-password-dslalewa = {
file = ../secrets/email-password-dslalewa.age;
owner = config.users.users.me.name;
group = config.users.users.me.group;
mode = "400";
};
email-password-fsklassp = {
file = ../secrets/email-password-fsklassp.age;
owner = config.users.users.me.name;
group = config.users.users.me.group;
mode = "400";
};
};
home-manager.users.me = {
services.mbsync = {
enable = true;
frequency = "daily";
preExec = "${pkgs.coreutils}/bin/mkdir -p ${config.home-manager.users.me.accounts.email.maildirBasePath}";
postExec = "${pkgs.notmuch}/bin/notmuch new";
};
programs.notmuch = {
enable = true;
extraConfig = {
database.path = config.home-manager.users.me.accounts.email.maildirBasePath;
new.tags = "";
user.name = defaults.realName;
user.primary_email = config.home-manager.users.me.accounts.email.accounts.posteo.address;
};
};
programs.mbsync = {
enable = true;
extraConfig = lib.concatStringsSep "\n\n" (lib.mapAttrsToList (name: account: ''
IMAPAccount ${name}
CertificateFile /etc/ssl/certs/ca-certificates.crt
Host ${account.imap.host}
PassCmd "${toString account.passwordCommand}"
User ${account.userName}
SSLType IMAPS
${lib.optionalString (lib.isInt account.imap.port) "Port ${toString account.imap.port}"}
IMAPStore ${name}-remote
Account ${name}
MaildirStore ${name}-local
Path ${config.home-manager.users.me.accounts.email.maildirBasePath}/${name}/
SubFolders Verbatim
Channel ${name}
Create Near
Expunge None
Far :${name}-remote:
Near :${name}-local:
Patterns *
Remove None
SyncState *
'')
config.home-manager.users.me.accounts.email.accounts);
};
accounts.email.accounts = rec {
hu-student =
lib.recursiveUpdate defaults
(lib.recursiveUpdate hu-defaults
rec {
userName = "meinhark";
address = "kieran.felix.meinhardt@hu-berlin.de";
aliases = ["${userName}@hu-berlin.de"];
passwordCommand = "${pkgs.coreutils}/bin/cat ${config.age.secrets.email-password-meinhark.path}";
});
hu-student-cs =
lib.recursiveUpdate defaults
(lib.recursiveUpdate hu-defaults
rec {
userName = "meinhark";
address = "kieran.felix.meinhardt@informatik.hu-berlin.de";
aliases = ["${userName}@informatik.hu-berlin.de"];
imap.host = "mailbox.informatik.hu-berlin.de";
smtp.host = "mailhost.informatik.hu-berlin.de";
passwordCommand = "${pkgs.coreutils}/bin/cat ${config.age.secrets.email-password-meinhark.path}";
});
hu-employee =
lib.recursiveUpdate defaults
(lib.recursiveUpdate hu-defaults
rec {
userName = "meinhaki";
address = "kieran.meinhardt@hu-berlin.de";
aliases = ["${userName}@hu-berlin.de"];
passwordCommand = "${pkgs.coreutils}/bin/cat ${config.age.secrets.email-password-meinhaki.path}";
aerc.extraAccounts.signature-file = toString (pkgs.writeText "signature" signature.text);
signature = {
showSignature = "append";
text = ''
${defaults.realName}
Studentische Hilfskraft / Administrator ALEW
Humboldt-Universität zu Berlin
Telefon: +49 (0)30 2093 9634
Raum 3.212, Dorotheenstraße 24, 10117 Berlin-Mitte
https://alew.hu-berlin.de
'';
};
});
hu-admin =
lib.recursiveUpdate defaults
(lib.recursiveUpdate hu-defaults
rec {
userName = "dslalewa";
address = "admin.alew.vglsprwi@hu-berlin.de";
aliases = ["${userName}@hu-berlin.de"];
passwordCommand = "${pkgs.coreutils}/bin/cat ${config.age.secrets.email-password-dslalewa.path}";
inherit (hu-employee) signature;
aerc.extraAccounts.signature-file = toString (pkgs.writeText "signature" signature.text);
});
hu-fsi =
lib.recursiveUpdate defaults
(lib.recursiveUpdate hu-defaults
rec {
userName = "fsklassp";
passwordCommand = "${pkgs.coreutils}/bin/cat ${config.age.secrets.email-password-fsklassp.path}";
address = "${userName}@hu-berlin.de";
realName = "FSI Klassische Philologie";
aerc.extraAccounts.signature-file = toString (pkgs.writeText "signature" signature.text);
signature = {
showSignature = "append";
text = ''
Fachschafts-Initiative
Humboldt-Universität zu Berlin
Sprach- und literaturwissenschaftliche Fakultät
Institut für klassische Philologie
Unter den Linden 6
10099 Berlin
'';
};
});
fysi =
lib.recursiveUpdate defaults
rec {
address = "kieran@fysi.tech";
userName = address;
passwordCommand = "${pkgs.coreutils}/bin/cat ${config.age.secrets.email-password-fysi.path}";
flavor = "fastmail.com";
};
cock =
lib.recursiveUpdate defaults
rec {
address = "2210@cock.li";
userName = address;
passwordCommand = "${pkgs.coreutils}/bin/cat ${config.age.secrets.email-password-cock.path}";
realName = "";
imap.host = "mail.cock.li";
smtp.host = imap.host;
};
posteo =
lib.recursiveUpdate defaults
rec {
address = "kieran.meinhardt@posteo.net";
aliases = ["kmein@posteo.de"];
userName = address;
imap.host = "posteo.de";
smtp.host = imap.host;
primary = true;
passwordCommand = "${pkgs.coreutils}/bin/cat ${config.age.secrets.email-password-posteo.path}";
# himalaya = { enable = true; backend = "imap"; sender = "smtp"; };
};
};
# programs.himalaya.enable = true;
programs.aerc = {
enable = true;
extraBinds = {
# Binds are of the form <key sequence> = <command to run>
# To use '=' in a key sequence, substitute it with "Eq": "<Ctrl+Eq>"
# If you wish to bind #, you can wrap the key sequence in quotes: "#" = quit
global = {
"<C-p>" = ":prev-tab<Enter>";
"<C-n>" = ":next-tab <Enter>";
"<C-t>" = ":term<Enter>";
"?" = ":help keys<Enter>";
};
messages = {
q = ":quit<Enter>";
j = ":next <Enter>";
"<Down>" = ":next<Enter>";
"<C-d>" = ":next 50%<Enter>";
"<C-f>" = ":next 100%<Enter>";
"<PgDn>" = ":next 100%<Enter>";
k = ":prev <Enter>";
"<Up>" = ":prev<Enter>";
"<C-u>" = ":prev 50%<Enter>";
"<C-b>" = ":prev 100%<Enter>";
"<PgUp>" = ":prev 100%<Enter>";
g = ":select 0 <Enter>";
G = ":select -1<Enter>";
J = ":next-folder <Enter>";
K = ":prev-folder<Enter>";
H = ":collapse-folder<Enter>";
L = ":expand-folder<Enter>";
"<space>" = ":read -t<Enter>:next<Enter>";
v = ":mark -t<Enter>";
V = ":mark -v<Enter>";
F = ":flag -t<Enter>";
T = ":toggle-threads<Enter>";
"<Enter>" = ":view<Enter>";
d = ":prompt 'Delete? ' 'delete-message'<Enter>";
D = ":move Trash<Enter>";
A = ":archive flat<Enter>";
C = ":compose<Enter>";
rr = ":reply -a<Enter>";
rq = ":reply -aq<Enter>";
Rr = ":reply<Enter>";
Rq = ":reply -q<Enter>";
c = ":cf<space>";
"$" = ":term<space>";
"!" = ":term<space>";
"|" = ":pipe<space>";
"/" = ":search<space>";
"\\" = ":filter <space>";
n = ":next-result<Enter>";
N = ":prev-result<Enter>";
"<Esc>" = ":clear<Enter>";
"*" = ":filter -x Flagged<Enter>";
};
view = {
"/" = ":toggle-key-passthrough <Enter> /";
q = ":close<Enter>";
O = ":open<Enter>";
S = ":save<space>";
"|" = ":pipe<space>";
D = ":move Trash<Enter>";
A = ":archive flat<Enter>";
"<C-l>" = ":open-link <space>";
f = ":forward <Enter>";
rr = ":reply -a<Enter>";
rq = ":reply -aq<Enter>";
Rr = ":reply<Enter>";
Rq = ":reply -q<Enter>";
H = ":toggle-headers<Enter>";
"<C-k>" = ":prev-part<Enter>";
"<C-j>" = ":next-part<Enter>";
J = ":next <Enter>";
K = ":prev<Enter>";
};
"view::passthrough" = {
"$noinherit" = "true";
"$ex" = "<C-x>";
"<Esc>" = ":toggle-key-passthrough<Enter>";
};
compose = {
# Keybindings used when the embedded terminal is not selected in the compose
# view
"$noinherit" = "true";
"$ex" = "<C-x>";
"<C-k>" = ":prev-field<Enter>";
"<C-j>" = ":next-field<Enter>";
"<tab>" = ":next-field<Enter>";
"<C-p>" = ":prev-tab<Enter>";
"<C-n>" = ":next-tab<Enter>";
};
"compose::editor" = {
# Keybindings used when the embedded terminal is selected in the compose view
"$noinherit" = "true";
"$ex" = "<C-x>";
"<C-k>" = ":prev-field<Enter>";
"<C-j>" = ":next-field<Enter>";
"<C-p>" = ":prev-tab<Enter>";
"<C-n>" = ":next-tab<Enter>";
};
"compose::review" = {
# Keybindings used when reviewing a message to be sent
y = ":send <Enter>";
n = ":abort<Enter>";
p = ":postpone<Enter>";
q = ":choose -o d discard abort -o p postpone postpone<Enter>";
e = ":edit<Enter>";
a = ":attach<space>";
d = ":detach<space>";
};
terminal = {
"$noinherit" = "true";
"$ex" = "<C-x>";
"<C-p>" = ":prev-tab<Enter>";
"<C-n>" = ":next-tab<Enter>";
};
};
extraConfig = {
ui.sort = "-r date";
ui.timestamp-format = "2006-01-02 15:04";
ui.mouse-enabled = true;
ui.spinner = ". , .";
general.unsafe-accounts-conf = true;
general.pgp-provider = "gpg";
viewer = {pager = "${pkgs.less}/bin/less -R";};
compose = {
address-book-cmd = "khard email --remove-first-line --parsable '%s'";
no-attachment-warning = "(attach|attached|attachments?|anbei|Anhang|angehängt)";
};
filters = {
"text/plain" = "${pkgs.gawk}/bin/awk -f ${pkgs.aerc}/share/aerc/filters/colorize";
"text/calendar" = "${pkgs.gawk}/bin/awk -f ${pkgs.aerc}/share/aerc/filters/calendar";
"text/html" = "${pkgs.aerc}/share/aerc/filters/html"; # Requires w3m, dante
# "text/html" =
# "${pkgs.aerc}/share/aerc/filters/html | ${pkgs.aerc}/share/aerc/filters/colorize";
# "text/*" =
# ''${pkgs.bat}/bin/bat -fP --file-name="$AERC_FILENAME "'';
"message/delivery-status" = "${pkgs.gawk}/bin/awk -f ${pkgs.aerc}/share/aerc/filters/colorize";
"message/rfc822" = "${pkgs.gawk}/bin/awk -f ${pkgs.aerc}/share/aerc/filters/colorize";
"application/x-sh" = "${pkgs.bat}/bin/bat -fP -l sh";
};
openers = let
as-pdf = pkgs.writers.writeDash "as-pdf" ''
d=$(mktemp -d)
trap clean EXIT
clean() {
rm -rf "$d"
}
${pkgs.libreoffice}/bin/libreoffice --headless --convert-to pdf "$1" --outdir "$d"
${pkgs.zathura}/bin/zathura "$d"/*.pdf
'';
in {
"image/*" = "${pkgs.nsxiv}/bin/nsxiv";
"application/pdf" = "${pkgs.zathura}/bin/zathura";
"application/vnd.openxmlformats-officedocument.wordprocessingml.document" = toString as-pdf;
"application/vnd.oasis.opendocument.text" = toString as-pdf;
"video/*" = "${pkgs.mpv}/bin/mpv";
"audio/*" = "${pkgs.mpv}/bin/mpv";
};
};
templates = {
# new_message = "hello!";
};
};
};
}

View File

@@ -47,7 +47,7 @@
alacritty-pkg = pkgs.symlinkJoin { alacritty-pkg = pkgs.symlinkJoin {
name = "alacritty"; name = "alacritty";
paths = [ paths = [
(pkgs.writeDashBin "alacritty" '' (pkgs.writers.writeDashBin "alacritty" ''
${pkgs.alacritty}/bin/alacritty --config-file /var/theme/config/alacritty.yml msg create-window "$@" || ${pkgs.alacritty}/bin/alacritty --config-file /var/theme/config/alacritty.yml msg create-window "$@" ||
${pkgs.alacritty}/bin/alacritty --config-file /var/theme/config/alacritty.yml "$@" ${pkgs.alacritty}/bin/alacritty --config-file /var/theme/config/alacritty.yml "$@"
'') '')
@@ -62,7 +62,7 @@ in {
]; ];
environment.etc = { environment.etc = {
"themes/dark/alacritty.yml".source = alacritty-cfg (import <niveum/lib/colours/papercolor-dark.nix>); "themes/dark/alacritty.yml".source = alacritty-cfg (import ../lib/colours/owickstrom-dark.nix);
"themes/light/alacritty.yml".source = alacritty-cfg (import <niveum/lib/colours/papercolor-light.nix>); "themes/light/alacritty.yml".source = alacritty-cfg (import ../lib/colours/owickstrom-light.nix);
}; };
} }

View File

@@ -3,7 +3,7 @@
config, config,
... ...
}: let }: let
inherit (import <niveum/lib>) restic; inherit (import ../lib) restic;
in { in {
services.restic.backups.niveum = { services.restic.backups.niveum = {
initialize = true; initialize = true;
@@ -12,7 +12,7 @@ in {
OnCalendar = "8:00"; OnCalendar = "8:00";
RandomizedDelaySec = "1h"; RandomizedDelaySec = "1h";
}; };
passwordFile = toString <secrets/restic/password>; passwordFile = config.age.secrets.restic.path;
extraBackupArgs = [ extraBackupArgs = [
"--exclude=/home/kfm/projects/nixpkgs/.git" "--exclude=/home/kfm/projects/nixpkgs/.git"
"--exclude=node_modules" "--exclude=node_modules"
@@ -21,6 +21,7 @@ in {
"/home/kfm/work" "/home/kfm/work"
"/home/kfm/projects" "/home/kfm/projects"
"/home/kfm/notes" "/home/kfm/notes"
"/home/kfm/Maildir"
"/home/kfm/cloud" "/home/kfm/cloud"
"/home/kfm/.gnupg" "/home/kfm/.gnupg"
"/home/kfm/.ssh" "/home/kfm/.ssh"
@@ -38,7 +39,7 @@ in {
environment.systemPackages = [ environment.systemPackages = [
(pkgs.writers.writeDashBin "restic-niveum" '' (pkgs.writers.writeDashBin "restic-niveum" ''
${pkgs.restic}/bin/restic -r ${restic.repository} -p ${<secrets/restic/password>} "$@" ${pkgs.restic}/bin/restic -r ${restic.repository} -p ${config.age.secrets.restic.path} "$@"
'') '')
(pkgs.writers.writeDashBin "restic-mount" '' (pkgs.writers.writeDashBin "restic-mount" ''
mountdir=$(mktemp -d) mountdir=$(mktemp -d)
@@ -46,7 +47,7 @@ in {
clean() { clean() {
rm -r "$mountdir" rm -r "$mountdir"
} }
${pkgs.restic}/bin/restic -r ${restic.repository} -p ${<secrets/restic/password>} mount "$mountdir" ${pkgs.restic}/bin/restic -r ${restic.repository} -p ${config.age.secrets.restic.path} mount "$mountdir"
'') '')
]; ];
} }

View File

@@ -4,16 +4,8 @@
pkgs, pkgs,
... ...
}: let }: let
inherit (import <niveum/lib>) tmpfilesConfig; inherit (import ../lib) tmpfilesConfig;
in { in {
imports = [
<niveum/modules/dropbox.nix>
];
niveum = {
dropbox.enable = false;
};
systemd.tmpfiles.rules = map tmpfilesConfig [ systemd.tmpfiles.rules = map tmpfilesConfig [
{ {
type = "L+"; type = "L+";
@@ -55,13 +47,13 @@ in {
script = let script = let
kieran = { kieran = {
user = "kieran"; user = "kieran";
password = lib.fileContents <secrets/nextcloud/password>; passwordFile = config.age.secrets.nextcloud-password-kieran.path;
endpoint = "https://cloud.xn--kiern-0qa.de"; endpoint = "https://cloud.xn--kiern-0qa.de";
target = "${config.users.users.me.home}/notes"; target = "${config.users.users.me.home}/notes";
}; };
in '' in ''
mkdir -p ${lib.escapeShellArg kieran.target} mkdir -p ${lib.escapeShellArg kieran.target}
${pkgs.nextcloud-client}/bin/nextcloudcmd --non-interactive --user ${kieran.user} --password ${lib.escapeShellArg kieran.password} --path /Notes ${lib.escapeShellArg kieran.target} ${kieran.endpoint} ${pkgs.nextcloud-client}/bin/nextcloudcmd --non-interactive --user ${kieran.user} --password "$(cat ${kieran.passwordFile})" --path /Notes ${lib.escapeShellArg kieran.target} ${kieran.endpoint}
''; '';
serviceConfig = { serviceConfig = {
Type = "oneshot"; Type = "oneshot";
@@ -81,9 +73,9 @@ in {
(let (let
kieran = { kieran = {
user = "kieran.meinhardt@gmail.com"; user = "kieran.meinhardt@gmail.com";
password = lib.fileContents <secrets/mega/password>; passwordFile = config.age.secrets.mega-password.path;
}; };
megatools = command: "${pkgs.megatools}/bin/megatools ${command} --username ${lib.escapeShellArg kieran.user} --password ${lib.escapeShellArg kieran.password}"; megatools = command: ''${pkgs.megatools}/bin/megatools ${command} --username ${lib.escapeShellArg kieran.user} --password "$(cat ${kieran.passwordFile})"'';
in in
pkgs.writers.writeDashBin "book-mega" '' pkgs.writers.writeDashBin "book-mega" ''
set -efu set -efu
@@ -104,6 +96,13 @@ in {
'') '')
]; ];
age.secrets.mega-password = {
file = ../secrets/mega-password.age;
owner = config.users.users.me.name;
group = config.users.users.me.group;
mode = "400";
};
fileSystems."/media/moodle" = { fileSystems."/media/moodle" = {
device = "zaatar.r:/moodle"; device = "zaatar.r:/moodle";
fsType = "nfs"; fsType = "nfs";
@@ -120,9 +119,9 @@ in {
openDefaultPorts = true; openDefaultPorts = true;
configDir = "/home/kfm/.config/syncthing"; configDir = "/home/kfm/.config/syncthing";
dataDir = "/home/kfm/.config/syncthing"; dataDir = "/home/kfm/.config/syncthing";
cert = toString <system-secrets/syncthing/cert.pem>; cert = config.age.secrets.syncthing-cert.path;
key = toString <system-secrets/syncthing/key.pem>; key = config.age.secrets.syncthing-key.path;
inherit ((import <niveum/lib>).syncthing) devices; inherit ((import ../lib).syncthing) devices;
folders = let folders = let
cloud-dir = "${config.users.users.me.home}/cloud"; cloud-dir = "${config.users.users.me.home}/cloud";
in { in {

View File

@@ -1,12 +0,0 @@
{
services.picom = {
enable = true;
activeOpacity = 1;
fade = true;
fadeDelta = 10;
inactiveOpacity = 0.8;
shadow = true;
menuOpacity = 0.9;
shadowOpacity = 0.3;
};
}

View File

@@ -2,36 +2,27 @@
pkgs, pkgs,
lib, lib,
config, config,
options, niveumPackages,
inputs,
... ...
}: let }: let
inherit (lib.strings) makeBinPath; inherit (lib.strings) makeBinPath;
inherit (import <niveum/lib>) localAddresses kieran; inherit (import ../lib) localAddresses kieran;
scripts = import <niveum/packages/scripts> {inherit pkgs lib;}; defaultApplications = (import ../lib).defaultApplications {inherit pkgs;};
defaultApplications = (import <niveum/lib>).defaultApplications {inherit pkgs;};
in { in {
imports = [ imports = [
<home-manager/nixos> inputs.self.nixosModules.system-dependent
<niveum/modules/system-dependent.nix> inputs.self.nixosModules.traadfri
inputs.self.nixosModules.power-action
{ {
boot.supportedFilesystems = ["ntfs"]; boot.supportedFilesystems = ["ntfs"];
} }
{
nix.nixPath = [
"/var/src"
"nixpkgs-overlays=${toString ../overlays}"
];
}
{ {
nixpkgs = { nixpkgs = {
config = { config = {
allowUnfree = true; allowUnfree = true;
packageOverrides = pkgs: { packageOverrides = pkgs: {
dmenu = pkgs.writers.writeDashBin "dmenu" ''exec ${pkgs.rofi}/bin/rofi -dmenu "$@"''; dmenu = pkgs.writers.writeDashBin "dmenu" ''exec ${pkgs.rofi}/bin/rofi -dmenu "$@"'';
gfs-fonts = pkgs.callPackage <niveum/packages/gfs-fonts.nix> {};
tocharian-font = pkgs.callPackage <niveum/packages/tocharian-font.nix> {};
iolanguage = pkgs.callPackage <niveum/packages/iolanguage.nix> {};
ix = pkgs.callPackage <niveum/packages/ix.nix> {};
}; };
permittedInsecurePackages = [ permittedInsecurePackages = [
"qtwebkit-5.212.0-alpha4" "qtwebkit-5.212.0-alpha4"
@@ -43,6 +34,22 @@ in {
boot.cleanTmpDir = true; boot.cleanTmpDir = true;
boot.loader.timeout = 1; boot.loader.timeout = 1;
} }
{
age.secrets = {
di-fm-key = {
file = ../secrets/di-fm-key.age;
owner = config.users.users.me.name;
group = config.users.users.me.group;
mode = "400";
};
restic = {
file = ../secrets/restic.age;
owner = config.users.users.me.name;
group = config.users.users.me.group;
mode = "400";
};
};
}
{ {
home-manager.users.me = { home-manager.users.me = {
programs.zathura = { programs.zathura = {
@@ -86,7 +93,7 @@ in {
cd "$(mktemp -d)" cd "$(mktemp -d)"
pwd pwd
''; '';
swallow = command: "${scripts.swallow}/bin/swallow ${command}"; swallow = command: "${niveumPackages.swallow}/bin/swallow ${command}";
in { in {
"ß" = "${pkgs.util-linux}/bin/setsid"; "ß" = "${pkgs.util-linux}/bin/setsid";
cat = "${pkgs.bat}/bin/bat --style=plain"; cat = "${pkgs.bat}/bin/bat --style=plain";
@@ -219,14 +226,13 @@ in {
./bash.nix ./bash.nix
./beets.nix ./beets.nix
./bluetooth.nix ./bluetooth.nix
./aerc.nix
./ccc.nix ./ccc.nix
./khal.nix ./khal.nix
./chromium.nix ./chromium.nix
./clipboard.nix ./clipboard.nix
./cloud.nix ./cloud.nix
./compton.nix
./direnv.nix ./direnv.nix
./distrobump.nix
./docker.nix ./docker.nix
./dunst.nix ./dunst.nix
./flix.nix ./flix.nix
@@ -242,11 +248,11 @@ in {
./mpv.nix ./mpv.nix
./mime.nix ./mime.nix
./neovim.nix ./neovim.nix
./neomutt.nix
./nix.nix ./nix.nix
./newsboat.nix ./newsboat.nix
./flameshot-once.nix ./flameshot.nix
./packages.nix ./packages.nix
./picom.nix
./stardict.nix ./stardict.nix
./polkit.nix ./polkit.nix
./power-action.nix ./power-action.nix
@@ -262,10 +268,9 @@ in {
./sshd.nix ./sshd.nix
./sound.nix ./sound.nix
./sudo.nix ./sudo.nix
./nsxiv.nix
./themes.nix ./themes.nix
./tmux.nix ./tmux.nix
# ./traadfri.nix ./traadfri.nix
./unclutter.nix ./unclutter.nix
./vscode.nix ./vscode.nix
./watson.nix ./watson.nix

View File

@@ -3,7 +3,7 @@
pkgs, pkgs,
... ...
}: let }: let
inherit (import <niveum/lib>) defaultApplications colours theme; inherit (import ../lib) defaultApplications colours theme;
in { in {
home-manager.users.me.services.dunst = { home-manager.users.me.services.dunst = {
enable = true; enable = true;

View File

@@ -1,52 +0,0 @@
{
lib,
pkgs,
...
}: let
inherit (import <niveum/lib>) defaultApplications;
flameshot-once = pkgs.callPackage <stockholm/krebs/5pkgs/simple/flameshot-once> {};
in {
environment.systemPackages = [
(flameshot-once.override {
name = "flameshot-once-kmein";
config = {
imgur = {
enable = true;
createUrl = "http://p.r/image";
deleteUrl = "http://p.r/image/delete/%1";
xdg-open.browser = (defaultApplications pkgs).browser;
};
settings.General = {
autoCloseIdleDaemon = true;
drawColor = "#ff0000";
drawThickness = 2;
checkForUpdates = false;
showDesktopNotification = true;
disabledTrayIcon = true;
showHelp = false;
squareMagnifier = true;
uploadWithoutConfirmation = true;
buttons = [
"TYPE_ARROW"
"TYPE_CIRCLE"
"TYPE_CIRCLECOUNT"
"TYPE_COPY"
"TYPE_DRAWER"
"TYPE_EXIT"
"TYPE_IMAGEUPLOADER"
"TYPE_MARKER"
"TYPE_MOVESELECTION"
"TYPE_PENCIL"
"TYPE_PIXELATE"
"TYPE_RECTANGLE"
"TYPE_SAVE"
"TYPE_SELECTION"
# "TYPE_SELECTIONINDICATOR"
"TYPE_TEXT"
"TYPE_UNDO"
];
};
};
})
];
}

23
configs/flameshot.nix Normal file
View File

@@ -0,0 +1,23 @@
{
lib,
pkgs,
...
}: {
home-manager.users.me = {
services.flameshot = {
enable = true;
settings.General = {
autoCloseIdleDaemon = true;
drawColor = "#ff0000";
drawThickness = 2;
checkForUpdates = false;
showDesktopNotification = true;
disabledTrayIcon = true;
showHelp = false;
squareMagnifier = true;
uploadWithoutConfirmation = true;
buttons = ''@Variant(\0\0\0\x7f\0\0\0\vQList<int>\0\0\0\0\x10\0\0\0\x2\0\0\0\x5\0\0\0\x13\0\0\0\xa\0\0\0\x1\0\0\0\xc\0\0\0\xd\0\0\0\x6\0\0\0\x8\0\0\0\0\0\0\0\xf\0\0\0\x4\0\0\0\xb\0\0\0\x3\0\0\0\x12\0\0\0\x9)'';
};
};
};
}

View File

@@ -4,14 +4,16 @@
... ...
}: let }: let
flixLocation = "/media/flix"; flixLocation = "/media/flix";
flixLocationNew = "/media/flix-new";
cacheLocation = "/var/cache/flix"; cacheLocation = "/var/cache/flix";
indexFilename = "index"; indexFilename = "index";
indexFilenameNew = "index-new";
flixUser = "flix"; flixUser = "flix";
flixGroup = "users"; flixGroup = "users";
inherit (import <niveum/lib>) tmpfilesConfig; inherit (import ../lib) tmpfilesConfig;
in { in {
fileSystems.${flixLocation} = { fileSystems.${flixLocation} = {
device = "prism.r:/export"; device = "prism.r:/export/download";
fsType = "nfs"; fsType = "nfs";
options = [ options = [
"noauto" "noauto"
@@ -26,6 +28,20 @@ in {
]; ];
}; };
fileSystems.${flixLocationNew} = {
device = "//yellow.r/public";
fsType = "cifs";
options = [
"guest"
"nofail"
"noauto"
"ro"
"x-systemd.automount"
"x-systemd.device-timeout=1"
"x-systemd.idle-timeout=1min"
];
};
systemd.tmpfiles.rules = [ systemd.tmpfiles.rules = [
(tmpfilesConfig { (tmpfilesConfig {
type = "d"; type = "d";
@@ -39,7 +55,10 @@ in {
systemd.services.flix-index = { systemd.services.flix-index = {
description = "Flix indexing service"; description = "Flix indexing service";
wants = ["network-online.target"]; wants = ["network-online.target"];
script = "cp ${flixLocation}/download/index ./${indexFilename}"; script = ''
cp ${flixLocation}/index ./${indexFilename}
cp ${flixLocationNew}/index ./${indexFilenameNew}
'';
startAt = "hourly"; startAt = "hourly";
serviceConfig = { serviceConfig = {
Type = "oneshot"; Type = "oneshot";
@@ -69,11 +88,10 @@ in {
'') '')
(pkgs.writers.writeDashBin "flixmenu" '' (pkgs.writers.writeDashBin "flixmenu" ''
set -efu set -efu
cd "${flixLocation}/download" (
${pkgs.gnused}/bin/sed 's#^\.#${flixLocation}#' ${cacheLocation}/${indexFilename}
[ -f "${cacheLocation}/${indexFilename}" ] || exit 1 ${pkgs.gnused}/bin/sed 's#^\.#${flixLocationNew}#' ${cacheLocation}/${indexFilenameNew}
) | ${pkgs.dmenu}/bin/dmenu -i -p flix -l 5 "$@" \
${pkgs.dmenu}/bin/dmenu -i -p flix -l 5 "$@" < ${cacheLocation}/${indexFilename} \
| ${pkgs.findutils}/bin/xargs -I '{}' ${pkgs.util-linux}/bin/setsid ${pkgs.xdg-utils}/bin/xdg-open '{}' | ${pkgs.findutils}/bin/xargs -I '{}' ${pkgs.util-linux}/bin/setsid ${pkgs.xdg-utils}/bin/xdg-open '{}'
'') '')
]; ];

View File

@@ -1,4 +1,8 @@
{pkgs, ...}: let {
pkgs,
niveumPackages,
...
}: let
zip-font = name: arguments: let zip-font = name: arguments: let
directory = pkgs.fetchzip arguments; directory = pkgs.fetchzip arguments;
in in
@@ -76,7 +80,7 @@ in {
font-awesome font-awesome
galatia-sil galatia-sil
gentium gentium
gfs-fonts niveumPackages.gfs-fonts
gyre-fonts gyre-fonts
ibm-plex ibm-plex
jetbrains-mono jetbrains-mono
@@ -96,7 +100,7 @@ in {
source-sans-pro source-sans-pro
source-serif-pro source-serif-pro
theano theano
tocharian-font niveumPackages.tocharian-font
vistafonts vistafonts
vollkorn vollkorn
zilla-slab zilla-slab

View File

@@ -2,9 +2,10 @@
pkgs, pkgs,
config, config,
lib, lib,
inputs,
... ...
}: let }: let
inherit (import <niveum/lib>) kieran ignorePaths; inherit (import ../lib) kieran ignorePaths;
in { in {
environment.systemPackages = [ environment.systemPackages = [
pkgs.mr pkgs.mr
@@ -18,7 +19,7 @@ in {
pkgs.gitstats pkgs.gitstats
pkgs.patch pkgs.patch
pkgs.patchutils pkgs.patchutils
pkgs.git-preview inputs.self.packages.x86_64-linux.git-preview
]; ];
environment.shellAliases = { environment.shellAliases = {

View File

@@ -3,11 +3,12 @@
pkgs, pkgs,
... ...
}: { }: {
imports = [<niveum/modules/hledger.nix>];
environment.systemPackages = let environment.systemPackages = let
timeLedger = "$HOME/projects/ledger/time.timeclock"; ledgerDirectory = "$HOME/projects/ledger";
timeLedger = "${ledgerDirectory}/time.timeclock";
git = "${pkgs.git}/bin/git -C ${ledgerDirectory}";
in [ in [
pkgs.hledger
(pkgs.writers.writeDashBin "hora-edit" '' (pkgs.writers.writeDashBin "hora-edit" ''
$EDITOR + "${timeLedger}" && ${pkgs.git}/bin/git -C "$(${pkgs.coreutils}/bin/dirname ${timeLedger})" commit --all --message "$(${pkgs.coreutils}/bin/date -Im)" $EDITOR + "${timeLedger}" && ${pkgs.git}/bin/git -C "$(${pkgs.coreutils}/bin/dirname ${timeLedger})" commit --all --message "$(${pkgs.coreutils}/bin/date -Im)"
'') '')
@@ -21,16 +22,18 @@
| sed 's/(fillidefilla:\(.*\))/\1/g' \ | sed 's/(fillidefilla:\(.*\))/\1/g' \
| xsv select date,amount,total,account,description | xsv select date,amount,total,account,description
'') '')
];
niveum.hledger = { (pkgs.writers.writeDashBin "hledger-git" ''
enable = true; if [ "$1" = entry ]; then
ledgerFile = "$HOME/projects/ledger/all.journal"; ${pkgs.hledger}/bin/hledger balance -V > "${ledgerDirectory}/balance.txt"
server = { ${git} add balance.txt
enable = false; ${git} commit --all --message="$(date -Im)"
user = config.users.users.me; else
package = pkgs.hledger-web; ${git} $*
}; fi
package = pkgs.hledger; '')
}; (pkgs.writers.writeDashBin "hledger-edit" ''
$EDITOR ${ledgerDirectory}/current.journal
'')
];
} }

View File

@@ -5,7 +5,7 @@
... ...
}: let }: let
inherit (lib.strings) fileContents; inherit (lib.strings) fileContents;
inherit (import <niveum/lib>) sshPort; inherit (import ../lib) sshPort;
eduroam = { eduroam = {
identity = fileContents <secrets/eduroam/identity>; identity = fileContents <secrets/eduroam/identity>;
password = fileContents <secrets/eduroam/password>; password = fileContents <secrets/eduroam/password>;
@@ -15,10 +15,9 @@
"gid=${toString config.users.groups.users.gid}" "gid=${toString config.users.groups.users.gid}"
"sec=ntlmv2" "sec=ntlmv2"
"workgroup=german" "workgroup=german"
"username=meinhaki" "credentials=${config.age.secrets.cifs-credentials-hu-berlin.path}"
"password=${lib.strings.fileContents <secrets/mail/meinhaki>}"
"noauto" "noauto"
"x-systemd.requires=hu-vpn.service" # "x-systemd.requires=hu-vpn.service"
"x-systemd.automount" "x-systemd.automount"
"x-systemd.device-timeout=1" "x-systemd.device-timeout=1"
"x-systemd.idle-timeout=1min" "x-systemd.idle-timeout=1min"
@@ -36,6 +35,8 @@ in {
options = hu-berlin-cifs-options; options = hu-berlin-cifs-options;
}; };
age.secrets.cifs-credentials-hu-berlin.file = ../secrets/cifs-credentials-hu-berlin.age;
home-manager.users.me.programs.ssh = { home-manager.users.me.programs.ssh = {
matchBlocks = { matchBlocks = {
"alew.hu-berlin.de" = { "alew.hu-berlin.de" = {
@@ -65,16 +66,21 @@ in {
systemd.services.hu-vpn = { systemd.services.hu-vpn = {
enable = true; enable = true;
wants = ["network-online.target"]; wants = ["network-online.target"];
serviceConfig.LoadCredential = "password:${config.age.secrets.email-password-meinhark.path}";
script = '' script = ''
${pkgs.openfortivpn}/bin/openfortivpn -c ${ if ${pkgs.wirelesstools}/bin/iwgetid | ${pkgs.gnugrep}/bin/grep --invert-match eduroam
then
${pkgs.openfortivpn}/bin/openfortivpn \
--password="$(cat "$CREDENTIALS_DIRECTORY/password")" \
--config=${
pkgs.writeText "hu-berlin.config" '' pkgs.writeText "hu-berlin.config" ''
host = forti-ssl.vpn.hu-berlin.de host = forti-ssl.vpn.hu-berlin.de
port = 443 port = 443
trusted-cert = 42193a913d276d9eb86217612956e1e6464d6f07bed5393a4787c87adc4bd359 username = meinhark
username = ${eduroam.identity} trusted-cert = 9e5dea8e077970d245900839f437ef7fb9551559501c7defd70af70ea568573d
password = ${eduroam.password}
'' ''
} }
fi
''; '';
}; };
} }

View File

@@ -2,12 +2,12 @@
config, config,
pkgs, pkgs,
lib, lib,
niveumPackages,
... ...
}: let }: let
inherit (import <niveum/lib>) defaultApplications colours; inherit (import ../lib) defaultApplications colours;
scripts = import <niveum/packages/scripts> {inherit pkgs lib;}; klem = niveumPackages.klem.override {
klem = import <niveum/packages/scripts/klem.nix> { config.dmenu = "${pkgs.dmenu}/bin/dmenu -i -p klem";
inherit pkgs lib;
config.scripts = { config.scripts = {
"p.r" = pkgs.writers.writeDash "p.r" '' "p.r" = pkgs.writers.writeDash "p.r" ''
${pkgs.curl}/bin/curl -fSs http://p.r --data-binary @- \ ${pkgs.curl}/bin/curl -fSs http://p.r --data-binary @- \
@@ -36,10 +36,10 @@
${pkgs.coreutils}/bin/tr '[A-Za-z]' '[N-ZA-Mn-za-m]' ${pkgs.coreutils}/bin/tr '[A-Za-z]' '[N-ZA-Mn-za-m]'
''; '';
"ipa" = pkgs.writers.writeDash "ipa" '' "ipa" = pkgs.writers.writeDash "ipa" ''
${scripts.ipa}/bin/ipa ${niveumPackages.ipa}/bin/ipa
''; '';
"betacode" = pkgs.writers.writeDash "betacode" '' "betacode" = pkgs.writers.writeDash "betacode" ''
${scripts.betacode}/bin/betacode ${niveumPackages.betacode}/bin/betacode
''; '';
"curl" = pkgs.writers.writeDash "curl" '' "curl" = pkgs.writers.writeDash "curl" ''
${pkgs.curl}/bin/curl -fSs "$(${pkgs.coreutils}/bin/cat)" ${pkgs.curl}/bin/curl -fSs "$(${pkgs.coreutils}/bin/cat)"
@@ -47,6 +47,9 @@
ocr = pkgs.writers.writeDash "ocr" '' ocr = pkgs.writers.writeDash "ocr" ''
${pkgs.tesseract4}/bin/tesseract -l eng+deu - stdout ${pkgs.tesseract4}/bin/tesseract -l eng+deu - stdout
''; '';
emojai = pkgs.writers.writeDash "emojai" ''
${pkgs.curl}/bin/curl https://www.emojai.app/api/generate -X POST -H 'Content-Type: application/json' --data-raw "$(${pkgs.jq}/bin/jq -sR '{emoji:.}')" | ${pkgs.jq}/bin/jq -r .result
'';
}; };
}; };
@@ -57,6 +60,23 @@
i3-msg move container to workspace $(($(i3-msg -t get_workspaces | tr , '\n' | grep '"num":' | cut -d : -f 2 | sort -rn | head -1) + 1)) i3-msg move container to workspace $(($(i3-msg -t get_workspaces | tr , '\n' | grep '"num":' | cut -d : -f 2 | sort -rn | head -1) + 1))
''; '';
in { in {
age.secrets = {
github-token-i3status-rust = {
file = ../secrets/github-token-i3status-rust.age;
owner = config.users.users.me.name;
group = config.users.users.me.group;
mode = "400";
};
openweathermap-api-key = {
file = ../secrets/openweathermap-api-key.age;
owner = config.users.users.me.name;
group = config.users.users.me.group;
mode = "400";
};
};
programs.slock.enable = true;
services.xserver = { services.xserver = {
displayManager.defaultSession = "none+i3"; displayManager.defaultSession = "none+i3";
windowManager.i3 = { windowManager.i3 = {
@@ -79,14 +99,19 @@ in {
''; '';
}; };
home-manager.users.me.xsession.windowManager.i3 = { home-manager.users.me.xsession.windowManager.i3 = let
modifier = "Mod4";
in {
enable = true; enable = true;
extraConfig = ''
bindsym --release ${modifier}+Shift+w exec /run/wrappers/bin/slock
'';
config = rec { config = rec {
fonts = { fonts = {
names = ["Sans"]; names = ["Sans"];
size = 10.0; size = 10.0;
}; };
modifier = "Mod4"; inherit modifier;
window = { window = {
titlebar = false; titlebar = false;
border = 1; border = 1;
@@ -175,13 +200,17 @@ in {
text = colours.foreground; text = colours.foreground;
}; };
}; };
statusCommand = "env I3RS_GITHUB_TOKEN=${lib.strings.fileContents <secrets/github/notification.token>} ${pkgs.i3status-rust}/bin/i3status-rs ${ statusCommand = toString (pkgs.writers.writeDash "i3status-rust" ''
(pkgs.formats.toml {}).generate "i3status-rust.toml" (import <niveum/lib/i3status-rust.nix> { export I3RS_GITHUB_TOKEN="$(cat ${config.age.secrets.github-token-i3status-rust.path})"
inherit (config.niveum) batteryName wirelessInterface; export OPENWEATHERMAP_API_KEY="$(cat ${config.age.secrets.openweathermap-api-key.path})"
inherit colours; ${pkgs.i3status-rust}/bin/i3status-rs ${
inherit pkgs; (pkgs.formats.toml {}).generate "i3status-rust.toml" (import ../lib/i3status-rust.nix {
}) inherit (config.niveum) batteryName wirelessInterface;
}"; inherit (config.home-manager.users.me.accounts.email) accounts;
inherit colours;
inherit pkgs;
})
}'');
} }
]; ];
modes.resize = { modes.resize = {
@@ -235,9 +264,8 @@ in {
"${modifier}+Return" = "exec ${(defaultApplications pkgs).terminal}"; "${modifier}+Return" = "exec ${(defaultApplications pkgs).terminal}";
"${modifier}+t" = "exec ${(defaultApplications pkgs).fileManager}"; "${modifier}+t" = "exec ${(defaultApplications pkgs).fileManager}";
"${modifier}+y" = "exec ${(defaultApplications pkgs).browser}"; "${modifier}+y" = "exec ${(defaultApplications pkgs).browser}";
"${modifier}+0" = "exec ${scripts.menu-calc}/bin/="; "${modifier}+0" = "exec ${niveumPackages.menu-calc}/bin/=";
"${modifier}+Shift+w" = "exec ${scripts.k-lock}/bin/k-lock";
"${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 ${ "${modifier}+Shift+d" = "exec ${
pkgs.writers.writeDash "notemenu" '' pkgs.writers.writeDash "notemenu" ''
@@ -260,16 +288,22 @@ in {
}"; }";
"${modifier}+p" = "exec rofi-pass"; "${modifier}+p" = "exec rofi-pass";
"${modifier}+Shift+p" = "exec rofi-pass --insert"; "${modifier}+Shift+p" = "exec rofi-pass --insert";
"${modifier}+u" = "exec ${scripts.unicodmenu}/bin/unicodmenu"; "${modifier}+u" = "exec ${niveumPackages.unicodmenu}/bin/unicodmenu";
"${modifier}+F6" = "exec ${pkgs.xorg.xkill}/bin/xkill"; "${modifier}+F6" = "exec ${pkgs.xorg.xkill}/bin/xkill";
"${modifier}+F7" = "exec ${scripts.showkeys-toggle}/bin/showkeys-toggle"; "${modifier}+F7" = "exec ${pkgs.writers.writeDash "showkeys-toggle" ''
if ${pkgs.procps}/bin/pgrep screenkey; then
exec ${pkgs.procps}/bin/pkill screenkey
else
exec ${pkgs.screenkey}/bin/screenkey
fi
''}";
"${modifier}+F8" = "exec switch-theme toggle"; "${modifier}+F8" = "exec switch-theme toggle";
"${modifier}+F9" = "exec ${pkgs.redshift}/bin/redshift -O 4000 -b 0.85"; "${modifier}+F9" = "exec ${pkgs.redshift}/bin/redshift -O 4000 -b 0.85";
"${modifier}+F10" = "exec ${pkgs.redshift}/bin/redshift -x"; "${modifier}+F10" = "exec ${pkgs.redshift}/bin/redshift -x";
"${modifier}+F11" = "exec ${pkgs.xcalib}/bin/xcalib -invert -alter"; "${modifier}+F11" = "exec ${pkgs.xcalib}/bin/xcalib -invert -alter";
"${modifier}+F12" = "exec ${klem}/bin/klem"; "${modifier}+F12" = "exec ${klem}/bin/klem";
"Print" = "exec flameshot-once"; "Print" = "exec flameshot gui";
"XF86AudioLowerVolume" = "exec ${pkgs.pamixer}/bin/pamixer -d 5"; "XF86AudioLowerVolume" = "exec ${pkgs.pamixer}/bin/pamixer -d 5";
"XF86AudioMute" = "exec ${pkgs.pamixer}/bin/pamixer -t"; "XF86AudioMute" = "exec ${pkgs.pamixer}/bin/pamixer -t";
"XF86AudioRaiseVolume" = "exec ${pkgs.pamixer}/bin/pamixer -i 5"; "XF86AudioRaiseVolume" = "exec ${pkgs.pamixer}/bin/pamixer -i 5";
@@ -279,9 +313,9 @@ in {
"XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl next"; "XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl next";
"XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl previous"; "XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl previous";
"XF86AudioStop" = "exec ${pkgs.playerctl}/bin/playerctl stop"; "XF86AudioStop" = "exec ${pkgs.playerctl}/bin/playerctl stop";
"XF86ScreenSaver" = "exec ${scripts.k-lock}/bin/k-lock"; "XF86ScreenSaver" = "exec ${niveumPackages.k-lock}/bin/k-lock";
"XF86Display" = "exec ${scripts.dmenurandr}/bin/dmenurandr"; "XF86Display" = "exec ${niveumPackages.dmenu-randr}/bin/dmenu-randr";
# key names detected with xorg.xev: # key names detected with xorg.xev:
# XF86WakeUp (fn twice) # XF86WakeUp (fn twice)

View File

@@ -8,14 +8,29 @@
kmeinCloud = { kmeinCloud = {
davEndpoint = "https://cloud.xn--kiern-0qa.de/remote.php/dav"; davEndpoint = "https://cloud.xn--kiern-0qa.de/remote.php/dav";
username = "kieran"; username = "kieran";
password = lib.fileContents <secrets/nextcloud/password>; passwordFile = config.age.secrets.nextcloud-password-kieran.path;
}; };
fysiCloud = { fysiCloud = {
davEndpoint = "https://nextcloud.fysi.dev/remote.php/dav"; davEndpoint = "https://nextcloud.fysi.dev/remote.php/dav";
username = "kmein"; username = "kmein";
password = lib.fileContents <secrets/nextcloud-fysi/password>; passwordFile = config.age.secrets.nextcloud-password-fysi.path;
}; };
in { in {
age.secrets = {
nextcloud-password-kieran = {
file = ../secrets/nextcloud-password-kieran.age;
owner = config.users.users.me.name;
group = config.users.users.me.group;
mode = "400";
};
nextcloud-password-fysi = {
file = ../secrets/nextcloud-password-fysi.age;
owner = config.users.users.me.name;
group = config.users.users.me.group;
mode = "400";
};
};
environment.systemPackages = [ environment.systemPackages = [
pkgs.khal pkgs.khal
pkgs.vdirsyncer pkgs.vdirsyncer
@@ -167,19 +182,19 @@ in {
type = "carddav" type = "carddav"
url = "${kmeinCloud.davEndpoint}/addressbooks/users/${kmeinCloud.username}/" url = "${kmeinCloud.davEndpoint}/addressbooks/users/${kmeinCloud.username}/"
username = "${kmeinCloud.username}" username = "${kmeinCloud.username}"
password = "${kmeinCloud.password}" password.fetch = ["command", "cat", "${kmeinCloud.passwordFile}"]
[storage kalender_cloud] [storage kalender_cloud]
type = "caldav" type = "caldav"
url = "${kmeinCloud.davEndpoint}/calendars/${kmeinCloud.username}/" url = "${kmeinCloud.davEndpoint}/calendars/${kmeinCloud.username}/"
username = "${kmeinCloud.username}" username = "${kmeinCloud.username}"
password = "${kmeinCloud.password}" password.fetch = ["command", "cat", "${kmeinCloud.passwordFile}"]
[storage fysi_cloud] [storage fysi_cloud]
type = "caldav" type = "caldav"
url = "${fysiCloud.davEndpoint}/calendars/${fysiCloud.username}/" url = "${fysiCloud.davEndpoint}/calendars/${fysiCloud.username}/"
username = "${fysiCloud.username}" username = "${fysiCloud.username}"
password = "${fysiCloud.password}" password.fetch = ["command", "cat", "${fysiCloud.passwordFile}"]
''; '';
}; };
}; };

View File

@@ -2,10 +2,10 @@
pkgs, pkgs,
lib, lib,
config, config,
niveumPackages,
... ...
}: let }: let
scripts = import <niveum/packages/scripts> {inherit pkgs lib;}; swallow = command: "${niveumPackages.swallow}/bin/swallow ${command}";
swallow = command: "${scripts.swallow}/bin/swallow ${command}";
in { in {
environment.shellAliases.smpv = swallow "mpv"; environment.shellAliases.smpv = swallow "mpv";
@@ -23,6 +23,7 @@ in {
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"; screenshot-template = "%F-%wH%wM%wS-%#04n";
script-opts = "ytdl_hook-ytdl_path=${pkgs.yt-dlp}/bin/yt-dlp"; script-opts = "ytdl_hook-ytdl_path=${pkgs.yt-dlp}/bin/yt-dlp";
ao = "pulse"; # no pipewire for me :(
}; };
bindings = { bindings = {
"Alt+RIGHT" = "add video-rotate 90"; "Alt+RIGHT" = "add video-rotate 90";
@@ -36,7 +37,7 @@ in {
}; };
scripts = [ scripts = [
pkgs.mpvScripts.youtube-quality pkgs.mpvScripts.youtube-quality
(pkgs.callPackage <niveum/packages/mpv-visualizer.nix> {}) niveumPackages.mpv-visualizer
]; ];
}; };
}; };

View File

@@ -1,172 +0,0 @@
{
pkgs,
lib,
...
}: let
mainMailbox = "posteo";
accounts = import <niveum/lib/email.nix> {inherit lib mainMailbox;};
neomuttConfig = emailAccounts: let
as-pdf = pkgs.writers.writeDash "as-pdf" ''
d=$(mktemp -d)
trap clean EXIT
clean() {
rm -rf "$d"
}
${pkgs.libreoffice}/bin/libreoffice --headless --convert-to pdf "$1" --outdir "$d"
${pkgs.zathura}/bin/zathura "$d"/*.pdf
'';
in ''
set mailcap_path = ${
pkgs.writeText "mailcap" ''
text/plain; $EDITOR %s ;
text/html; ${pkgs.lynx}/bin/lynx -assume_charset=%{charset} -display_charset=utf-8 -dump %s; nametemplate=%s.html; copiousoutput;
image/*; ${pkgs.nsxiv}/bin/nsxiv %s ;
video/*; ${pkgs.util-linux}/bin/setsid ${pkgs.mpv}/bin/mpv --quiet %s &; copiousoutput
audio/*; ${pkgs.mpv}/bin/mpv %s ;
application/pdf; ${pkgs.zathura}/bin/zathura %s ;
application/pgp-encrypted; ${pkgs.gnupg}/bin/gpg -d '%s'; copiousoutput;
application/pgp-keys; ${pkgs.gnupg}/bin/gpg --import '%s'; copiousoutput;
application/vnd.openxmlformats-officedocument.wordprocessingml.document; ${as-pdf} %s;
application/vnd.oasis.opendocument.text; ${as-pdf} %s;
application/vnd.openxmlformats*; ${pkgs.libreoffice}/bin/soffice '%s';
''
}:$mailcap_path
set sidebar_visible
set sidebar_format = "%D%?F? [%F]?%* %?N?%N/?%S"
set sidebar_width = 25 # Plenty of space
set sidebar_divider_char = '' # Pretty line-drawing character
set mail_check_stats
set index_format="%2C %Z %D %-15.15L %s"
set date_format="%F %R"
set sort = 'reverse-date'
set sleep_time = 0 # Pause 0 seconds for informational messages
set markers = no # Disables the `+` displayed at line wraps
set mark_old = no # Unread mail stay unread until read
set wait_key = no # mutt won't ask "press key to continue"
set fast_reply # skip to compose when replying
set forward_format = "Fwd: %s" # format of subject when forwarding
set reverse_name # reply as whomever it was to
set include=ask-no # don't include message in replies
auto_view text/html # automatically show html (mailcap uses lynx)
auto_view application/pgp-encrypted
alternative_order text/plain text/enriched text/html
set abort_noattach abort_noattach_regex="\<(attach|attached|attachments?|anbei|Anhang|angehängt)\>"
set attach_save_dir=/tmp
set fast_reply
set narrow_tree # narrow threads for more depth
bind index,pager B sidebar-toggle-visible # Use 'B' to switch the Sidebar on and off
bind index,pager \Ck sidebar-prev
bind index,pager \Cj sidebar-next
bind index,pager \Co sidebar-open
bind index,pager \Cp sidebar-prev-new
bind index,pager \Cn sidebar-next-new
macro index * <limit>~F\r
macro index + <limit>all\r
set query_command = "khard email --parsable %s"
bind editor <Tab> complete-query
bind editor ^T complete
set mail_check = 90
set timeout = 15
# set imap_check_subscribed
set use_from
set header_cache="~/.cache/mutt" message_cachedir="~/.cache/mutt"
source ${
pkgs.writeText "accounts.neomuttrc" ''
set realname = "Kierán Meinhardt"
account-hook . 'unset imap_user imap_pass smtp_user smtp_pass'
# set accordingly: postponed trash record
${
lib.concatStringsSep "\n\n" (lib.mapAttrsToList (name: account: let
imapRoot = "imaps://${account.user}@${account.imap}";
in ''
account-hook ${account.user}@${account.imap} 'set imap_user="${account.user}" imap_pass="${account.password}"'
account-hook ${account.user}@${account.smtp} 'set smtp_user="${account.user}" smtp_pass="${account.password}"'
folder-hook ${account.user}@${account.imap} 'set smtp_url="${account.smtpSettings "${account.user}@${account.smtp}"}" from="${account.address}" record="${imapRoot}/${account.folders.sent}" postponed="${imapRoot}/${account.folders.drafts}" trash="${imapRoot}/${account.folders.trash}"'
named-mailboxes "${name}" "${imapRoot}" "${name}" "${imapRoot}/${account.folders.sent}"
'')
emailAccounts)
}
''
}
set spoolfile="${mainMailbox}"
source ${
pkgs.writeText "colors.neomuttrc" ''
# Default index colors:
color index_number blue default
color index red default '.*'
color index_flags lightcyan default '.*'
color index_author yellow default '.*'
color index_subject default default '.*'
# New mail is boldened:
color index_author lightyellow default "~N"
color index_subject lightwhite default "~N"
# Flagged mail is highlighted:
color index_flags lightmagenta default '~F'
# Other colors and aesthetic settings:
mono bold bold
mono underline underline
mono error bold
mono indicator reverse
# color sidebar_flagged red black
mono sidebar_new bold
color error red default
color message cyan default
color search brightmagenta default
color hdrdefault lightblack default
color quoted green default
color quoted1 blue default
color quoted2 cyan default
color quoted3 yellow default
color quoted4 red default
color quoted5 brightred default
color signature lightblack default
color tree color235 default
# Regex highlighting:
color header red default "^(Date)"
color header yellow default "^(From)"
color header white default "^(B?CC)"
color header brightwhite default "^(Subject)"
color body cyan default "[\-\.+_a-zA-Z0-9]+@[\-\.a-zA-Z0-9]+" # Email addresses
color body brightblue default "(https?|ftp)://[\-\.,/%~_:?&=\#a-zA-Z0-9]+" # URL
color body yellow default "^(\t| )*(-|\\*) \.*" # List items as yellow
color body red default "(BAD signature)|^gpg: BAD signature from.*"
color body brightgreen default "(Good signature)|^gpg: Good signature .*"
color body brightyellow default "^gpg: "
mono body bold "^gpg: Good signature"
mono body bold "^gpg: BAD signature from.*"
color body red default "([a-z][a-z0-9+-]*://(((([a-z0-9_.!~*'();:&=+$,-]|%[0-9a-f][0-9a-f])*@)?((([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?|[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)(:[0-9]+)?)|([a-z0-9_.!~*'()$,;:@&=+-]|%[0-9a-f][0-9a-f])+)(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?(#([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?|(www|ftp)\\.(([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?(:[0-9]+)?(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?(#([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?)[^].,:;!)? \t\r\n<>\"]"
''
}
'';
in {
environment.systemPackages = [pkgs.neomutt];
environment.shellAliases =
lib.mapAttrs' (accountName: account:
lib.nameValuePair
"mua-${accountName}"
"${pkgs.neomutt}/bin/neomutt -F ${pkgs.writeText "neomuttrc-${accountName}" (neomuttConfig {"${accountName}" = accounts.${accountName};})}")
accounts
// {mua = "${pkgs.neomutt}/bin/neomutt -f ${mainMailbox}";};
home-manager.users.me.xdg.configFile."neomutt/neomuttrc".text = neomuttConfig accounts;
}

View File

@@ -1,30 +1,22 @@
{pkgs, ...}: { {
pkgs,
niveumPackages,
...
}: {
environment.variables.EDITOR = pkgs.lib.mkForce "nvim"; environment.variables.EDITOR = pkgs.lib.mkForce "nvim";
environment.shellAliases.vi = "nvim"; environment.shellAliases.vi = "nvim";
environment.shellAliases.vim = "nvim"; environment.shellAliases.vim = "nvim";
environment.shellAliases.view = "nvim -R"; environment.shellAliases.view = "nvim -R";
nixpkgs.config.packageOverrides = pkgs: {
vimPlugins =
pkgs.vimPlugins
// {
cheat-sh-vim = pkgs.callPackage <niveum/packages/vimPlugins/cheat-sh.nix> {};
vim-fetch = pkgs.callPackage <niveum/packages/vimPlugins/vim-fetch.nix> {};
vim-colors-paramount = pkgs.callPackage <niveum/packages/vimPlugins/vim-colors-paramount.nix> {};
vim-256noir = pkgs.callPackage <niveum/packages/vimPlugins/vim-256noir.nix> {};
icalendar-vim = pkgs.callPackage <niveum/packages/vimPlugins/icalendar-vim.nix> {};
jq-vim = pkgs.callPackage <niveum/packages/vimPlugins/jq-vim.nix> {};
vim-fsharp = pkgs.callPackage <niveum/packages/vimPlugins/vim-fsharp.nix> {};
vim-reason-plus = pkgs.callPackage <niveum/packages/vimPlugins/vim-reason-plus.nix> {};
vim-mail = pkgs.callPackage <niveum/packages/vimPlugins/vim-mail.nix> {};
};
};
environment.systemPackages = [ environment.systemPackages = [
(pkgs.writers.writeDashBin "vim" ''neovim "$@"'') (pkgs.writers.writeDashBin "vim" ''neovim "$@"'')
(pkgs.neovim.override { (pkgs.neovim.override {
configure = { configure = {
customRC = builtins.readFile <niveum/lib/vim/init.vim>; customRC = ''
source ${../lib/vim/init.vim}
luafile ${../lib/vim/init.lua}
'';
packages.nvim = with pkgs.vimPlugins; { packages.nvim = with pkgs.vimPlugins; {
start = [ start = [
ale ale
@@ -34,11 +26,12 @@
undotree undotree
tabular tabular
# vimwiki # vimwiki
vim-colors-paramount niveumPackages.vimPlugins-vim-colors-paramount
nvim-lspconfig
vim-commentary vim-commentary
vim-css-color vim-css-color
vim-eunuch vim-eunuch
vim-fetch niveumPackages.vimPlugins-vim-fetch
vim-fugitive vim-fugitive
vim-gitgutter vim-gitgutter
vim-repeat vim-repeat
@@ -61,8 +54,8 @@
elm-vim elm-vim
emmet-vim emmet-vim
haskell-vim haskell-vim
icalendar-vim niveumPackages.vimPlugins-icalendar-vim
jq-vim niveumPackages.vimPlugins-jq-vim
rust-vim rust-vim
typescript-vim typescript-vim
vim-javascript vim-javascript
@@ -71,7 +64,7 @@
vimtex vimtex
vim-pandoc vim-pandoc
vim-pandoc-syntax vim-pandoc-syntax
vim-256noir niveumPackages.vimPlugins-vim-256noir
]; ];
}; };
}; };

View File

@@ -42,8 +42,6 @@
}; };
}; };
in { in {
imports = [<niveum/modules/networkmanager-declarative.nix>];
programs.nm-applet.enable = true; programs.nm-applet.enable = true;
networking.networkmanager = { networking.networkmanager = {
@@ -55,39 +53,6 @@ in {
wifi.macAddress = "random"; wifi.macAddress = "random";
ethernet.macAddress = "random"; ethernet.macAddress = "random";
unmanaged = ["docker*"]; unmanaged = ["docker*"];
profiles = lib.mapAttrs profile {
Aether = {
connection.uuid = "7138bb0f-1aeb-4905-890e-a6628427aa21";
ipv6.addr-gen-mode = "stable";
wifi.cloned-mac-address = "stable";
wifi-security = {
psk = lib.strings.fileContents <secrets/wifi/Aether.psk>;
auth-alg = "open";
key-mgmt = "wpa-psk";
};
};
FactoryCommunityGuest = {
connection.uuid = "fb1f2e52-651e-48b5-a72c-1accddf31afb";
connection.timestamp = "1631885129";
wifi.seen-bssids = "54:EC:2F:19:30:DC;54:EC:2F:19:5C:9C;54:EC:2F:58:E4:3C;";
wifi-security = {
psk = "Factory4ever";
auth-alg = "open";
key-mgmt = "wpa-psk";
};
};
o2-WLAN66 = {
connection.uuid = "c563aec3-f344-4ffb-8d1c-60a6cdac8fe0";
wifi-security = {
psk = "PK3468KV488T934U";
auth-alg = "open";
key-mgmt = "wpa-psk";
};
};
"WIFI@DB".connection.uuid = "4eff4e94-8850-4e9f-a338-1787d0d90479";
eduroam = eduroamProfile;
eduroam_5GHz = eduroamProfile;
};
}; };
users.users.me.extraGroups = ["networkmanager"]; users.users.me.extraGroups = ["networkmanager"];

View File

@@ -4,8 +4,6 @@
lib, lib,
... ...
}: let }: let
scripts = import <niveum/packages/scripts> {inherit pkgs lib;};
ytdl-format = "'bestvideo[height<=?720][fps<=?30][vcodec!=?vp9]+bestaudio/best'"; ytdl-format = "'bestvideo[height<=?720][fps<=?30][vcodec!=?vp9]+bestaudio/best'";
youtube-download = "${pkgs.ts}/bin/ts ${pkgs.yt-dlp}/bin/yt-dlp -f ${ytdl-format} --add-metadata"; youtube-download = "${pkgs.ts}/bin/ts ${pkgs.yt-dlp}/bin/yt-dlp -f ${ytdl-format} --add-metadata";

View File

@@ -1,13 +1,9 @@
{pkgs, ...}: { {pkgs, ...}: {
nixpkgs = { nixpkgs = {
config.allowUnfree = true; config.allowUnfree = true;
overlays = [
(import <nix-writers/pkgs>)
(import <stockholm/krebs/5pkgs>)
];
}; };
nix = { nix = {
package = pkgs.nixUnstable; package = pkgs.nixFlakes;
extraOptions = "experimental-features = nix-command flakes"; extraOptions = "experimental-features = nix-command flakes";
}; };
} }

View File

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

View File

@@ -1,14 +1,12 @@
{ {
config,
pkgs, pkgs,
lib, lib,
inputs,
niveumPackages,
... ...
}: let }: let
hc = pkgs.callPackage <stockholm/tv/5pkgs/simple/hc.nix> {utillinux = pkgs.util-linux;}; worldradio = pkgs.callPackage ../packages/worldradio.nix {};
worldradio = pkgs.callPackage <niveum/packages/worldradio.nix> {};
menstruation = pkgs.callPackage <menstruation-backend> {};
pandoc-doc = pkgs.callPackage <niveum/packages/man/pandoc.nix> {};
scripts = import <niveum/packages/scripts> {inherit pkgs lib;};
zoteroStyle = { zoteroStyle = {
name, name,
@@ -55,8 +53,6 @@
' $out/astrolog/astrolog.as ' $out/astrolog/astrolog.as
''; '';
}); });
recht = pkgs.callPackage <recht> {};
in { in {
home-manager.users.me.home.file = { home-manager.users.me.home.file = {
".csl".source = cslDirectory; ".csl".source = cslDirectory;
@@ -79,6 +75,7 @@ in {
ffmpeg ffmpeg
imagemagick imagemagick
exiftool exiftool
nsxiv
# ARCHIVE TOOLS # ARCHIVE TOOLS
unzip unzip
unrar unrar
@@ -137,68 +134,65 @@ in {
okular # the word is nucular okular # the word is nucular
xournalpp # for annotating pdfs xournalpp # for annotating pdfs
pdfpc # presenter console for pdf slides pdfpc # presenter console for pdf slides
hc # print files as qr codes niveumPackages.hc # print files as qr codes
yt-dlp yt-dlp
espeak espeak
bc # calculator bc # calculator
pari # gp -- better calculator pari # gp -- better calculator
rink # unit converter rink # unit converter
scripts.auc niveumPackages.auc
scripts.stackoverflow niveumPackages.cheat-sh
scripts.infschmv niveumPackages.infschmv
scripts.qrpaste niveumPackages.qrpaste
scripts.ttspaste niveumPackages.ttspaste
scripts.new-mac # get a new mac address niveumPackages.new-mac # get a new mac address
scripts.scanned niveumPackages.scanned
scripts.default-gateway niveumPackages.default-gateway
scripts.showkeys-toggle niveumPackages.kirciuoklis
scripts.kirciuoklis niveumPackages.image-convert-favicon
scripts.favicon niveumPackages.heuretes
scripts.heuretes niveumPackages.ipa # XSAMPA to IPA converter
scripts.ipa # XSAMPA to IPA converter niveumPackages.pls
scripts.playlist niveumPackages.mpv-tv
scripts.mpv-tv niveumPackages.devanagari
scripts.devanagari niveumPackages.betacode # ancient greek betacode to unicode converter
scripts.betacode # ancient greek betacode to unicode converter niveumPackages.meteo
scripts.meteo niveumPackages.mahlzeit
scripts.mahlzeit niveumPackages.vimv
recht niveumPackages.swallow # window swallowing
scripts.vimv niveumPackages.literature-quote
scripts.swallow # window swallowing
scripts.literature-quote
jless # less(1) for json jless # less(1) for json
scripts.notetags niveumPackages.booksplit
scripts.booksplit niveumPackages.dmenu-randr
scripts.dmenurandr niveumPackages.dmenu-bluetooth
scripts.interdimensional-cable niveumPackages.manual-sort
scripts.dmenubluetooth niveumPackages.dns-sledgehammer
scripts.manual-sort
scripts.much-scripts
scripts.dns-sledgehammer
ts ts
scripts.vg niveumPackages.vg
scripts.fkill niveumPackages.fkill
scripts.wttr niveumPackages.wttr
scripts.unicodmenu niveumPackages.unicodmenu
scripts.closest niveumPackages.closest
scripts.trans niveumPackages.trans
scripts.mpv-radio (niveumPackages.mpv-radio.override {
di-fm-key-file = config.age.secrets.di-fm-key.path;
})
# kmein.slide # kmein.slide
termdown termdown
scripts.alarm niveumPackages.image-convert-tolino
scripts.tolino-screensaver niveumPackages.rfc
scripts.rfc niveumPackages.tag
scripts.tag niveumPackages.timer
scripts.timer niveumPackages.menu-calc
python3Packages.eyeD3
scripts.menu-calc
nix-prefetch-git nix-prefetch-git
scripts.nix-git niveumPackages.nix-git
nixfmt nixfmt
par par
qrencode qrencode
menstruation inputs.menstruation-backend.defaultPackage.x86_64-linux
inputs.agenix.packages.x86_64-linux.default
inputs.recht.defaultPackage.x86_64-linux
(pkgs.writers.writeDashBin "worldradio" '' (pkgs.writers.writeDashBin "worldradio" ''
shuf ${worldradio} | ${pkgs.findutils}/bin/xargs ${pkgs.mpv}/bin/mpv --no-video shuf ${worldradio} | ${pkgs.findutils}/bin/xargs ${pkgs.mpv}/bin/mpv --no-video
@@ -208,24 +202,24 @@ in {
${pkgs.openssh}/bin/ssh makanek "cd /var/lib/weechat/logs && grep --ignore-case --color=always --recursive $@" | ${pkgs.less}/bin/less --raw-control-chars ${pkgs.openssh}/bin/ssh makanek "cd /var/lib/weechat/logs && grep --ignore-case --color=always --recursive $@" | ${pkgs.less}/bin/less --raw-control-chars
'') '')
(pkgs.writers.writeDashBin "ncmpcpp-zaatar" ''MPD_HOST=${(import <niveum/lib/local-network.nix>).zaatar} exec ${pkgs.ncmpcpp}/bin/ncmpcpp "$@"'') (pkgs.writers.writeDashBin "ncmpcpp-zaatar" ''MPD_HOST=${(import ../lib/local-network.nix).zaatar} exec ${pkgs.ncmpcpp}/bin/ncmpcpp "$@"'')
(pkgs.writers.writeDashBin "mpc-zaatar" ''MPD_HOST=${(import <niveum/lib/local-network.nix>).zaatar} exec ${pkgs.mpc_cli}/bin/mpc "$@"'') (pkgs.writers.writeDashBin "mpc-zaatar" ''MPD_HOST=${(import ../lib/local-network.nix).zaatar} exec ${pkgs.mpc_cli}/bin/mpc "$@"'')
inputs.scripts.packages.x86_64-linux.alarm
spotify spotify
ncspot ncspot
playerctl playerctl
nix-index nix-index
scripts.nix-index-update niveumPackages.nix-index-update
#krebs #krebs
dic niveumPackages.dic
cyberlocker-tools niveumPackages.cyberlocker-tools
untilport niveumPackages.untilport
kpaste niveumPackages.kpaste
irc-announce config.nur.repos.mic92.ircsink
git-preview
ircaids
(python3.withPackages (py: [ (python3.withPackages (py: [
py.black py.black
@@ -239,6 +233,13 @@ in {
])) ]))
# python3Packages.poetry # python3Packages.poetry
# language servers
pyright
haskell-language-server
texlab
nil
rust-analyzer
html-tidy html-tidy
nodePackages.csslint nodePackages.csslint
nodePackages.jsonlint nodePackages.jsonlint
@@ -252,14 +253,14 @@ in {
latexrun latexrun
(aspellWithDicts (dict: [dict.de dict.en dict.en-computers])) (aspellWithDicts (dict: [dict.de dict.en dict.en-computers]))
# haskellPackages.pandoc-citeproc # haskellPackages.pandoc-citeproc
scripts.text2pdf niveumPackages.text2pdf
lowdown lowdown
glow # markdown to term glow # markdown to term
libreoffice libreoffice
# gnumeric # gnumeric
dia dia
pandoc pandoc
pandoc-doc niveumPackages.man-pandoc
# proselint # proselint
asciidoctor asciidoctor
wordnet wordnet
@@ -270,11 +271,17 @@ in {
shellcheck shellcheck
(pkgs.writers.writeDashBin "hass-cli" '' (pkgs.writers.writeDashBin "hass-cli" ''
HASS_SERVER=http://zaatar.r:8123 HASS_TOKEN=${lib.strings.fileContents <secrets/hass/token>} exec ${pkgs.home-assistant-cli}/bin/hass-cli "$@" HASS_SERVER=http://zaatar.r:8123 HASS_TOKEN="$(cat ${config.age.secrets.home-assistant-token.path})" exec ${pkgs.home-assistant-cli}/bin/hass-cli "$@"
'') '')
scripts.rofi-hass
]; ];
age.secrets.home-assistant-token = {
file = ../secrets/home-assistant-token.age;
owner = config.users.users.me.name;
group = config.users.users.me.group;
mode = "400";
};
home-manager.users.me.xdg.configFile."pycodestyle".text = '' home-manager.users.me.xdg.configFile."pycodestyle".text = ''
[pycodestyle] [pycodestyle]
max-line-length = 110 max-line-length = 110

25
configs/picom.nix Normal file
View File

@@ -0,0 +1,25 @@
{
services.picom = {
enable = true;
activeOpacity = 1;
fade = true;
fadeDelta = 1;
inactiveOpacity = 0.9;
shadow = true;
menuOpacity = 0.9;
shadowOpacity = 0.3;
fadeExclude = [
"class_g = 'slock'" # don't want a transparent lock screen!
"name *?= 'slock'"
"focused = 1"
];
opacityRules = [
# opacity-rule overrides both inactive and active opacity
# video in browser tabs
# substring /regex match of title bar text
"99:name *?= 'Youtube'"
"99:WM_CLASS@:s *= 'mpv$'"
];
};
}

View File

@@ -5,15 +5,13 @@
}: let }: let
suspend = pkgs.writers.writeDash "suspend" "${pkgs.systemd}/bin/systemctl suspend"; suspend = pkgs.writers.writeDash "suspend" "${pkgs.systemd}/bin/systemctl suspend";
in { in {
imports = [<stockholm/krebs/3modules/power-action.nix>]; services.power-action = {
krebs.power-action = {
enable = true; enable = true;
plans.suspend = { plans.suspend = {
upperLimit = 7; upperLimit = 7;
lowerLimit = 0; lowerLimit = 0;
charging = false; charging = false;
action = pkgs.writeDash "suspend-wrapper" '' action = pkgs.writers.writeDash "suspend-wrapper" ''
/run/wrappers/bin/sudo ${suspend} /run/wrappers/bin/sudo ${suspend}
''; '';
}; };
@@ -21,6 +19,6 @@ in {
}; };
security.sudo.extraConfig = '' security.sudo.extraConfig = ''
${config.krebs.power-action.user} ALL= (root) NOPASSWD: ${suspend} ${config.services.power-action.user} ALL= (root) NOPASSWD: ${suspend}
''; '';
} }

View File

@@ -1,5 +1,5 @@
{pkgs, ...}: let {pkgs, ...}: let
inherit (import <niveum/lib>) localAddresses; inherit (import ../lib) localAddresses;
hp-driver = pkgs.hplip; hp-driver = pkgs.hplip;
in { in {
services.printing = { services.printing = {

View File

@@ -3,14 +3,10 @@
pkgs, pkgs,
... ...
}: { }: {
imports = [
<retiolum/modules/retiolum>
];
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 = { services.tinc.networks.retiolum = {
rsaPrivateKeyFile = toString <system-secrets/retiolum.key>; rsaPrivateKeyFile = config.age.secrets.retiolum-rsa.path;
ed25519PrivateKeyFile = toString <system-secrets/retiolum.ed25519>; ed25519PrivateKeyFile = config.age.secrets.retiolum-ed25519.path;
}; };
} }

View File

@@ -4,24 +4,40 @@
lib, lib,
... ...
}: let }: let
inherit (import <niveum/lib>) sshPort kieran; inherit (import ../lib) sshPort kieran;
externalNetwork = import <niveum/lib/external-network.nix>; externalNetwork = import ../lib/external-network.nix;
sshIdentity = name: "${config.users.users.me.home}/.ssh/${name}"; sshIdentity = name: "${config.users.users.me.home}/.ssh/${name}";
ssh-passphrase = lib.strings.fileContents <system-secrets/ssh/passphrase>;
in { in {
services.xserver.displayManager.sessionCommands = toString (pkgs.writeScript "ssh-add" ''
#!${pkgs.expect}/bin/expect -f
spawn ${pkgs.openssh}/bin/ssh-add
expect "Enter passphrase for *:"
send "${ssh-passphrase}\n";
expect "Identity added: *"
interact
'');
programs.ssh.startAgent = true;
users.users.me.openssh.authorizedKeys.keys = kieran.sshKeys pkgs; users.users.me.openssh.authorizedKeys.keys = kieran.sshKeys pkgs;
home-manager.users.me = {
services.gpg-agent = rec {
enable = true;
enableSshSupport = true;
defaultCacheTtlSsh = 2 * 60 * 60;
maxCacheTtlSsh = 4 * defaultCacheTtlSsh;
sshKeys = [
"568047C91DE03A23883E340F15A9C24D313E847C"
"BB3EE102DB8CD45540A78A6B18B511B67061F6B4" # kfm@manakish ed25519
"3F8986755818B5762A096BE212777EAAC441DD9D" # fysiweb rsa
"0E4ABD229432486CC432639BB0986B2CDE365105" # agenix ed25519
"A1E8D32CBFCDBD2DE798E2298D795CCFD785AE06" # kfm@kabsa ed25519
];
};
};
environment.extraInit = ''
if [[ -z "$SSH_AUTH_SOCK" ]]; then
export SSH_AUTH_SOCK="$(${pkgs.gnupg}/bin/gpgconf --list-dirs agent-ssh-socket)"
fi
'';
environment.interactiveShellInit = ''
GPG_TTY="$(tty)"
export GPG_TTY
${pkgs.gnupg}/bin/gpg-connect-agent updatestartuptty /bye > /dev/null
'';
home-manager.users.me.programs.ssh = { home-manager.users.me.programs.ssh = {
enable = true; enable = true;
matchBlocks = rec { matchBlocks = rec {
@@ -72,6 +88,8 @@ in {
hostname = "135.181.85.233"; hostname = "135.181.85.233";
user = "root"; user = "root";
}; };
"cms-dev.woc2023.app".identityFile = sshIdentity "fysiweb";
"cms-master.woc2023.app".identityFile = sshIdentity "fysiweb";
"fysi-dev1" = { "fysi-dev1" = {
hostname = "94.130.229.139"; hostname = "94.130.229.139";
user = "root"; user = "root";

View File

@@ -4,7 +4,7 @@
pkgs, pkgs,
... ...
}: let }: let
inherit (import <niveum/lib>) sshPort kieran; inherit (import ../lib) sshPort kieran;
in { in {
users.motd = "Welcome to ${config.networking.hostName}!"; users.motd = "Welcome to ${config.networking.hostName}!";

View File

@@ -158,6 +158,16 @@
sha256 = "03f9wdmkgpjifpms7dyh10ma29wf3ka1j3zlp1av0cybhdldk2a8"; sha256 = "03f9wdmkgpjifpms7dyh10ma29wf3ka1j3zlp1av0cybhdldk2a8";
}; };
}; };
turkish = {
BabylonTurkishEnglish = pkgs.fetchzip {
url = "http://download.huzheng.org/babylon/bidirectional/stardict-babylon-Babylon_Turkish_English-2.4.2.tar.bz2";
sha256 = "17rv46r95nkikg7aszqmfrbgdhz9ny52w423m8n01g3p93shdb4i";
};
BabylonEnglishTurkish = pkgs.fetchzip {
url = "http://download.huzheng.org/babylon/bidirectional/stardict-babylon-Babylon_English_Turkish-2.4.2.tar.bz2";
sha256 = "063dl02s8ii8snsxgma8wi49xwr6afk6ysq0v986fygx5511353f";
};
};
}; };
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);
@@ -169,7 +179,7 @@
exec ${pkgs.sdcv}/bin/sdcv --color --only-data-dir --data-dir ${makeStardictDataDir dicts} "$@" exec ${pkgs.sdcv}/bin/sdcv --color --only-data-dir --data-dir ${makeStardictDataDir dicts} "$@"
''; '';
sdcvPager = pkgs.writeDash "sdcvPager" '' 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 " sed "
s!<sup>1</sup>!¹!gI s!<sup>1</sup>!¹!gI
@@ -292,7 +302,8 @@ in {
// dictionaries.sanskrit // dictionaries.sanskrit
// dictionaries.oed // dictionaries.oed
// dictionaries.russian // dictionaries.russian
// dictionaries.englishGerman)); // dictionaries.englishGerman
// dictionaries.turkish));
environment.systemPackages = [ environment.systemPackages = [
# pkgs.goldendict # pkgs.goldendict
@@ -302,6 +313,7 @@ in {
(makeStardict "sd-russian" dictionaries.russian) (makeStardict "sd-russian" dictionaries.russian)
(makeStardict "sd" dictionaries.englishGerman) (makeStardict "sd" dictionaries.englishGerman)
(makeStardict "jbo" dictionaries.lojban) (makeStardict "jbo" dictionaries.lojban)
(makeStardict "sd-turkish" dictionaries.turkish)
]; ];
} }
/* /*

View File

@@ -4,8 +4,6 @@
lib, lib,
... ...
}: let }: let
unstable = import <nixos-unstable> {inherit (config.nixpkgs) config;};
toSymbols = pkgs.writers.writeDash "to-symbols" '' toSymbols = pkgs.writers.writeDash "to-symbols" ''
${pkgs.gnused}/bin/sed ' ${pkgs.gnused}/bin/sed '
s/\bTri\b//; s/\bTri\b//;
@@ -46,14 +44,14 @@ in {
niveum.telegramBots.transits = { niveum.telegramBots.transits = {
enable = true; enable = true;
time = "*:0/1"; time = "*:0/1";
token = lib.strings.fileContents <system-secrets/telegram/kmein.token>; tokenFile = config.age.secrets.telegram-token-kmein.path;
chatIds = ["-1001796440545"]; chatIds = ["-1001796440545"];
command = toString (pkgs.writers.writeDash "common-transits" '' command = toString (pkgs.writers.writeDash "common-transits" ''
now=$(${pkgs.coreutils}/bin/date +%_H:%M | ${pkgs.gnused}/bin/sed 's/^\s*//') now=$(${pkgs.coreutils}/bin/date +%_H:%M | ${pkgs.gnused}/bin/sed 's/^\s*//')
date=$(${pkgs.coreutils}/bin/date +'%m %d %Y') date=$(${pkgs.coreutils}/bin/date +'%m %d %Y')
{ {
${unstable.astrolog}/bin/astrolog -qd $date -zN Berlin -Yt -Yd -d -R Uranus Neptune Pluto "North Node" -A 2 ${pkgs.astrolog}/bin/astrolog -qd $date -zN Berlin -Yt -Yd -d -R Uranus Neptune Pluto "North Node" -A 2
${unstable.astrolog}/bin/astrolog -Yt -Yd -q 10 22 1999 6:32 -zN Kassel -td $date -R Uranus Neptune Pluto "North Node" ${pkgs.astrolog}/bin/astrolog -Yt -Yd -q 10 22 1999 6:32 -zN Kassel -td $date -R Uranus Neptune Pluto "North Node"
} | ${toSymbols} | ${pkgs.coreutils}/bin/sort -n | ${pkgs.gnugrep}/bin/grep "^$now" || : } | ${toSymbols} | ${pkgs.coreutils}/bin/sort -n | ${pkgs.gnugrep}/bin/grep "^$now" || :
''); '');
}; };

View File

@@ -1,6 +1,7 @@
{ {
pkgs, pkgs,
lib, lib,
config,
... ...
}: let }: let
autorenkalender-package = pkgs.fetchFromGitHub { autorenkalender-package = pkgs.fetchFromGitHub {
@@ -15,12 +16,14 @@ in {
niveum.telegramBots.autorenkalender = { niveum.telegramBots.autorenkalender = {
enable = true; enable = true;
time = "07:00"; time = "07:00";
token = lib.strings.fileContents <system-secrets/telegram/kmein.token>; tokenFile = config.age.secrets.telegram-token-kmein.path;
chatIds = ["@autorenkalender"]; chatIds = ["@autorenkalender"];
parseMode = "Markdown"; parseMode = "Markdown";
command = "${autorenkalender}/bin/autorenkalender"; command = "${autorenkalender}/bin/autorenkalender";
}; };
age.secrets.telegram-token-kmein.file = ../../secrets/telegram-token-kmein.age;
niveum.passport.services = [ niveum.passport.services = [
{ {
title = "Autorenkalender"; title = "Autorenkalender";

View File

@@ -1,6 +1,7 @@
{ {
pkgs, pkgs,
lib, lib,
config,
... ...
}: let }: let
celan = pkgs.fetchzip { celan = pkgs.fetchzip {
@@ -11,7 +12,7 @@ in {
niveum.telegramBots.celan = { niveum.telegramBots.celan = {
enable = true; enable = true;
time = "08:00"; time = "08:00";
token = lib.strings.fileContents <system-secrets/telegram/kmein.token>; tokenFile = config.age.secrets.telegram-token-kmein.path;
chatIds = ["@PaulCelan"]; chatIds = ["@PaulCelan"];
command = toString (pkgs.writers.writeDash "random-celan" '' command = toString (pkgs.writers.writeDash "random-celan" ''
cd ${celan} cd ${celan}

View File

@@ -2,17 +2,13 @@
config, config,
pkgs, pkgs,
lib, lib,
inputs,
... ...
}: let }: let
nixpkgs-21-11 = import (builtins.fetchTarball "https://github.com/NixOS/nixpkgs/archive/nixos-21.11.tar.gz") { telebots = inputs.telebots.defaultPackage.x86_64-linux;
config.permittedInsecurePackages = [
"python3.9-poetry-1.1.12"
];
};
telebots = nixpkgs-21-11.callPackage <telebots> {};
reverseDirectory = "/run/telegram-reverse"; reverseDirectory = "/run/telegram-reverse";
proverbDirectory = "/run/telegram-proverb"; proverbDirectory = "/run/telegram-proverb";
inherit (import <niveum/lib>) tmpfilesConfig; inherit (import ../../lib) tmpfilesConfig;
in { in {
imports = [ imports = [
./literature-quote.nix ./literature-quote.nix
@@ -23,7 +19,6 @@ in {
./nachtischsatan.nix ./nachtischsatan.nix
./tlg-wotd.nix ./tlg-wotd.nix
./celan.nix ./celan.nix
<niveum/modules/telegram-bot.nix>
]; ];
systemd.tmpfiles.rules = map (path: systemd.tmpfiles.rules = map (path:
@@ -52,33 +47,45 @@ in {
} }
]; ];
age.secrets = {
telegram-token-reverse.file = ../../secrets/telegram-token-reverse.age;
telegram-token-betacode.file = ../../secrets/telegram-token-betacode.age;
telegram-token-proverb.file = ../../secrets/telegram-token-proverb.age;
};
systemd.services.telegram-reverse = { systemd.services.telegram-reverse = {
wantedBy = ["multi-user.target"]; wantedBy = ["multi-user.target"];
description = "Telegram reverse bot"; description = "Telegram reverse bot";
path = [pkgs.ffmpeg]; path = [pkgs.ffmpeg];
environment.TELEGRAM_BOT_TOKEN = lib.strings.fileContents <system-secrets/telegram/reverse.token>;
enable = true; enable = true;
script = "${telebots}/bin/telegram-reverse"; script = ''
TELEGRAM_BOT_TOKEN="$(cat "$CREDENTIALS_DIRECTORY/token")" ${telebots}/bin/telegram-reverse
'';
serviceConfig.Restart = "always"; serviceConfig.Restart = "always";
serviceConfig.WorkingDirectory = reverseDirectory; serviceConfig.WorkingDirectory = reverseDirectory;
serviceConfig.LoadCredential = "token:${config.age.secrets.telegram-token-reverse.path}";
}; };
systemd.services.telegram-betacode = { systemd.services.telegram-betacode = {
wantedBy = ["multi-user.target"]; wantedBy = ["multi-user.target"];
description = "Telegram beta code bot"; description = "Telegram beta code bot";
environment.TELEGRAM_BOT_TOKEN = lib.strings.fileContents <system-secrets/telegram/betacode.token>;
enable = true; enable = true;
script = "${telebots}/bin/telegram-betacode"; script = ''
TELEGRAM_BOT_TOKEN="$(cat "$CREDENTIALS_DIRECTORY/token")" ${telebots}/bin/telegram-betacode
'';
serviceConfig.Restart = "always"; serviceConfig.Restart = "always";
serviceConfig.LoadCredential = "token:${config.age.secrets.telegram-token-betacode.path}";
}; };
systemd.services.telegram-proverb = { systemd.services.telegram-proverb = {
wantedBy = ["multi-user.target"]; wantedBy = ["multi-user.target"];
description = "Telegram proverb bot"; description = "Telegram proverb bot";
environment.TELEGRAM_BOT_TOKEN = lib.strings.fileContents <system-secrets/telegram/proverb.token>;
enable = true; enable = true;
script = "${telebots}/bin/telegram-proverb"; script = ''
TELEGRAM_BOT_TOKEN="$(cat "$CREDENTIALS_DIRECTORY/token")" ${telebots}/bin/telegram-proverb
'';
serviceConfig.Restart = "always"; serviceConfig.Restart = "always";
serviceConfig.WorkingDirectory = proverbDirectory; serviceConfig.WorkingDirectory = proverbDirectory;
serviceConfig.LoadCredential = "token:${config.age.secrets.telegram-token-proverb.path}";
}; };
} }

View File

@@ -1,14 +1,16 @@
{ {
pkgs, pkgs,
config,
inputs,
lib, lib,
... ...
}: let }: let
hesychius = <scripts> + "/hesychius/hesychius.txt"; hesychius = inputs.scripts.outPath + "/hesychius/hesychius.txt";
in { in {
niveum.telegramBots.hesychius = { niveum.telegramBots.hesychius = {
enable = true; enable = true;
time = "08:00"; time = "08:00";
token = lib.strings.fileContents <system-secrets/telegram/kmein.token>; tokenFile = config.age.secrets.telegram-token-kmein.path;
chatIds = ["@HesychiosAlexandreus"]; chatIds = ["@HesychiosAlexandreus"];
command = "${pkgs.coreutils}/bin/shuf -n1 ${hesychius}"; command = "${pkgs.coreutils}/bin/shuf -n1 ${hesychius}";
}; };

View File

@@ -1,17 +1,16 @@
{ {
pkgs, pkgs,
config,
lib, lib,
niveumPackages,
... ...
}: let }: {
scripts = import <niveum/packages/scripts> {inherit pkgs lib;};
inherit (scripts) literature-quote;
in {
niveum.telegramBots.quotebot = { niveum.telegramBots.quotebot = {
enable = true; enable = true;
time = "08/6:00"; time = "08/6:00";
token = lib.strings.fileContents <system-secrets/telegram/kmein.token>; tokenFile = config.age.secrets.telegram-token-kmein.path;
chatIds = ["-1001760262519"]; chatIds = ["-1001760262519"];
command = "${literature-quote}/bin/literature-quote"; command = "${niveumPackages.literature-quote}/bin/literature-quote";
parseMode = "Markdown"; parseMode = "Markdown";
}; };

View File

@@ -1,9 +1,10 @@
{ {
pkgs, pkgs,
config,
lib, lib,
... ...
}: let }: let
nachtischsatan-bot = {token}: nachtischsatan-bot = {tokenFile}:
pkgs.writers.writePython3 "nachtischsatan-bot" { pkgs.writers.writePython3 "nachtischsatan-bot" {
libraries = [pkgs.python3Packages.python-telegram-bot]; libraries = [pkgs.python3Packages.python-telegram-bot];
} '' } ''
@@ -18,11 +19,12 @@
update.message.reply_text("*flubberflubber*") update.message.reply_text("*flubberflubber*")
updater = Updater('${token}') with open('${tokenFile}', 'r') as tokenFile:
updater = Updater(tokenFile.read().strip())
updater.dispatcher.add_handler(MessageHandler(Filters.all, flubber)) updater.dispatcher.add_handler(MessageHandler(Filters.all, flubber))
updater.start_polling() updater.start_polling()
updater.idle() updater.idle()
''; '';
in { in {
systemd.services.telegram-nachtischsatan = { systemd.services.telegram-nachtischsatan = {
@@ -30,11 +32,13 @@ in {
description = "*flubberflubber*"; description = "*flubberflubber*";
enable = true; enable = true;
script = toString (nachtischsatan-bot { script = toString (nachtischsatan-bot {
token = lib.strings.fileContents <system-secrets/telegram/nachtischsatan.token>; tokenFile = config.age.secrets.telegram-token-nachtischsatan.path;
}); });
serviceConfig.Restart = "always"; serviceConfig.Restart = "always";
}; };
age.secrets.telegram-token-nachtischsatan.file = ../../secrets/telegram-token-nachtischsatan.age;
niveum.passport.services = [ niveum.passport.services = [
{ {
title = "Nachtischsatan-Bot"; title = "Nachtischsatan-Bot";

View File

@@ -1,4 +1,5 @@
{ {
config,
pkgs, pkgs,
lib, lib,
... ...
@@ -6,7 +7,7 @@
niveum.telegramBots.smyth = { niveum.telegramBots.smyth = {
enable = true; enable = true;
time = "08:00"; time = "08:00";
token = lib.strings.fileContents <system-secrets/telegram/kmein.token>; tokenFile = config.age.secrets.telegram-token-kmein.path;
chatIds = ["@HerbertWeirSmyth"]; chatIds = ["@HerbertWeirSmyth"];
command = toString (pkgs.writers.writeDash "random-smyth" '' command = toString (pkgs.writers.writeDash "random-smyth" ''
set -efu set -efu

View File

@@ -1,13 +1,14 @@
{ {
pkgs, pkgs,
lib, lib,
config,
... ...
}: { }: {
niveum.telegramBots.tlg-wotd = { niveum.telegramBots.tlg-wotd = {
enable = true; enable = true;
time = "9:30"; time = "9:30";
token = lib.strings.fileContents <system-secrets/telegram/kmein.token>;
chatIds = ["@tlgwotd"]; chatIds = ["@tlgwotd"];
tokenFile = config.age.secrets.telegram-token-kmein.path;
command = toString (pkgs.writers.writeDash "tlg-wotd" '' command = toString (pkgs.writers.writeDash "tlg-wotd" ''
${pkgs.curl}/bin/curl -sSL http://stephanus.tlg.uci.edu/Iris/Wotd \ ${pkgs.curl}/bin/curl -sSL http://stephanus.tlg.uci.edu/Iris/Wotd \
| ${pkgs.recode}/bin/recode html..utf8 \ | ${pkgs.recode}/bin/recode html..utf8 \

View File

@@ -1,4 +1,5 @@
{pkgs, ...}: { {pkgs, ...}: {
services.tor.enable = true; services.tor.enable = true;
environment.systemPackages = [pkgs.tor]; services.tor.client.enable = true;
environment.systemPackages = [pkgs.tor pkgs.torsocks];
} }

View File

@@ -1,13 +1,12 @@
{ {
config,
pkgs, pkgs,
lib, lib,
... ...
}: let }: let
inherit (import <niveum/lib>) localAddresses; inherit (import ../lib) localAddresses;
living-room-id = 131090; living-room-id = 131090;
in { in {
imports = [<niveum/modules/traadfri.nix>];
environment.systemPackages = [ environment.systemPackages = [
(pkgs.writers.writeDashBin "traadfri-party" '' (pkgs.writers.writeDashBin "traadfri-party" ''
while true; do while true; do
@@ -20,11 +19,18 @@ in {
'') '')
]; ];
age.secrets.traadfri-key = {
file = ../secrets/traadfri-key.age;
owner = config.users.users.me.name;
group = config.users.users.me.group;
mode = "400";
};
niveum.traadfri = { niveum.traadfri = {
enable = true; enable = true;
user = "kmein"; user = "kmein";
host = localAddresses.tradfri; host = localAddresses.tradfri;
key = lib.strings.fileContents <secrets/traadfri.key>; keyFile = config.age.secrets.traadfri-key.path;
rooms = { rooms = {
corridor = 131080; corridor = 131080;
kitchen = 131081; kitchen = 131081;

View File

@@ -2,18 +2,27 @@
pkgs, pkgs,
lib, lib,
... ...
}: { }: let
imports = [<stockholm/krebs/3modules/fetchWallpaper.nix>]; url = "http://prism.r/realwallpaper-krebs-stars-berlin.png";
stateDir = "~/.cache/wallpaper";
in {
systemd.user.services.wallpaper = {
wantedBy = ["graphical-session.target"];
after = ["network.target"];
script = ''
set -euf
krebs.fetchWallpaper = { mkdir -p ${stateDir}
enable = true; chmod o+rx ${stateDir}
url = "http://prism.r/realwallpaper-krebs-stars-berlin.png"; cd ${stateDir}
}; (${pkgs.curl}/bin/curl -s -o wallpaper.tmp -z wallpaper.tmp ${lib.escapeShellArg url} && cp wallpaper.tmp wallpaper) || :
${pkgs.feh}/bin/feh --no-fehbg --bg-scale wallpaper
users.users.fetchWallpaper.isSystemUser = true; '';
startAt = "*:00,10,20,30,40,50";
services.xserver = { serviceConfig = {
display = lib.mkForce 0; # needed for fetchWallpaper to find the X display Restart = "always";
displayManager.sessionCommands = "${pkgs.xorg.xhost}/bin/xhost +LOCAL:"; RestartSec = "15s";
StartLimitBurst = 0;
};
}; };
} }

View File

@@ -77,7 +77,11 @@
precmd () { precmd () {
vcs_info vcs_info
RPROMPT="$vcs_info_msg_0_" if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ] || [ -n "$SSH_CONNECTION" ]; then
RPROMPT="$(hostname)"
else
RPROMPT="$vcs_info_msg_0_"
fi
if [[ -n $IN_NIX_SHELL ]]; then if [[ -n $IN_NIX_SHELL ]]; then
PROMPT='%B%~%b %(?.%F{${promptColours.success}}.%F{${promptColours.failure}})λ%f ' PROMPT='%B%~%b %(?.%F{${promptColours.success}}.%F{${promptColours.failure}})λ%f '
else else

643
flake.lock generated
View File

@@ -1,12 +1,194 @@
{ {
"nodes": { "nodes": {
"flake-utils": { "agenix": {
"inputs": {
"darwin": "darwin",
"nixpkgs": [
"nixpkgs"
]
},
"locked": { "locked": {
"lastModified": 1667395993, "lastModified": 1680281360,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", "narHash": "sha256-XdLTgAzjJNDhAG2V+++0bHpSzfvArvr2pW6omiFfEJk=",
"owner": "ryantm",
"repo": "agenix",
"rev": "e64961977f60388dd0b49572bb0fc453b871f896",
"type": "github"
},
"original": {
"owner": "ryantm",
"repo": "agenix",
"type": "github"
}
},
"blessings": {
"flake": false,
"locked": {
"lastModified": 1549397368,
"narHash": "sha256-YVIGRG+/ey4nFEZl1ZPHj7Hx/Of3rsUGnkLK4V4zZd0=",
"ref": "refs/heads/master",
"rev": "d94712a015636efe7ec79bc0a2eec6739d0be779",
"revCount": 18,
"type": "git",
"url": "https://cgit.krebsco.de/blessings"
},
"original": {
"type": "git",
"url": "https://cgit.krebsco.de/blessings"
}
},
"darwin": {
"inputs": {
"nixpkgs": [
"agenix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1673295039,
"narHash": "sha256-AsdYgE8/GPwcelGgrntlijMg4t3hLFJFCRF3tL5WVjA=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "87b9d090ad39b25b2400029c64825fc2a8868943",
"type": "github"
},
"original": {
"owner": "lnl7",
"ref": "master",
"repo": "nix-darwin",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1681202837,
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", "rev": "cfacdce06f30d2b68473a46042957675eebb3401",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"locked": {
"lastModified": 1659877975,
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_3": {
"locked": {
"lastModified": 1676283394,
"narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_4": {
"locked": {
"lastModified": 1659877975,
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_5": {
"locked": {
"lastModified": 1676283394,
"narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_6": {
"locked": {
"lastModified": 1659877975,
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_7": {
"locked": {
"lastModified": 1676283394,
"narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_8": {
"locked": {
"lastModified": 1659877975,
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_9": {
"locked": {
"lastModified": 1676283394,
"narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -18,56 +200,71 @@
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"nixos-unstable" "nixpkgs"
], ],
"utils": "utils" "utils": "utils"
}, },
"locked": { "locked": {
"lastModified": 1675371293, "lastModified": 1681092193,
"narHash": "sha256-LrCjtrAXj/WJphhGEMnHgZs7oTsfOlvPfOjFTIvg39k=", "narHash": "sha256-JerCqqOqbT2tBnXQW4EqwFl0hHnuZp21rIQ6lu/N4rI=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "d1c7730bb707bf8124d997952f7babd2a281ae68", "rev": "f9edbedaf015013eb35f8caacbe0c9666bbc16af",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "nix-community",
"ref": "master", "ref": "release-22.11",
"repo": "home-manager", "repo": "home-manager",
"type": "github" "type": "github"
} }
}, },
"krops": { "menstruation-backend": {
"inputs": { "inputs": {
"flake-utils": [ "flake-utils": [
"flake-utils" "flake-utils"
], ],
"nixpkgs": [ "nixpkgs": [
"nixos-stable" "nixpkgs"
] ],
"rust-overlay": "rust-overlay"
}, },
"locked": { "locked": {
"lastModified": 1661273257, "lastModified": 1677075142,
"narHash": "sha256-cywpSH3D291AwdO/ecJxHeN2Vuuz0cIy/NEXMsFT+Og=", "narHash": "sha256-0RXVZcK2YtPckd/3+jb+yLpeXZ6jnQe25w9idztDXi8=",
"owner": "kmein", "owner": "kmein",
"repo": "krops", "repo": "menstruation.rs",
"rev": "542bc544ec8b0b807933a812d098e601683b0956", "rev": "e34af4393963cdbadb456b7b9ae2e95e6db7b8a3",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "kmein", "owner": "kmein",
"repo": "krops", "repo": "menstruation.rs",
"type": "github" "type": "github"
} }
}, },
"menstruation-backend": { "menstruation-backend_2": {
"flake": false, "inputs": {
"flake-utils": [
"menstruation-telegram",
"menstruation-backend",
"rust-overlay",
"flake-utils"
],
"nixpkgs": [
"menstruation-telegram",
"menstruation-backend",
"rust-overlay",
"nixpkgs"
],
"rust-overlay": "rust-overlay_2"
},
"locked": { "locked": {
"lastModified": 1667816906, "lastModified": 1677075142,
"narHash": "sha256-VdckYVSQZfqThPb06Y5TGSI+kkibgM/G9pH5SQHIybI=", "narHash": "sha256-0RXVZcK2YtPckd/3+jb+yLpeXZ6jnQe25w9idztDXi8=",
"owner": "kmein", "owner": "kmein",
"repo": "menstruation.rs", "repo": "menstruation.rs",
"rev": "95c495d453c35f20a6a5641a88a862c668404acf", "rev": "e34af4393963cdbadb456b7b9ae2e95e6db7b8a3",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -77,13 +274,17 @@
} }
}, },
"menstruation-telegram": { "menstruation-telegram": {
"flake": false, "inputs": {
"flake-utils": "flake-utils_3",
"menstruation-backend": "menstruation-backend_2",
"nixpkgs": "nixpkgs_3"
},
"locked": { "locked": {
"lastModified": 1667816918, "lastModified": 1677075205,
"narHash": "sha256-yQSl0iKqHm7qFLELY8e7OzRRdnqSBbzJmQIYgkXlJpQ=", "narHash": "sha256-2+xuAhsS3y2qB0ObVPCHXrmnTsIZ8uI5HFI4+Ash8PY=",
"owner": "kmein", "owner": "kmein",
"repo": "menstruation-telegram", "repo": "menstruation-telegram",
"rev": "828872cf9c425442705a95019eceee397bc1c03f", "rev": "f7ddb6d9610aacb50ec66a3ce1bdc49fe4664a49",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -92,29 +293,81 @@
"type": "github" "type": "github"
} }
}, },
"nix-writers": { "nixinate": {
"flake": false, "inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": { "locked": {
"lastModified": 1675197881, "lastModified": 1671116920,
"narHash": "sha256-gYtduNF59yqv4BgW4fC+tZHKE7cpOkZf+Y34psyFO5U=", "narHash": "sha256-QmDGsUUmAGn77UTR7eQJmebl8f3IIUCtmbbAdJqKA3s=",
"ref": "refs/heads/master", "owner": "matthewcroughan",
"rev": "d1424777b5f2e12cbd80efd1b55335dcba7c32bd", "repo": "nixinate",
"revCount": 38, "rev": "b4d17b8e2a4abc47e93e1a1c466e0286a63640d8",
"type": "git", "type": "github"
"url": "https://cgit.krebsco.de/nix-writers"
}, },
"original": { "original": {
"type": "git", "owner": "matthewcroughan",
"url": "https://cgit.krebsco.de/nix-writers" "repo": "nixinate",
"type": "github"
} }
}, },
"nixos-stable": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1675237434, "lastModified": 1665296151,
"narHash": "sha256-YoFR0vyEa1HXufLNIFgOGhIFMRnY6aZ0IepZF5cYemo=", "narHash": "sha256-uOB0oxqxN9K7XGF1hcnY+PQnlQJ+3bP2vCn/+Ru/bbc=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "285b3ff0660640575186a4086e1f8dc0df2874b5", "rev": "14ccaaedd95a488dd7ae142757884d8e125b3363",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1665296151,
"narHash": "sha256-uOB0oxqxN9K7XGF1hcnY+PQnlQJ+3bP2vCn/+Ru/bbc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "14ccaaedd95a488dd7ae142757884d8e125b3363",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1669418739,
"narHash": "sha256-T86oFvcUIRwHWBWUt7WjaP4BP/3lDGbv5AppQSI1FkI=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "695b3515251873e0a7e2021add4bba643c56cde3",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "695b3515251873e0a7e2021add4bba643c56cde3",
"type": "github"
}
},
"nixpkgs_4": {
"locked": {
"lastModified": 1681269223,
"narHash": "sha256-i6OeI2f7qGvmLfD07l1Az5iBL+bFeP0RHixisWtpUGo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "87edbd74246ccdfa64503f334ed86fa04010bab9",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -124,30 +377,112 @@
"type": "github" "type": "github"
} }
}, },
"nixos-unstable": { "nixpkgs_5": {
"locked": { "locked": {
"lastModified": 1675273418, "lastModified": 1677158633,
"narHash": "sha256-tpYc4TEGvDzh9uRf44QemyQ4TpVuUbxb07b2P99XDbM=", "narHash": "sha256-t7za78oRkDIjdFQF0PCilfCziFyhfowCgs9Ry+sEvE4=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "4d7c2644dbac9cf8282c0afe68fca8f0f3e7b2db", "rev": "129b6f78121802d18d215c9f9e04d7971c58ea0c",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
}, },
"recht": { "nixpkgs_6": {
"flake": false,
"locked": { "locked": {
"lastModified": 1669719044, "lastModified": 1665296151,
"narHash": "sha256-WsLWlTM2Hrurj9kVajybIOavV9QPYiJweMCOQR6h+YI=", "narHash": "sha256-uOB0oxqxN9K7XGF1hcnY+PQnlQJ+3bP2vCn/+Ru/bbc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "14ccaaedd95a488dd7ae142757884d8e125b3363",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_7": {
"locked": {
"lastModified": 1659446231,
"narHash": "sha256-hekabNdTdgR/iLsgce5TGWmfIDZ86qjPhxDg/8TlzhE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "eabc38219184cc3e04a974fe31857d8e0eac098d",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-21.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_8": {
"locked": {
"lastModified": 1665296151,
"narHash": "sha256-uOB0oxqxN9K7XGF1hcnY+PQnlQJ+3bP2vCn/+Ru/bbc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "14ccaaedd95a488dd7ae142757884d8e125b3363",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_9": {
"locked": {
"lastModified": 1669418739,
"narHash": "sha256-T86oFvcUIRwHWBWUt7WjaP4BP/3lDGbv5AppQSI1FkI=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "695b3515251873e0a7e2021add4bba643c56cde3",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "695b3515251873e0a7e2021add4bba643c56cde3",
"type": "github"
}
},
"nur": {
"locked": {
"lastModified": 1681454031,
"narHash": "sha256-JOamj7vKkFRp5mJ7FKt5dPfCmWj33sZLnBGDt15c/sc=",
"owner": "nix-community",
"repo": "NUR",
"rev": "8a35714f0be00235e2a1c8b759e6dc3888763d8b",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "NUR",
"type": "github"
}
},
"recht": {
"inputs": {
"blessings": "blessings",
"flake-utils": "flake-utils_5",
"nixpkgs": "nixpkgs_5"
},
"locked": {
"lastModified": 1677165419,
"narHash": "sha256-pjYpXg+09rayon6uhSNd30ryrT2zYLOlDLBHQ9pnGZg=",
"owner": "kmein", "owner": "kmein",
"repo": "recht", "repo": "recht",
"rev": "7c15b13328fb5cee01012c488ff235ee730cac70", "rev": "5fa158ce21de797bd95a934dab8d4403b7531d20",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -158,11 +493,11 @@
}, },
"retiolum": { "retiolum": {
"locked": { "locked": {
"lastModified": 1675364416, "lastModified": 1681246809,
"narHash": "sha256-u7kbHg/cp+GdW55B6V52GG0D9+zWOhmVI2nh/NiMxfw=", "narHash": "sha256-3RUAwk0ApPjq2Ms8KiAh+gG6EJKWurIur612w2m3Zu8=",
"ref": "refs/heads/master", "ref": "refs/heads/master",
"rev": "ae5112af96361acc314e1d270d0c9281984fc517", "rev": "c8ddb36f3d85be762aeb1893a79da36014f55658",
"revCount": 280, "revCount": 296,
"type": "git", "type": "git",
"url": "https://git.thalheim.io/Mic92/retiolum" "url": "https://git.thalheim.io/Mic92/retiolum"
}, },
@@ -173,32 +508,119 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"agenix": "agenix",
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"home-manager": "home-manager", "home-manager": "home-manager",
"krops": "krops",
"menstruation-backend": "menstruation-backend", "menstruation-backend": "menstruation-backend",
"menstruation-telegram": "menstruation-telegram", "menstruation-telegram": "menstruation-telegram",
"nix-writers": "nix-writers", "nixinate": "nixinate",
"nixos-stable": "nixos-stable", "nixpkgs": "nixpkgs_4",
"nixos-unstable": "nixos-unstable", "nur": "nur",
"recht": "recht", "recht": "recht",
"retiolum": "retiolum", "retiolum": "retiolum",
"scripts": "scripts", "scripts": "scripts",
"stockholm": "stockholm",
"telebots": "telebots", "telebots": "telebots",
"tinc-graph": "tinc-graph", "tinc-graph": "tinc-graph",
"traadfri": "traadfri", "traadfri": "traadfri",
"tuna": "tuna" "voidrice": "voidrice"
}
},
"rust-overlay": {
"inputs": {
"flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1677033035,
"narHash": "sha256-w6XsKaW46kZNEk2vVfuoNIBEq/YzDy9kNk8cU0xJZEQ=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "6c9e8ea3ba73a9fed29ddc1cc52ade8e5c946a8d",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"rust-overlay_2": {
"inputs": {
"flake-utils": "flake-utils_4",
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1677033035,
"narHash": "sha256-w6XsKaW46kZNEk2vVfuoNIBEq/YzDy9kNk8cU0xJZEQ=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "6c9e8ea3ba73a9fed29ddc1cc52ade8e5c946a8d",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"rust-overlay_3": {
"inputs": {
"flake-utils": "flake-utils_6",
"nixpkgs": "nixpkgs_6"
},
"locked": {
"lastModified": 1677119371,
"narHash": "sha256-L0Da4eKzDZrsy8ysOS1lhgDjAgEqGvYGf/lXaRd5/YQ=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "c67c79ea25664d66e74ae91a6fa0d6c65d12d3a7",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"rust-overlay_4": {
"inputs": {
"flake-utils": "flake-utils_8",
"nixpkgs": "nixpkgs_8"
},
"locked": {
"lastModified": 1677119371,
"narHash": "sha256-L0Da4eKzDZrsy8ysOS1lhgDjAgEqGvYGf/lXaRd5/YQ=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "c67c79ea25664d66e74ae91a6fa0d6c65d12d3a7",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
} }
}, },
"scripts": { "scripts": {
"flake": false, "inputs": {
"flake-utils": [
"scripts",
"rust-overlay",
"flake-utils"
],
"nixpkgs": [
"scripts",
"rust-overlay",
"nixpkgs"
],
"rust-overlay": "rust-overlay_3"
},
"locked": { "locked": {
"lastModified": 1675238486, "lastModified": 1677271864,
"narHash": "sha256-Hs9NKK0UFaNqrui2VauBnMnV/14U3eNWaI12EmVYXWY=", "narHash": "sha256-BghYMB/lauerExMsDtGZNGZGdoGuF7LPtbmpyh9ycyA=",
"owner": "kmein", "owner": "kmein",
"repo": "scripts", "repo": "scripts",
"rev": "5cefa5f112e7fe54e0302b7bc33bc06e1f762002", "rev": "79bffac7f9eda1b3be76f2a4ff18d81b44c74390",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -207,30 +629,32 @@
"type": "github" "type": "github"
} }
}, },
"stockholm": { "systems": {
"flake": false,
"locked": { "locked": {
"lastModified": 1675564669, "lastModified": 1681028828,
"narHash": "sha256-Fd4wBl9b5Aqt4ctH2vJu/oPvgTOHD+ME8MUEu3oR2tE=", "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"ref": "refs/heads/master", "owner": "nix-systems",
"rev": "e44fe862f0bedc658aabd1daafb16376f188857e", "repo": "default",
"revCount": 11353, "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "git", "type": "github"
"url": "https://cgit.krebsco.de/stockholm"
}, },
"original": { "original": {
"type": "git", "owner": "nix-systems",
"url": "https://cgit.krebsco.de/stockholm" "repo": "default",
"type": "github"
} }
}, },
"telebots": { "telebots": {
"flake": false, "inputs": {
"flake-utils": "flake-utils_7",
"nixpkgs": "nixpkgs_7"
},
"locked": { "locked": {
"lastModified": 1623510321, "lastModified": 1677156381,
"narHash": "sha256-MxYNNL81RXZkYLd4IgiNTSo1X80kTuDzsdGNSA0f1y8=", "narHash": "sha256-OMhqYJO2bWtL6osTMpQhA4ySUl4gvJTI13m1agipHJ0=",
"owner": "kmein", "owner": "kmein",
"repo": "telebots", "repo": "telebots",
"rev": "22931c9457e092c4e413555dbe61819d77844246", "rev": "5527e359e8394f2f66067de7f61587eb65055209",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -240,13 +664,21 @@
} }
}, },
"tinc-graph": { "tinc-graph": {
"flake": false, "inputs": {
"flake-utils": [
"flake-utils"
],
"nixpkgs": [
"nixpkgs"
],
"rust-overlay": "rust-overlay_4"
},
"locked": { "locked": {
"lastModified": 1666162569, "lastModified": 1677160040,
"narHash": "sha256-7ebWs/ryDebUMONkn6dPckNnUGrEuPQScoY+O/+vo+Q=", "narHash": "sha256-UhyZaIZ88vN/7fiBcamfV77eHjQnL8zSVznaqxLgbhs=",
"owner": "kmein", "owner": "kmein",
"repo": "tinc-graph", "repo": "tinc-graph",
"rev": "72a4b305fcb49cfd6d456103cda45888a6b34bbe", "rev": "f705ca35e30ab0daf9cf52000e58931d7c5c42b5",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -256,13 +688,16 @@
} }
}, },
"traadfri": { "traadfri": {
"flake": false, "inputs": {
"flake-utils": "flake-utils_9",
"nixpkgs": "nixpkgs_9"
},
"locked": { "locked": {
"lastModified": 1640451803, "lastModified": 1677165914,
"narHash": "sha256-zS/b93uFpPM9basNP7ngmm+YjYV0IUQAmNghetHA6Ss=", "narHash": "sha256-3N08NabgDwTUy1n5wxpT27iddFrgXW35E1x2UgAKkDQ=",
"owner": "kmein", "owner": "kmein",
"repo": "traadfri", "repo": "traadfri",
"rev": "cf46bd09cd3263b90a09b0ca979aa705a4c3671c", "rev": "11571116ed5d2c6478c615d663d1f96f57a97ba9",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -271,22 +706,6 @@
"type": "github" "type": "github"
} }
}, },
"tuna": {
"flake": false,
"locked": {
"lastModified": 1627117248,
"narHash": "sha256-OfqbWLblJY4BJlrCpn8EkHoP3baNJSDTbw45SPaX+0Q=",
"owner": "kmein",
"repo": "tuna",
"rev": "1cbed44069a3009738afdafecefe0a05316039a6",
"type": "github"
},
"original": {
"owner": "kmein",
"repo": "tuna",
"type": "github"
}
},
"utils": { "utils": {
"locked": { "locked": {
"lastModified": 1667395993, "lastModified": 1667395993,
@@ -301,6 +720,22 @@
"repo": "flake-utils", "repo": "flake-utils",
"type": "github" "type": "github"
} }
},
"voidrice": {
"flake": false,
"locked": {
"lastModified": 1681301489,
"narHash": "sha256-5Zz33Q3E4A9nsEmxPQikYeX7Rvu3hM+PlXx/0SIqG34=",
"owner": "Lukesmithxyz",
"repo": "voidrice",
"rev": "d4ff2ebaf3e88efe20cae0d1e592fddfc433c96e",
"type": "github"
},
"original": {
"owner": "Lukesmithxyz",
"repo": "voidrice",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

475
flake.nix
View File

@@ -2,193 +2,312 @@
description = "niveum: packages, modules, systems"; description = "niveum: packages, modules, systems";
inputs = { inputs = {
nixos-stable.url = "github:NixOS/nixpkgs/nixos-22.11"; agenix.url = "github:ryantm/agenix";
nixos-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils"; flake-utils.url = "github:numtide/flake-utils";
home-manager = { home-manager.url = "github:nix-community/home-manager/release-22.11";
url = "github:nix-community/home-manager/master"; menstruation-backend.url = "github:kmein/menstruation.rs";
inputs.nixpkgs.follows = "nixos-unstable"; menstruation-telegram.url = "github:kmein/menstruation-telegram";
}; nixinate.url = "github:matthewcroughan/nixinate";
krops = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.11";
url = "github:kmein/krops"; nur.url = "github:nix-community/NUR";
inputs.nixpkgs.follows = "nixos-stable"; recht.url = "github:kmein/recht";
inputs.flake-utils.follows = "flake-utils"; scripts.url = "github:kmein/scripts";
};
retiolum.url = "git+https://git.thalheim.io/Mic92/retiolum"; retiolum.url = "git+https://git.thalheim.io/Mic92/retiolum";
telebots.url = "github:kmein/telebots";
tinc-graph.url = "github:kmein/tinc-graph";
traadfri.url = "github:kmein/traadfri";
voidrice.url = "github:Lukesmithxyz/voidrice";
# legacy agenix.inputs.nixpkgs.follows = "nixpkgs";
menstruation-backend = { home-manager.inputs.nixpkgs.follows = "nixpkgs";
url = "github:kmein/menstruation.rs"; menstruation-backend.inputs.flake-utils.follows = "flake-utils";
flake = false; menstruation-backend.inputs.nixpkgs.follows = "nixpkgs";
}; nixinate.inputs.nixpkgs.follows = "nixpkgs";
menstruation-telegram = { tinc-graph.inputs.flake-utils.follows = "flake-utils";
url = "github:kmein/menstruation-telegram"; tinc-graph.inputs.nixpkgs.follows = "nixpkgs";
flake = false; voidrice.flake = false;
};
nix-writers = {
url = "git+https://cgit.krebsco.de/nix-writers";
flake = false;
};
recht = {
url = "github:kmein/recht";
flake = false;
};
scripts = {
url = "github:kmein/scripts";
flake = false;
};
stockholm = {
url = "git+https://cgit.krebsco.de/stockholm";
flake = false;
};
telebots = {
url = "github:kmein/telebots";
flake = false;
};
tinc-graph = {
url = "github:kmein/tinc-graph";
flake = false;
};
traadfri = {
url = "github:kmein/traadfri";
flake = false;
};
tuna = {
url = "github:kmein/tuna";
flake = false;
};
}; };
outputs = { outputs = inputs @ {
self, self,
flake-utils, nixpkgs,
nur,
home-manager, home-manager,
krops, nixinate,
menstruation-backend, agenix,
menstruation-telegram,
nix-writers,
nixos-unstable,
nixos-stable,
recht,
retiolum, retiolum,
scripts, flake-utils,
stockholm, ...
telebots, }:
tinc-graph, {
traadfri, apps = nixinate.nixinate.x86_64-linux self;
tuna,
} @ inputs: let nixosModules = {
system = "x86_64-linux"; htgen = import modules/htgen.nix;
pkgs = nixos-stable.legacyPackages.${system}; moodle-dl = import modules/moodle-dl.nix;
home = networkmanager-declarative = import modules/networkmanager-declarative.nix;
if nixos-stable.lib.inPureEvalMode or false passport = import modules/passport.nix;
then _: /nonexistent panoptikon = import modules/panoptikon.nix;
else import lib/home.nix; power-action = import modules/power-action.nix;
source = { system-dependent = import modules/system-dependent.nix;
sources, telegram-bot = import modules/telegram-bot.nix;
unstable, traadfri = import modules/traadfri.nix;
name, };
}:
{ lib = {
niveum.file = toString ./.; panoptikon = import lib/panoptikon.nix;
nixos-config.symlink = "niveum/systems/${name}/configuration.nix"; };
system-secrets.pass = {
dir = toString (home /.password-store); nixosConfigurations = {
name = "systems/${name}"; ful = nixpkgs.lib.nixosSystem rec {
}; system = "aarch64-linux";
secrets.pass = { specialArgs = {
dir = toString (home /.password-store); niveumPackages = inputs.self.packages.${system};
name = "shared"; niveumLib = inputs.self.lib;
}; inherit inputs;
nixpkgs.git = {
url = "https://github.com/NixOS/nixpkgs";
ref =
(
if unstable
then inputs.nixos-unstable
else inputs.nixos-stable
)
.rev;
shallow = true;
};
}
// nixos-stable.lib.mapAttrs' (name: value: {
inherit name;
value.git = {
url = let
github = x: "https://github.com/${x}";
in
{
home-manager = github "nix-community/home-manager";
menstruation-backend = github "kmein/menstruation.rs";
menstruation-telegram = github "kmein/menstruation-telegram";
nixos-unstable = github "NixOS/nixpkgs";
nix-writers = "https://cgit.krebsco.de/nix-writers";
recht = github "kmein/recht";
retiolum = "https://git.thalheim.io/Mic92/retiolum";
stockholm = "https://cgit.krebsco.de/stockholm";
scripts = github "kmein/scripts";
telebots = github "kmein/telebots";
tinc-graph = github "kmein/tinc-graph";
traadfri = github "kmein/traadfri";
}
.${name};
ref = value.rev;
shallow = true;
};
}) (nixos-stable.lib.filterAttrs (name: _: builtins.elem name sources) inputs);
deployScriptFor = {
name,
user ? "root",
host,
unstable ? false,
sshPort ? (import ./lib/default.nix).sshPort,
sources,
}:
toString (krops.packages.${system}.writeDeploy "deploy-${name}" {
source = krops.lib.evalSource [(source {inherit sources unstable name;})];
target = "${user}@${host}:${toString sshPort}";
useNixOutputMonitor = true;
});
in {
apps.${system} = let
forSystems = f: builtins.listToAttrs (map f (builtins.attrNames (builtins.readDir ./systems)));
externalNetwork = import ./lib/external-network.nix;
deployScripts = forSystems (name: {
name = "deploy-${name}";
value = {
type = "app";
program = deployScriptFor {
inherit name;
host =
if externalNetwork ? name
then externalNetwork.${name}
else "${name}.r";
unstable = false; # name == "kabsa" || name == "manakish";
sources =
["nix-writers" "nixpkgs" "retiolum" "stockholm"]
++ {
zaatar = ["traadfri" "nixos-unstable"];
ful = [];
tahina = [];
tabula = [];
kabsa = ["traadfri" "nixos-unstable" "home-manager" "menstruation-backend" "recht"];
manakish = ["traadfri" "nixos-unstable" "home-manager" "menstruation-backend" "recht"];
makanek = ["nixos-unstable" "menstruation-telegram" "menstruation-backend" "scripts" "telebots" "tinc-graph"];
}
.${name};
}; };
modules = [
{
_module.args.nixinate = {
host = "ful";
sshUser = "root";
buildOn = "remote";
substituteOnTarget = true;
hermetic = false;
};
}
systems/ful/configuration.nix
agenix.nixosModules.default
inputs.self.nixosModules.passport
inputs.self.nixosModules.panoptikon
retiolum.nixosModules.retiolum
nur.nixosModules.nur
];
}; };
}); zaatar = nixpkgs.lib.nixosSystem rec {
ciScripts = forSystems (name: { system = "x86_64-linux";
name = "build-${name}"; specialArgs = {
value = { niveumPackages = inputs.self.packages.${system};
type = "app"; inherit inputs;
program = import ./ci.nix {inherit name system inputs;}; };
modules = [
{
_module.args.nixinate = {
host = "zaatar";
sshUser = "root";
buildOn = "remote";
substituteOnTarget = true;
hermetic = false;
};
}
systems/zaatar/configuration.nix
inputs.self.nixosModules.moodle-dl
agenix.nixosModules.default
retiolum.nixosModules.retiolum
];
}; };
}); makanek = nixpkgs.lib.nixosSystem rec {
in system = "x86_64-linux";
deployScripts // ciScripts; # for using inputs in other config files
}; specialArgs = {
niveumPackages = inputs.self.packages.${system};
inherit inputs;
};
modules = [
{
_module.args.nixinate = {
host = "makanek";
sshUser = "root";
buildOn = "remote";
substituteOnTarget = true;
hermetic = false;
};
}
systems/makanek/configuration.nix
inputs.self.nixosModules.telegram-bot
inputs.self.nixosModules.htgen
inputs.self.nixosModules.passport
agenix.nixosModules.default
retiolum.nixosModules.retiolum
nur.nixosModules.nur
];
};
tahina = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
systems/tahina/configuration.nix
agenix.nixosModules.default
retiolum.nixosModules.retiolum
];
};
tabula = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
systems/tabula/configuration.nix
agenix.nixosModules.default
retiolum.nixosModules.retiolum
];
};
manakish = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
specialArgs = {
niveumPackages = inputs.self.packages.${system};
inherit inputs;
};
modules = [
{
_module.args.nixinate = {
host = "manakish";
sshUser = "root";
buildOn = "remote";
substituteOnTarget = true;
hermetic = false;
};
}
systems/manakish/configuration.nix
agenix.nixosModules.default
retiolum.nixosModules.retiolum
home-manager.nixosModules.home-manager
nur.nixosModules.nur
];
};
kabsa = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
specialArgs = {
niveumPackages = inputs.self.packages.${system};
inherit inputs;
};
modules = [
{
_module.args.nixinate = {
host = "kabsa";
sshUser = "root";
buildOn = "remote";
substituteOnTarget = true;
hermetic = false;
};
}
systems/kabsa/configuration.nix
agenix.nixosModules.default
retiolum.nixosModules.retiolum
home-manager.nixosModules.home-manager
nur.nixosModules.nur
];
};
};
}
// flake-utils.lib.eachSystem [flake-utils.lib.system.x86_64-linux flake-utils.lib.system.aarch64-linux] (system: let
pkgs = import nixpkgs {
inherit system;
overlays = [
nur.overlay
(self: super: {
mpv = super.mpv.override {scripts = [inputs.self.packages.${system}.mpv-visualizer];};
dmenu = super.writers.writeDashBin "dmenu" ''exec ${pkgs.rofi}/bin/rofi -dmenu "$@"'';
})
];
};
wrapScript = {
packages ? [],
name,
script,
}:
pkgs.writers.writeDashBin name ''PATH=$PATH:${nixpkgs.lib.makeBinPath (packages ++ [pkgs.findutils pkgs.coreutils pkgs.gnused pkgs.gnugrep])} ${script} "$@"'';
in {
packages = rec {
auc = pkgs.callPackage packages/auc.nix {};
betacode = pkgs.callPackage packages/betacode.nix {};
cheat-sh = pkgs.callPackage packages/cheat-sh.nix {};
closest = pkgs.callPackage packages/closest {};
cyberlocker-tools = pkgs.callPackage packages/cyberlocker-tools.nix {};
default-gateway = pkgs.callPackage packages/default-gateway.nix {};
depp = pkgs.callPackage packages/depp.nix {};
devanagari = pkgs.callPackage packages/devanagari {};
devour = pkgs.callPackage packages/devour.nix {};
dic = pkgs.callPackage packages/dic.nix {};
dirmir = pkgs.callPackage packages/dirmir.nix {};
dmenu-bluetooth = pkgs.callPackage packages/dmenu-bluetooth.nix {};
dmenu-scrot = pkgs.callPackage packages/dmenu-scrot.nix {};
dns-sledgehammer = pkgs.callPackage packages/dns-sledgehammer.nix {};
fkill = pkgs.callPackage packages/fkill.nix {};
fzfmenu = pkgs.callPackage packages/fzfmenu.nix {};
genius = pkgs.callPackage packages/genius.nix {};
gfs-fonts = pkgs.callPackage packages/gfs-fonts.nix {};
git-preview = pkgs.callPackage packages/git-preview.nix {};
hc = pkgs.callPackage packages/hc.nix {};
heuretes = pkgs.callPackage packages/heuretes.nix {};
htgen = pkgs.callPackage packages/htgen.nix {};
image-convert-favicon = pkgs.callPackage packages/image-convert-favicon.nix {};
image-convert-tolino = pkgs.callPackage packages/image-convert-tolino.nix {};
infschmv = pkgs.callPackage packages/infschmv.nix {};
iolanguage = pkgs.callPackage packages/iolanguage.nix {};
ipa = pkgs.writers.writePython3Bin "ipa" {flakeIgnore = ["E501"];} (builtins.readFile packages/ipa.py);
ix = pkgs.callPackage packages/ix.nix {};
jsesh = pkgs.callPackage packages/jsesh.nix {};
k-lock = pkgs.callPackage packages/k-lock.nix {};
kirciuoklis = pkgs.callPackage packages/kirciuoklis.nix {};
klem = pkgs.callPackage packages/klem.nix {};
kpaste = pkgs.callPackage packages/kpaste.nix {};
literature-quote = pkgs.callPackage packages/literature-quote.nix {};
mahlzeit = pkgs.haskellPackages.callPackage packages/mahlzeit.nix {};
man-pandoc = pkgs.callPackage packages/man/pandoc.nix {};
man-pdf = pkgs.callPackage packages/man-pdf.nix {};
mansplain = pkgs.callPackage packages/mansplain.nix {};
manual-sort = pkgs.callPackage packages/manual-sort.nix {};
menu-calc = pkgs.callPackage packages/menu-calc.nix {};
meteo = pkgs.callPackage packages/meteo.nix {};
mpv-radio = pkgs.callPackage packages/mpv-radio.nix {di-fm-key-file = "/dev/null";};
mpv-tv = pkgs.callPackage packages/mpv-tv.nix {};
mpv-visualizer = pkgs.callPackage packages/mpv-visualizer.nix {};
new-mac = pkgs.callPackage packages/new-mac.nix {};
nix-git = pkgs.callPackage packages/nix-git.nix {};
nix-index-update = pkgs.callPackage packages/nix-index-update.nix {inherit system;};
opustags = pkgs.callPackage packages/opustags.nix {};
pls = pkgs.callPackage packages/pls.nix {};
qrpaste = pkgs.callPackage packages/qrpaste.nix {};
rfc = pkgs.callPackage packages/rfc.nix {};
scanned = pkgs.callPackage packages/scanned.nix {};
swallow = pkgs.callPackage packages/swallow.nix {};
text2pdf = pkgs.callPackage packages/text2pdf.nix {};
timer = pkgs.callPackage packages/timer.nix {};
tocharian-font = pkgs.callPackage packages/tocharian-font.nix {};
trans = pkgs.callPackage packages/trans.nix {};
ttspaste = pkgs.callPackage packages/ttspaste.nix {};
unicodmenu = pkgs.callPackage packages/unicodmenu.nix {};
untilport = pkgs.callPackage packages/untilport.nix {};
vg = pkgs.callPackage packages/vg.nix {};
vimPlugins-cheat-sh-vim = pkgs.callPackage packages/vimPlugins/cheat-sh.nix {};
vimPlugins-icalendar-vim = pkgs.callPackage packages/vimPlugins/icalendar-vim.nix {};
vimPlugins-jq-vim = pkgs.callPackage packages/vimPlugins/jq-vim.nix {};
vimPlugins-vim-256noir = pkgs.callPackage packages/vimPlugins/vim-256noir.nix {};
vimPlugins-vim-colors-paramount = pkgs.callPackage packages/vimPlugins/vim-colors-paramount.nix {};
vimPlugins-vim-fetch = pkgs.callPackage packages/vimPlugins/vim-fetch.nix {};
vimPlugins-vim-fsharp = pkgs.callPackage packages/vimPlugins/vim-fsharp.nix {};
vimPlugins-vim-mail = pkgs.callPackage packages/vimPlugins/vim-mail.nix {};
vimPlugins-vim-reason-plus = pkgs.callPackage packages/vimPlugins/vim-reason-plus.nix {};
vimv = pkgs.callPackage packages/vimv.nix {};
weechat-declarative = pkgs.callPackage packages/weechat-declarative.nix {};
weechatScripts-hotlist2extern = pkgs.callPackage packages/weechatScripts/hotlist2extern.nix {};
wttr = pkgs.callPackage packages/wttr.nix {};
itl = pkgs.callPackage packages/itl.nix {};
itools = pkgs.callPackage packages/itools.nix {itl = itl;};
booksplit = wrapScript {
script = inputs.voidrice.outPath + "/.local/bin/booksplit";
name = "booksplit";
packages = [pkgs.ffmpeg pkgs.glibc.bin];
};
dmenu-randr = wrapScript {
script = inputs.voidrice.outPath + "/.local/bin/displayselect";
name = "dmenu-randr";
packages = [pkgs.dmenu pkgs.bc pkgs.psmisc pkgs.util-linux pkgs.xorg.xrandr pkgs.gawk pkgs.libnotify pkgs.arandr (pkgs.writers.writeDashBin "setbg" "")];
};
tag = wrapScript {
script = inputs.voidrice.outPath + "/.local/bin/tag";
name = "tag";
packages = [pkgs.ffmpeg];
};
};
});
} }

View File

@@ -40,7 +40,7 @@ rec {
sshPort = 22022; sshPort = 22022;
colours = import ./colours/papercolor-dark.nix; colours = import ./colours/owickstrom-dark.nix;
theme = pkgs: { theme = pkgs: {
gtk = { gtk = {
@@ -72,7 +72,7 @@ rec {
sshKeys = pkgs: sshKeys = pkgs:
pkgs.lib.strings.splitString "\n" (pkgs.lib.strings.fileContents (pkgs.fetchurl { pkgs.lib.strings.splitString "\n" (pkgs.lib.strings.fileContents (pkgs.fetchurl {
url = "https://github.com/kmein.keys"; url = "https://github.com/kmein.keys";
sha256 = "09c6ny0rmpid1m0pc1wsmb3wyy9g721lf4kv55i4lrp42b3i2d5b"; hash = "sha256-TvvPwplrH9cw7NE4GKqbE5ga+oBHM+TkjxYQ3b1fpLI=";
})); }));
}; };

View File

@@ -1,96 +1,7 @@
{ {lib, ...}: {
lib,
mainMailbox ? "posteo",
...
}: {
uni = {
user = "meinhark";
password = lib.strings.fileContents <secrets/eduroam/password>;
address = "kieran.felix.meinhardt@hu-berlin.de";
imap = "mailbox.cms.hu-berlin.de";
smtp = "mailhost.cms.hu-berlin.de";
smtpSettings = smtp: "smtp://${smtp}";
folders = {
drafts = "Drafts";
sent = "Sent";
trash = "Trash";
};
};
uni-old = {
user = "meinhark";
password = lib.strings.fileContents <secrets/eduroam/password>;
address = "meinhark@informatik.hu-berlin.de";
imap = "mailbox.informatik.hu-berlin.de";
smtp = "mailhost.informatik.hu-berlin.de";
smtpSettings = smtp: "smtp://${smtp}";
folders = {
drafts = "Drafts";
sent = "Sent";
trash = "Trash";
};
};
work-uni = {
user = "meinhaki";
password = lib.strings.fileContents <secrets/mail/meinhaki>;
address = "kieran.meinhardt@hu-berlin.de";
imap = "mailbox.cms.hu-berlin.de";
smtp = "mailhost.cms.hu-berlin.de";
smtpSettings = smtp: "smtp://${smtp}";
folders = {
drafts = "Drafts";
sent = "Sent";
trash = "Trash";
};
};
work-admin = {
user = "dslalewa";
password = lib.strings.fileContents <secrets/mail/dslalewa>;
address = "admin.alew.vglsprwi@hu-berlin.de";
imap = "mailbox.cms.hu-berlin.de";
smtp = "mailhost.cms.hu-berlin.de";
smtpSettings = smtp: "smtp://${smtp}";
folders = {
drafts = "Drafts";
sent = "Sent";
trash = "Trash";
};
};
uni-fsi = {
user = "fsklassp";
password = lib.strings.fileContents <secrets/mail/fsklassp>;
address = "fsklassp@hu-berlin.de";
imap = "mailbox.cms.hu-berlin.de";
smtp = "mailhost.cms.hu-berlin.de";
smtpSettings = smtp: "smtp://${smtp}";
folders = {
drafts = "Drafts";
sent = "Sent";
trash = "Trash";
};
};
work-fysi = rec {
user = "kieran@fysi.tech";
address = user;
password = lib.strings.fileContents <secrets/mail/fastmail>;
imap = "imap.fastmail.com";
smtp = "smtp.fastmail.com";
smtpSettings = smtp: "smtps://${smtp}:465";
folders = {
drafts = "Drafts";
sent = "Sent";
trash = "Trash";
};
};
cock = rec { cock = rec {
user = "2210@cock.li"; user = "2210@cock.li";
address = user; address = user;
password = lib.strings.fileContents <secrets/mail/cock>;
imap = "mail.cock.li"; imap = "mail.cock.li";
smtp = imap; smtp = imap;
smtpSettings = smtp: "smtp://${smtp}:587"; smtpSettings = smtp: "smtp://${smtp}:587";
@@ -100,46 +11,4 @@
trash = "Trash"; trash = "Trash";
}; };
}; };
"${mainMailbox}" = rec {
user = "kieran.meinhardt@posteo.net";
address = user;
password = lib.strings.fileContents <secrets/mail/posteo>;
imap = "posteo.de";
smtp = imap;
smtpSettings = smtp: "smtp://${smtp}";
folders = {
drafts = "Drafts";
sent = "Sent";
trash = "Trash";
};
};
google-amro = rec {
user = "amroplay@gmail.com";
address = user;
password = lib.strings.fileContents <secrets/mail/gmail/amroplay>;
imap = "imap.gmail.com";
smtp = "smtp.gmail.com";
smtpSettings = smtp: "smtps://${smtp}:465";
folders = {
drafts = "[Gmail]/Drafts";
sent = "[Gmail]/Sent Mail";
trash = "[Gmail]/Bin";
};
};
google-kieran = rec {
user = "kieran.meinhardt@gmail.com";
address = user;
password = lib.strings.fileContents <secrets/mail/gmail/kieran.meinhardt>;
imap = "imap.gmail.com";
smtp = "smtp.gmail.com";
smtpSettings = smtp: "smtps://${smtp}:465";
folders = {
drafts = "[Gmail]/Entwürfe";
sent = "[Gmail]/Gesendet";
trash = "[Gmail]/Papierkorb";
};
};
} }

View File

@@ -3,6 +3,7 @@
wirelessInterface, wirelessInterface,
colours, colours,
batteryName, batteryName,
accounts,
}: let }: let
inherit (pkgs) lib; inherit (pkgs) lib;
@@ -10,8 +11,6 @@
pkgs.writers.writeDash "setsid-command" '' pkgs.writers.writeDash "setsid-command" ''
${pkgs.util-linux}/bin/setsid ${script} ${pkgs.util-linux}/bin/setsid ${script}
''; '';
accounts = import <niveum/lib/email.nix> {inherit lib;};
in { in {
theme = { theme = {
name = "plain"; name = "plain";
@@ -22,8 +21,6 @@ in {
info_fg = colours.cyan.bright; info_fg = colours.cyan.bright;
warning_fg = colours.yellow.bright; warning_fg = colours.yellow.bright;
warning_bg = colours.background; warning_bg = colours.background;
alternating_tint_bg = colours.background;
alternating_tint_fg = colours.foreground;
critical_bg = colours.background; critical_bg = colours.background;
good_bg = colours.background; good_bg = colours.background;
idle_bg = colours.background; idle_bg = colours.background;
@@ -44,7 +41,6 @@ in {
format = "{location}: {temp}C"; format = "{location}: {temp}C";
service = { service = {
name = "openweathermap"; name = "openweathermap";
api_key = lib.strings.fileContents <secrets/openweathermap.key>;
city_id = "2950159"; city_id = "2950159";
units = "metric"; units = "metric";
}; };
@@ -53,7 +49,7 @@ in {
block = "custom"; block = "custom";
interval = 60 * 5; interval = 60 * 5;
command = let command = let
spacetime = import <niveum/configs/spacetime.nix>; spacetime = import ../configs/spacetime.nix;
in in
pkgs.writers.writePython3 "sun.py" { pkgs.writers.writePython3 "sun.py" {
libraries = [pkgs.python3Packages.astral]; libraries = [pkgs.python3Packages.astral];
@@ -114,7 +110,8 @@ in {
interval = 60 * 5; interval = 60 * 5;
command = let command = let
query-account = name: account: "${pkgs.writers.writeDash "query-imap-${name}" '' query-account = name: account: "${pkgs.writers.writeDash "query-imap-${name}" ''
${pkgs.coreutils}/bin/timeout 1 ${pkgs.curl}/bin/curl -sSL -u ${lib.escapeShellArg "${account.user}:${account.password}"} imaps://${account.imap} -X 'STATUS INBOX (UNSEEN)' \ password=$(${toString account.passwordCommand})
${pkgs.coreutils}/bin/timeout 1 ${pkgs.curl}/bin/curl -sSL -u ${lib.escapeShellArg account.userName}:"$password" imaps://${account.imap.host} -X 'STATUS INBOX (UNSEEN)' \
| ${pkgs.gnugrep}/bin/grep -Eo '[0-9]+' \ | ${pkgs.gnugrep}/bin/grep -Eo '[0-9]+' \
| sed 's/^/{"${name}":/;s/$/}/' | sed 's/^/{"${name}":/;s/$/}/'
''} &"; ''} &";
@@ -130,7 +127,7 @@ in {
text: (if $sum > 0 then $sum | tostring else "" end), text: (if $sum > 0 then $sum | tostring else "" end),
icon: "mail", icon: "mail",
state: ( state: (
if .uni > 0 or .["work-uni"] > 0 or .posteo > 0 then if .["hu-student"] > 0 or .["hu-employee"] > 0 or .posteo > 0 then
"Warning" "Warning"
elif $sum > 0 then elif $sum > 0 then
"Info" "Info"

45
lib/panoptikon.nix Normal file
View File

@@ -0,0 +1,45 @@
{
pkgs,
lib,
niveumPackages,
config,
...
}: {
# watcher scripts
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:
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:
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 = {
target,
retiolumLink ? false,
server ? "irc.r",
messagePrefix ? "change detected: ",
nick ? ''"$PANOPTIKON_WATCHER"-watcher'',
}:
pkgs.writers.writeDash "kpaste-irc-reporter" ''
${niveumPackages.kpaste}/bin/kpaste \
| ${pkgs.gnused}/bin/sed -n "${
if retiolumLink
then "2"
else "3"
}s/^/${messagePrefix}/p" \
| ${config.nur.repos.mic92.ircsink}/bin/ircsink \
--nick ${nick} \
--server ${server} \
--target ${target}
'';
}

View File

@@ -956,6 +956,11 @@ in
stream = soma-fm "scanner"; stream = soma-fm "scanner";
tags = [tags.soma tags.text]; tags = [tags.soma tags.text];
} }
{
station = "Al Jazeera Arabic";
stream = "https://live-hls-audio-web-aja.getaj.net/VOICE-AJA/01.m3u8";
tags = [tags.text tags.arabic];
}
{ {
desc = "Celebrating NASA and Space Explorers everywhere."; desc = "Celebrating NASA and Space Explorers everywhere.";
logo = "http://soma.fm/img/missioncontrol120.jpg"; logo = "http://soma.fm/img/missioncontrol120.jpg";
@@ -1842,71 +1847,127 @@ in
stream = dr "p8jazz"; stream = dr "p8jazz";
tags = [tags.jazz tags.danish]; tags = [tags.jazz tags.danish];
} }
{
station = "CNN morse code slow";
stream = "http://cw.dimebank.com:8080/CNNslow";
tags = [tags.text];
}
{
station = "CNN morse code fast";
stream = "http://cw.dimebank.com:8080/CNNfast";
tags = [tags.text];
}
{
station = "XXX orchestral";
stream = "http://orion.shoutca.st:8978/stream";
tags = [tags.classical];
}
{
station = "XXX greek";
stream = "http://radio.hostchefs.net:8046/stream?1520818130148";
tags = [tags.greek];
}
{
station = "XXX turkish or greek";
stream = "https://onairmediagroup.live24.gr/kralfm100xanthi";
tags = [tags.greek tags.turkish];
}
{
station = "Hard Rock Hell Radio";
tags = [tags.rock];
stream = "http://andromeda.shoutca.st:9254/stream";
}
{
station = "Divyavani";
tags = [tags.trad tags.indian];
stream = "https://divyavani.radioca.st/stream";
}
{
station = "XXX sanskrit radio";
tags = [tags.text tags.indian];
stream = "https://stream-23.zeno.fm/m08mkwsyw8quv?zs=0w7MJFPdRfavhR_zPt0M2g";
}
{
station = "Radio Mariam Arabic";
stream = "http://www.dreamsiteradiocp4.com:8014/stream";
tags = [tags.text tags.arabic];
}
{
station = "Kamchatka Live Rock";
stream = "https://radio.kamchatkalive.ru:8103/rock";
tags = [tags.rock];
}
{
station = "Kamchatka Live Chillout";
stream = "https://radio.kamchatkalive.ru:8103/chillout";
tags = [tags.chill];
}
{
station = "Kamchatka Live Dance";
stream = "https://radio.kamchatkalive.ru:8103/dance";
tags = [tags.party];
}
{
tags = [tags.arabic tags.text];
stream = "http://n02.radiojar.com/sxfbks1vfy8uv.mp3";
station = "Bahrain Radio 102.3 FM (Arabic Stories)";
}
{
tags = [tags.arabic tags.text tags.holy];
stream = "http://s2.voscast.com:12312/;";
station = "Bahrain Quran Radio";
}
{
tags = [tags.arabic tags.text tags.holy];
stream = "http://162.244.81.30:8224/;";
station = "Quran Radio Lebanon";
}
{
tags = [tags.arabic tags.text tags.holy];
station = "Coptic for God";
stream = "http://66.70.249.70:5832/stream";
}
{
stream = "http://stream-025.zeno.fm/5y95pu36sm0uv?";
station = "Hayat FM";
tags = [tags.arabic tags.text tags.holy];
}
{
stream = "http://uk2.internet-radio.com:8151/stream";
station = "The Quran Radio";
tags = [tags.arabic tags.text tags.holy];
}
] ]
++ map (name: {
stream = "https://${name}.stream.publicradio.org/${name}.aac";
station = "${name} | Your Classical";
tags = [tags.classical];
}) ["ycradio" "guitar" "cms" "relax" "lullabies" "choral" "favorites" "chambermusic" "concertband" "holiday"]
/* /*
(caster-fm "TODO" "noasrv" 10182) # https://github.com/cccruzr/albumsyoumusthear/blob/7e00baf575e4d357cd275d54d1aeb717321141a8/HLS/IBERO_90_1.m3u (caster-fm "TODO" "noasrv" 10182) # https://github.com/cccruzr/albumsyoumusthear/blob/7e00baf575e4d357cd275d54d1aeb717321141a8/HLS/IBERO_90_1.m3u
(caster-fm "TODO" "shaincast" 20866) # https://github.com/cccruzr/albumsyoumusthear/blob/7e00baf575e4d357cd275d54d1aeb717321141a8/HLS/IBERO_90_1.m3u (caster-fm "TODO" "shaincast" 20866) # https://github.com/cccruzr/albumsyoumusthear/blob/7e00baf575e4d357cd275d54d1aeb717321141a8/HLS/IBERO_90_1.m3u
CNN news in morse code
http://cw.dimebank.com:8080/CNNslow
http://cw.dimebank.com:8080/CNNfast
Orchestral
http://orion.shoutca.st:8978/stream
LoFi / Chill LoFi / Chill
http://ice55.securenetsystems.net/DASH76 http://ice55.securenetsystems.net/DASH76
News background music
https://c13014-l-hls.u.core.cdn.streamfarm.net/1000153copo/hk2.m3u8
?
http://94.23.221.158:9163/stream
Greek radio
http://radio.hostchefs.net:8046/stream?1520818130148
: http://audiokrishna.com/stations/japa2.mp3 : http://audiokrishna.com/stations/japa2.mp3
http://185.105.4.53:2339//;stream.mp3
http://cast5.servcast.net:1390/;stream.mp3
Hard rock
http://andromeda.shoutca.st:9254/stream
Rock alternative Rock alternative
http://icy.unitedradio.it/VirginRockAlternative.mp3 http://icy.unitedradio.it/VirginRockAlternative.mp3
American nautical weather news
http://ca.radioboss.fm:8149/stream
Christian radio in all languages Christian radio in all languages
https://jesuscomingfm.com/# https://jesuscomingfm.com/#
tamazight http://live.jesuscomingfm.com:8462/; tamazight http://live.jesuscomingfm.com:8462/;
supposedly good Greek radio
https://onairmediagroup.live24.gr/kralfm100xanthi
Somali Radio Somali Radio
http://n0b.radiojar.com/1pu7hhf8kfhvv http://n0b.radiojar.com/1pu7hhf8kfhvv
Sanskrit
https://stream-23.zeno.fm/m08mkwsyw8quv?zs=0w7MJFPdRfavhR_zPt0M2g
https://divyavani.radioca.st/stream
Chillout from kassel Chillout from kassel
https://server4.streamserver24.com:2199/tunein/ejanowsk.pls https://server4.streamserver24.com:2199/tunein/ejanowsk.pls
Radio Mariam Arabic (Rome)
http://www.dreamsiteradiocp4.com:8014/stream
https://radio.kamchatkalive.ru:8103/rock
https://radio.kamchatkalive.ru:8103/chillout
https://radio.kamchatkalive.ru:8103/dance
Fuā Stories (Bahrain Radio 102.3 FM)
http://n02.radiojar.com/sxfbks1vfy8uv.mp3
Bahrain Quran Radio
http://s2.voscast.com:12312/;
*/ */

86
lib/vim/init.lua Normal file
View File

@@ -0,0 +1,86 @@
local opts = { noremap=true, silent=true }
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float, opts)
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts)
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, opts)
-- Use an on_attach function to only map the following keys
-- after the language server attaches to the current buffer
local on_attach = function(client, bufnr)
-- Enable completion triggered by <c-x><c-o>
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
-- Mappings.
-- See `:help vim.lsp.*` for documentation on any of the below functions
local bufopts = { noremap=true, silent=true, buffer=bufnr }
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts)
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts)
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts)
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, bufopts)
vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, bufopts)
vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, bufopts)
vim.keymap.set('n', '<space>wl', function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, bufopts)
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, bufopts)
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, bufopts)
vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, bufopts)
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
vim.keymap.set('n', '<space>f', function() vim.lsp.buf.format { async = true } end, bufopts)
end
local lsp_flags = {
-- This is the default in Nvim 0.7+
debounce_text_changes = 150,
}
language_servers = {
pyright = {}, -- pyright
-- tsserver = {}, -- typescript-language-server
-- elmls = {}, -- elm-language-server
-- denols = {}, -- deno built in
-- bashls = {}, -- bash-language-server
hls = {}, -- haskell-language-server
-- html = {}, -- vscode-langservers-extracted
-- jsonls = {}, -- vscode-langservers-extracted
nil_ls = {}, -- github:oxalica/nil
-- rnix = {}, -- rnix-lsp
-- jqls = {}, -- jq-lsp
rust_analyzer = { ["rust-analyzer"] = {} },
-- eslint?
-- volar? vls?
texlab = {
texlab = {
auxDirectory = ".",
bibtexFormatter = "texlab",
build = {
args = { "-pdf", "-interaction=nonstopmode", "-synctex=1", "%f" },
executable = "latexmk",
forwardSearchAfter = false,
onSave = false
},
chktex = {
onEdit = false,
onOpenAndSave = false
},
diagnosticsDelay = 300,
formatterLineLength = 80,
forwardSearch = {
args = {}
},
latexFormatter = "latexindent",
latexindent = {
modifyLineBreaks = false
}
}
}
}
for server, settings in pairs(language_servers) do
require('lspconfig')[server].setup{
on_attach = on_attach,
flags = lsp_flags,
settings = settings,
}
end

View File

@@ -1,34 +0,0 @@
{
pkgs,
lib,
config,
...
}:
with lib; let
cfg = config.niveum.dropbox;
in {
options.niveum.dropbox = {enable = mkEnableOption "Dropbox";};
config = mkIf cfg.enable {
environment.systemPackages = [pkgs.dropbox-cli];
networking.firewall = {
allowedTCPPorts = [17500];
allowedUDPPorts = [17500];
};
systemd.user.services.dropbox = {
description = "Dropbox synchronisation service";
wantedBy = ["graphical-session.target"];
serviceConfig = {
ExecStart = "${pkgs.dropbox.out}/bin/dropbox";
ExecReload = "${pkgs.coreutils.out}/bin/kill -HUP $MAINPID";
KillMode = "control-group"; # upstream recommends process
Restart = "on-failure";
PrivateTmp = true;
ProtectSystem = "full";
Nice = 10;
};
};
};
}

View File

@@ -1,86 +0,0 @@
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.niveum.hledger;
hledger-git = pkgs.writers.writeDashBin "hledger-git" ''
LEDGER_DIR="$(dirname $LEDGER_FILE)"
GIT="${pkgs.git}/bin/git -C ''${LEDGER_DIR}"
if [ "$1" = entry ]; then
${cfg.package}/bin/hledger balance -V > "$LEDGER_DIR/balance.txt"
$GIT add balance.txt
$GIT commit --all --message="$(date -Im)"
else
$GIT $*
fi
'';
hledger-edit = pkgs.writers.writeDashBin "hledger-edit" ''
LEDGER_DIR="$(dirname $LEDGER_FILE)"
$EDITOR ''${LEDGER_DIR}/current.journal
'';
in {
options.niveum.hledger = {
enable = mkEnableOption "hledger";
package = mkOption {
type = types.package;
default = pkgs.hledger;
};
ledgerFile = mkOption {
type = types.str;
default = null;
};
server = {
enable = mkEnableOption "hledger server";
port = mkOption {
type = types.port;
default = 5000;
};
host = mkOption {
type = types.str;
default = "127.0.0.1";
};
capabilities = mkOption {
type = types.listOf (types.enum ["view" "add" "manage"]);
default = ["view" "add"];
};
flags = mkOption {
type = types.listOf types.str;
default = [];
};
user = mkOption {type = types.attrs;};
package = mkOption {
type = types.package;
default = pkgs.hledger-web;
};
};
};
config = mkIf cfg.enable {
environment.systemPackages = [cfg.package hledger-git hledger-edit];
environment.variables.LEDGER_FILE =
mkIf (cfg.ledgerFile != null) cfg.ledgerFile;
systemd.services.hledger-web = mkIf cfg.server.enable {
description = "hledger server";
wantedBy = ["multi-user.target"];
serviceConfig = {
Restart = "always";
ExecStart = ''
${cfg.server.package}/bin/hledger-web \
--port=${toString cfg.server.port} \
--host=${cfg.server.host} \
--capabilities=${concatStringsSep "," cfg.server.capabilities} \
${concatStringsSep " " cfg.server.flags}
'';
User = cfg.server.user.name;
PrivateTemp = true;
RuntimeDirectory = "hledger-web";
WorkingDirectory = "%t/hledger-web";
};
};
};
}

47
modules/htgen.nix Normal file
View File

@@ -0,0 +1,47 @@
{
config,
lib,
pkgs,
...
}: let
htgen = pkgs.callPackage ../packages/htgen.nix {};
in {
options.services.htgen = lib.mkOption {
default = {};
type = lib.types.attrsOf (lib.types.submodule ({config, ...}: {
options = {
enable = lib.mkEnableOption "htgen-${config._module.args.name}";
port = lib.mkOption {
type = lib.types.int;
};
script = lib.mkOption {
type = lib.types.str;
};
};
}));
};
config = {
systemd.services =
lib.mapAttrs' (
name: cfg:
lib.nameValuePair "htgen-${name}" {
wantedBy = ["multi-user.target"];
after = ["network.target"];
environment = {
HOME = "/var/lib/htgen-${name}";
HTGEN_PORT = toString cfg.port;
HTGEN_SCRIPT = cfg.script;
};
serviceConfig = {
SyslogIdentifier = "htgen-${name}";
DynamicUser = true;
StateDirectory = "htgen-${name}";
PrivateTmp = true;
Restart = "always";
ExecStart = "${htgen}/bin/htgen --serve";
};
}
)
config.services.htgen;
};
}

View File

@@ -1,13 +0,0 @@
{
pkgs,
lib,
config,
...
}:
with lib; let
cfg = config.niveum.minecraft;
in {
options.niveum.minecraft = {enable = mkEnableOption "Minecraft";};
config = mkIf cfg.enable {environment.systemPackages = [pkgs.minecraft];};
}

View File

@@ -23,6 +23,13 @@ in {
''; '';
}; };
tokensFile = mkOption {
type = types.path;
description = ''
Path to a JSON file containing a "token" key and, optionally, a "telegram"."token" key.
'';
};
notifyOnly = mkOption { notifyOnly = mkOption {
default = false; default = false;
type = types.bool; type = types.bool;
@@ -74,7 +81,7 @@ in {
Group = config.users.groups.moodle-dl.name; Group = config.users.groups.moodle-dl.name;
WorkingDirectory = cfg.directory; WorkingDirectory = cfg.directory;
ExecStart = "${cfg.package}/bin/moodle-dl ${lib.optionalString cfg.notifyOnly "--without-downloading-files"}"; ExecStart = "${cfg.package}/bin/moodle-dl ${lib.optionalString cfg.notifyOnly "--without-downloading-files"}";
ExecStartPre = "${pkgs.coreutils}/bin/ln -sfn ${toString moodle-dl-json} ${cfg.directory}/config.json"; ExecStartPre = pkgs.writers.writeDash "moodle-dl-config" "${pkgs.jq}/bin/jq -s '.[0] * .[1]' ${toString moodle-dl-json} ${toString cfg.tokensFile} > ${cfg.directory}/config.json";
} }
(mkIf (cfg.directory == stateDirectoryDefault) {StateDirectory = "moodle-dl";}) (mkIf (cfg.directory == stateDirectoryDefault) {StateDirectory = "moodle-dl";})
]; ];

130
modules/panoptikon.nix Normal file
View File

@@ -0,0 +1,130 @@
{
config,
lib,
pkgs,
...
}: {
options.services.panoptikon = {
enable = lib.mkEnableOption "Generic command output / website watcher";
watchers = lib.mkOption {
type = lib.types.attrsOf (lib.types.submodule (watcher: {
options = {
script = lib.mkOption {
type = lib.types.path;
description = ''
A script whose stdout is to be watched.
'';
example = ''
pkgs.writers.writeDash "github-meta" '''
''${pkgs.curl}/bin/curl -sSL https://api.github.com/meta | ''${pkgs.jq}/bin/jq
'''
'';
};
frequency = lib.mkOption {
type = lib.types.str;
description = ''
How often to run the script. See systemd.time(7) for more information about the format.
'';
example = "*:0/3";
default = "daily";
};
reporters = lib.mkOption {
type = lib.types.listOf lib.types.path;
description = ''
A list of scripts that take the diff (if any) via stdin and report it (e.g. to IRC, Telegram or Prometheus). The name of the watcher will be in the $PANOPTIKON_WATCHER environment variable.
'';
example = ''
[
(pkgs.writers.writeDash "telegram-reporter" '''
''${pkgs.curl}/bin/curl -X POST https://api.telegram.org/bot''${TOKEN}/sendMessage \
-d chat_id=123456 \
-d text="$(cat)"
''')
(pkgs.writers.writeDash "notify" '''
''${pkgs.libnotify}/bin/notify-send "$PANOPTIKON_WATCHER has changed."
''')
]
'';
};
};
config = {};
}));
};
};
config = let
cfg = config.services.panoptikon;
in
lib.mkIf cfg.enable {
users.extraUsers.panoptikon = {
isSystemUser = true;
createHome = true;
home = "/var/lib/panoptikon";
group = "panoptikon";
};
users.extraGroups.panoptikon = {};
systemd.timers = lib.attrsets.mapAttrs' (watcherName: _:
lib.nameValuePair "panoptikon-${watcherName}" {
timerConfig.RandomizedDelaySec = toString (60 * 60);
})
cfg.watchers;
systemd.services =
{
setup-panoptikon = {
enable = true;
wantedBy = ["multi-user.target"];
serviceConfig = {
Type = "oneshot";
User = "panoptikon";
Group = "panoptikon";
WorkingDirectory = "/var/lib/panoptikon";
Restart = "on-failure";
};
script = ''
${pkgs.git}/bin/git init --quiet
${pkgs.git}/bin/git config user.email "panoptikon@${config.networking.hostName}"
${pkgs.git}/bin/git config user.name Panoptikon
'';
};
}
// lib.attrsets.mapAttrs' (watcherName: watcherOptions:
lib.nameValuePair "panoptikon-${watcherName}" {
enable = true;
after = ["setup-panoptikon.service"];
startAt = watcherOptions.frequency;
serviceConfig = {
Type = "oneshot";
User = "panoptikon";
Group = "panoptikon";
WorkingDirectory = "/var/lib/panoptikon";
RestartSec = "60";
Restart = "on-failure";
};
unitConfig = {
StartLimitIntervalSec = "300";
StartLimitBurst = "5";
};
environment.PANOPTIKON_WATCHER = watcherName;
wants = ["network-online.target"];
script = ''
set -efu
${watcherOptions.script} > ${watcherName}
${pkgs.git}/bin/git add ${watcherName}
${pkgs.git}/bin/git commit --message "${watcherName} / $(${pkgs.coreutils}/bin/date -Is)" || :
if [ -n "$(${pkgs.git}/bin/git diff HEAD^ -- ${watcherName})" ]; then
${lib.strings.concatMapStringsSep "\n" (reporter: ''
${pkgs.git}/bin/git diff HEAD^ -- ${watcherName} | ${reporter}
'')
watcherOptions.reporters}
:
fi
'';
})
cfg.watchers;
};
}

94
modules/power-action.nix Normal file
View File

@@ -0,0 +1,94 @@
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.services.power-action;
out = {
options.services.power-action = api;
config = lib.mkIf cfg.enable imp;
};
api = {
enable = mkEnableOption "power-action";
battery = mkOption {
type = types.str;
default = "BAT0";
};
user = mkOption {
type = types.str;
default = "power-action";
};
startAt = mkOption {
type = types.str;
default = "*:0/1";
};
plans = mkOption {
type = with types;
attrsOf (submodule {
options = {
charging = mkOption {
type = nullOr bool;
default = null;
description = ''
check for charging status.
null = don't care
true = only if system is charging or unknown
false = only if system is discharging
'';
};
upperLimit = mkOption {
type = int;
};
lowerLimit = mkOption {
type = int;
};
action = mkOption {
type = path;
};
};
});
};
};
imp = {
systemd.services.power-action = {
serviceConfig = rec {
ExecStart = startScript;
User = cfg.user;
};
startAt = cfg.startAt;
};
};
startScript = pkgs.writers.writeDash "power-action" ''
set -euf
power="$(${powerlvl})"
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" ]'';
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
'';
state = pkgs.writers.writeDash "state" ''
if [ "$(cat /sys/class/power_supply/${cfg.battery}/status)" = "Discharging" ]
then echo "false"
else echo "true"
fi
'';
in
out

View File

@@ -1,64 +0,0 @@
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.services.spotifyd;
toml = pkgs.formats.toml {};
spotifydConf =
if cfg.settings != {}
then toml.generate "spotify.conf" cfg.settings
else pkgs.writeText "spotifyd.conf" cfg.config;
in {
options = {
services.spotifyd = {
enable = mkEnableOption "spotifyd, a Spotify playing daemon";
config = mkOption {
default = "";
type = types.lines;
description = ''
(Deprecated) Configuration for Spotifyd. For syntax and directives, see
<link xlink:href="https://github.com/Spotifyd/spotifyd#Configuration"/>.
'';
};
settings = mkOption {
default = {};
type = toml.type;
description = ''
Configuration for Spotifyd. For syntax and directives, see
<link xlink:href="https://github.com/Spotifyd/spotifyd#Configuration"/>.
'';
};
};
};
config = mkIf cfg.enable {
assertions = [
{
assertion = (cfg.config == "" && cfg.settings != {}) || (cfg.config != "" && cfg.settings == {});
message = "Using the stringly typed .config attribute is discouraged. Use the TOML typed .settings attribute instead.";
}
];
systemd.services.spotifyd = {
wantedBy = ["multi-user.target"];
after = ["network-online.target" "sound.target"];
description = "spotifyd, a Spotify playing daemon";
environment.SHELL = "/bin/sh";
serviceConfig = {
ExecStart = "${pkgs.spotifyd}/bin/spotifyd --no-daemon --cache-path /var/cache/spotifyd --config-path ${spotifydConf}";
Restart = "always";
RestartSec = 12;
DynamicUser = true;
CacheDirectory = "spotifyd";
SupplementaryGroups = ["audio"];
};
};
};
meta.maintainers = [maintainers.anderslundstedt];
}

View File

@@ -11,19 +11,27 @@ with lib; let
nameValuePair "telegram-bot-${name}" { nameValuePair "telegram-bot-${name}" {
enable = bot.enable; enable = bot.enable;
startAt = bot.time; startAt = bot.time;
serviceConfig.Type = "oneshot"; serviceConfig = {
Type = "oneshot";
LoadCredential = "token:${bot.tokenFile}";
};
wants = ["network-online.target"]; wants = ["network-online.target"];
script = strings.concatStringsSep "\n" (["QUOTE=$(${bot.command})" "if [ -n \"$QUOTE\" ]; then" "echo $QUOTE >&2"] script = ''
++ map (chatId: '' export TOKEN="$(cat "$CREDENTIALS_DIRECTORY/token")"
${pkgs.curl}/bin/curl -X POST "https://api.telegram.org/bot${bot.token}/sendMessage" \ QUOTE=$(${bot.command})
-d chat_id="${chatId}" \ if [ -n "$QUOTE" ]; then
-d text="$QUOTE" ${ echo $QUOTE >&2
lib.strings.optionalString (bot.parseMode != null) ${strings.concatStringsSep "\n" (map (chatId: ''
"-d parse_mode=${bot.parseMode}" ${pkgs.curl}/bin/curl -X POST "https://api.telegram.org/bot''${TOKEN}/sendMessage" \
} | ${pkgs.jq}/bin/jq -e .ok -d chat_id="${chatId}" \
'') -d text="$QUOTE" ${
bot.chatIds lib.strings.optionalString (bot.parseMode != null)
++ ["fi"]); "-d parse_mode=${bot.parseMode}"
} | ${pkgs.jq}/bin/jq -e .ok
'')
bot.chatIds)}
fi
'';
}; };
in { in {
options.niveum.telegramBots = mkOption { options.niveum.telegramBots = mkOption {
@@ -31,7 +39,7 @@ in {
options = { options = {
enable = mkEnableOption "Telegram bot"; enable = mkEnableOption "Telegram bot";
time = mkOption {type = types.str;}; time = mkOption {type = types.str;};
token = mkOption {type = types.strMatching "[0-9A-Za-z:-]+";}; tokenFile = mkOption {type = types.path;};
chatIds = mkOption { chatIds = mkOption {
type = types.listOf (types.strMatching "-?[0-9]+|@[A-Za-z0-9]+"); type = types.listOf (types.strMatching "-?[0-9]+|@[A-Za-z0-9]+");
}; };

View File

@@ -2,19 +2,17 @@
pkgs, pkgs,
lib, lib,
config, config,
inputs,
... ...
}: }:
with lib; let with lib; let
cfg = config.niveum.traadfri; cfg = config.niveum.traadfri;
traadfri = pkgs.callPackage <traadfri> {
libcoap = pkgs.callPackage <niveum/packages/libcoap.nix> {tls = true;};
};
in { in {
options.niveum.traadfri = { options.niveum.traadfri = {
enable = mkEnableOption "Trådfri CLI"; enable = mkEnableOption "Trådfri CLI";
user = mkOption {type = types.str;}; user = mkOption {type = types.str;};
host = mkOption {type = types.str;}; host = mkOption {type = types.str;};
key = mkOption {type = types.str;}; keyFile = mkOption {type = types.path;};
rooms = mkOption { rooms = mkOption {
type = types.attrsOf types.int; type = types.attrsOf types.int;
default = {}; default = {};
@@ -29,10 +27,10 @@ in {
environment.systemPackages = environment.systemPackages =
[ [
(pkgs.writers.writeDashBin "traadfri" '' (pkgs.writers.writeDashBin "traadfri" ''
TRAADFRI_USER="${cfg.user}" \ export TRAADFRI_USER="${cfg.user}"
TRAADFRI_KEY="${cfg.key}" \ export TRAADFRI_KEY="$(cat ${lib.escapeShellArg cfg.keyFile})"
TRAADFRI_HUB="${cfg.host}" \ export TRAADFRI_HUB="${cfg.host}"
${traadfri}/bin/traadfri $@ ${inputs.traadfri.defaultPackage.x86_64-linux}/bin/traadfri $@
'') '')
] ]
++ lib.mapAttrsToList (name: value: ++ lib.mapAttrsToList (name: value:

View File

@@ -1,103 +0,0 @@
{
config,
lib,
pkgs,
...
}:
with lib; let
tuna = pkgs.callPackage <tuna> {};
cfg = config.services.tuna;
in {
imports = [];
options.services.tuna = {
enable = mkEnableOption "Tuna, an MPD web UI for radio streams";
webPort = mkOption {
type = types.port;
default = 4200;
};
stations = mkOption {
default = [];
type = types.listOf (types.submodule {
options = {
id = mkOption {
type = types.int;
description = "A unique identifier of the station";
};
station = mkOption {
type = types.str;
description = "Name of the station that should be displayed";
};
desc = mkOption {
type = types.nullOr types.str;
description = "Short description of the station (optional)";
};
logo = mkOption {
type = types.str;
description = "URL to a logo of the station (any size)";
};
stream = mkOption {
type = types.str;
description = "URL to the stream of the radio station (in a format supported by MPD such as MP3, OGG, ...)";
};
};
});
};
stationsFile = mkOption {
type = types.path;
default = (pkgs.formats.json {}).generate "stations.json" cfg.stations;
};
package = mkOption {
type = types.package;
default = tuna;
};
mpd = {
host = mkOption {
type = types.str;
default = "localhost";
description = "The host where MPD is listening.";
example = "localhost";
};
port = mkOption {
type = types.port;
default = config.services.mpd.network.port;
description = "The port where MPD is listening.";
example = 6600;
};
};
};
config = mkIf cfg.enable {
users.users.tuna = {
isSystemUser = true;
group = "tuna";
};
users.groups.tuna = {};
# ref https://github.com/florianheinemann/MPD.FM/blob/9d037cf87597b26ae2f10ba9feea48946ad6cc68/service/MPD.FM.service
systemd.services.tuna = {
wantedBy = ["multi-user.target"];
after = ["mpd.service"];
script = "${cfg.package}/bin/tuna";
environment = {
NODE_ENV = "production";
MPD_HOST = cfg.mpd.host;
MPD_PORT = toString cfg.mpd.port;
PORT = toString cfg.webPort;
STATION_FILE = cfg.stationsFile;
};
serviceConfig = {
Restart = "always";
StandardOutput = "syslog";
StandardError = "syslog";
SyslogIdentifier = "tuna";
User = "tuna";
};
};
};
}

View File

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

16
packages/betacode.nix Normal file
View File

@@ -0,0 +1,16 @@
{
writers,
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)
''

9
packages/cheat-sh.nix Normal file
View File

@@ -0,0 +1,9 @@
# https://nitter.net/igor_chubin/status/1557793569104183298
{
writers,
curl,
}:
writers.writeDashBin "so" ''
IFS=+
${curl}/bin/curl -sSL http://cht.sh/"$*"
''

View File

@@ -0,0 +1,18 @@
{
writers,
fetchurl,
haskellPackages,
}:
writers.writeDashBin "closest" ''
${
writers.writeHaskellBin "closest" {
libraries = with haskellPackages; [parallel optparse-applicative edit-distance];
ghcArgs = ["-O3" "-threaded"];
} (builtins.readFile ./distance.hs)
}/bin/closest +RTS -N4 -RTS --dictionary ${
fetchurl {
url = "https://gist.github.com/MarvinJWendt/2f4f4154b8ae218600eb091a5706b5f4/raw/36b70dd6be330aa61cd4d4cdfda6234dcb0b8784/wordlist-german.txt";
sha256 = "0vr4lmlckgvj4s8sk502sknq9pf3297rvasj5sqqm05zzbdgpppj";
}
} "$@"
''

View File

@@ -0,0 +1,23 @@
{pkgs}:
pkgs.symlinkJoin {
name = "cyberlocker-tools";
paths = [
(pkgs.writers.writeDashBin "cput" ''
set -efu
path=''${1:-$(hostname)}
path=$(echo "/$path" | sed -E 's:/+:/:')
url=http://c.r$path
${pkgs.curl}/bin/curl -fSs --data-binary @- "$url"
echo "$url"
'')
(pkgs.writers.writeDashBin "cdel" ''
set -efu
path=$1
path=$(echo "/$path" | sed -E 's:/+:/:')
url=http://c.r$path
${pkgs.curl}/bin/curl -f -X DELETE "$url"
'')
];
}

View File

@@ -1,33 +0,0 @@
{
lib,
stdenv,
makeWrapper,
pandoc,
fetchFromGitHub,
}:
stdenv.mkDerivation {
name = "daybook";
src = fetchFromGitHub {
owner = "kmein";
repo = "daybook";
rev = "db2c34830e09183c80f3381bf5e4c44d52f05d53";
sha256 = "0nbsv8f12qh5spq7zhimhdf3p7msk33xrb0ilqvlc6jmlkpislmv";
};
nativeBuildInputs = [makeWrapper];
buildInputs = [pandoc];
buildPhase = ''
mkdir -p $out/man/man1
pandoc --standalone --to man daybook.1.md -o $out/man/man1/daybook.1
'';
installPhase = ''
mkdir -p $out/bin
install daybook $out/bin
wrapProgram $out/bin/daybook --prefix PATH ":" ${pandoc}/bin ;
'';
meta = with lib; {
homepage = https://github.com/kmein/daybook;
description = "A diary writing utility in sh";
license = licenses.mit;
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,8 @@
{
writers,
iproute2,
jq,
}:
writers.writeDashBin "default-gateway" ''
${iproute2}/bin/ip -json route | ${jq}/bin/jq --raw-output '.[0].gateway'
''

43
packages/dic.nix Normal file
View File

@@ -0,0 +1,43 @@
{
fetchgit,
lib,
stdenv,
coreutils,
curl,
gnugrep,
gnused,
util-linux,
}:
stdenv.mkDerivation {
name = "dic";
src = fetchgit {
url = https://cgit.ni.krebsco.de/dic;
rev = "refs/tags/v1.1.1";
sha256 = "1gbj967a5hj53fdkkxijqgwnl9hb8kskz0cmpjq7v65ffz3v6vag";
};
phases = [
"unpackPhase"
"installPhase"
];
installPhase = let
path = lib.makeBinPath [
coreutils
curl
gnused
gnugrep
util-linux
];
in ''
mkdir -p $out/bin
sed \
's,^main() {$,&\n PATH=${path}; export PATH,' \
< ./dic \
> $out/bin/dic
chmod +x $out/bin/dic
'';
}

24
packages/dirmir.nix Normal file
View File

@@ -0,0 +1,24 @@
{writers}:
writers.writeDashBin "dirmir" ''
SOURCE="$1"
TARGET="$2"
if [ ! -d "$SOURCE" ] || [ $# -ne 2 ]; then
echo >/dev/stderr "Usage: dirmir SOURCE TARGET"
exit 1
fi
if [ -e "$TARGET" ]; then
echo >/dev/stderr "$TARGET" already exists. Please use a different name.
exit 1
fi
find "$SOURCE" | while read -r entry; do
if [ -d "$entry" ]; then
mkdir -p "$TARGET/$entry"
else
# create a file with the same permissions as $entry
install -m "$(stat -c %a "$entry")" /dev/null "$TARGET/$entry"
fi
done
''

View File

@@ -0,0 +1,64 @@
{
writers,
libnotify,
dmenu,
bluez5,
lib,
}:
writers.writeDashBin "dmenu-bluetooth" ''
# UI for connecting to bluetooth devices
set -efu
PATH=$PATH=${lib.makeBinPath [libnotify dmenu bluez5]}
bluetooth_notify() {
notify-send --app-name=" Bluetooth" "$@"
}
chose_device() {
# the output from `bluetoothctl {paired-,}devices` has a first column which always contains `Device` followed by a MAC address and the device name
cut -d ' ' -f2- | dmenu -i -l 5 -p "Bluetooth device"
}
bluetoothctl scan on &
case "$(printf "pair\nconnect\ndisconnect" | dmenu -i)" in
pair)
chosen="$(bluetoothctl devices | chose_device)"
chosen_name="$(echo "$chosen" | cut -d ' ' -f2-)"
bluetooth_notify "$chosen_name" "Pairing ..."
if bluetoothctl pair "$(echo "$chosen" | cut -d ' ' -f1)"; then
bluetooth_notify " $chosen_name" "Paired with device."
else
test "$chosen" && bluetooth_notify " $chosen_name" "Failed to pair with device."
fi
;;
connect)
chosen="$(bluetoothctl paired-devices | chose_device)"
chosen_name="$(echo "$chosen" | cut -d ' ' -f2-)"
bluetooth_notify "$chosen_name" "Trying to connect ..."
if bluetoothctl connect "$(echo "$chosen" | cut -d ' ' -f1)"; then
bluetooth_notify " $chosen_name" "Connected to device."
else # something was selected but it didn't work
test "$chosen" && bluetooth_notify " $chosen_name" "Failed to connect to device."
fi
;;
disconnect)
chosen="$(bluetoothctl paired-devices | chose_device)"
chosen_name="$(echo "$chosen" | cut -d ' ' -f2-)"
bluetooth_notify "$chosen_name" "Disconnecting ..."
if bluetoothctl disconnect "$(echo "$chosen" | cut -d ' ' -f1)"; then
bluetooth_notify " $chosen_name" "Disconnected from device."
else # something was selected but it didn't work
test "$chosen" && bluetooth_notify " $chosen_name" "Failed to disconnect from device."
fi
;;
esac
''

42
packages/dmenu-scrot.nix Normal file
View File

@@ -0,0 +1,42 @@
{
writers,
lib,
dmenu,
scrot,
libnotify,
xclip,
screenshotsDirectory ? "/tmp",
}:
writers.writeDashBin "dmenu-scrot" ''
# ref https://gitlab.com/dwt1/dotfiles/-/blob/master/.dmenu/dmenu-scrot.sh
PATH=$PATH:${lib.makeBinPath [dmenu scrot libnotify xclip]}
APP_NAME="📸 Scrot"
IMG_PATH="${screenshotsDirectory}"
TIME=3000 #Miliseconds notification should remain visible
cmd=$(printf "fullscreen\nsection\nupload_fullscreen\nupload_section\n" | dmenu -p 'Screenshot')
cd "$IMG_PATH" || exit
case ''${cmd%% *} in
fullscreen)
scrot -d 1 \
&& notify-send -u low -t $TIME -a "$APP_NAME" 'Screenshot (full screen) saved.'
;;
section)
scrot -s \
&& notify-send -u low -t $TIME -a "$APP_NAME" 'Screenshot (section) saved.'
;;
upload_fullscreen)
scrot -d 1 -e "kpaste < \$f" | tail --lines=1 | xclip -selection clipboard -in \
&& notify-send -u low -t $TIME -a "$APP_NAME" "Screenshot (full screen) uploaded: $(xclip -selection clipboard -out)"
;;
upload_section)
scrot -s -e "kpaste < \$f" | tail --lines=1 | xclip -selection clipboard -in \
&& notify-send -u low -t $TIME -a "$APP_NAME" "Screenshot (section) uploaded: $(xclip -selection clipboard -out)"
;;
esac
''

View File

@@ -0,0 +1,7 @@
{
writers,
coreutils,
}:
writers.writeDashBin "dns-sledgehammer" ''
${coreutils}/bin/printf '%s\n' 'nameserver 1.1.1.1' 'options edns0' > /etc/resolv.conf
''

22
packages/fkill.nix Normal file
View File

@@ -0,0 +1,22 @@
{
writers,
lib,
procps,
gawk,
gnused,
fzf,
}:
writers.writeBashBin "fkill" ''
PATH=$PATH:${lib.makeBinPath [procps gawk gnused fzf]}
if [ "$UID" != "0" ]; then
pid=$(ps -f -u "$UID" | sed 1d | fzf -m | awk '{print $2}')
else
pid=$(ps -ef | sed 1d | fzf -m | awk '{print $2}')
fi
if [ "x$pid" != "x" ]
then
echo "$pid" | xargs kill "-''${1:-9}"
fi
''

53
packages/fzfmenu.nix Normal file
View File

@@ -0,0 +1,53 @@
{
st,
fzf,
writers,
dash,
lib,
}:
writers.writeBashBin "fzfmenu" ''
# fzfmenu - fzf as dmenu replacement
# https://github.com/junegunn/fzf/wiki/Examples#fzf-as-dmenu-replacement
set -efu
PATH=$PATH:${lib.makeBinPath [st fzf dash]}
input=$(mktemp -u --suffix .fzfmenu.input)
output=$(mktemp -u --suffix .fzfmenu.output)
mkfifo "$input"
mkfifo "$output"
chmod 600 "$input" "$output"
for i in "$@"; do
case $i in
-p)
PROMPT="$2"
shift
shift
break ;;
-l)
# no reason to filter number of lines
shift
shift
break ;;
-i)
# we do this anyway
shift
break ;;
*)
echo "Unknown option $1" >&2
shift ;;
esac
done
# it's better to use st here (starts a lot faster than pretty much everything else)
st -c fzfmenu -n fzfmenu -g 85x10 \
-e dash \
-c "cat $input | fzf --reverse --prompt="''${PROMPT+> }" --print-query $* | tee $output" & disown
# handle ctrl+c outside child terminal window
trap 'kill $! 2>/dev/null; rm -f $input $output' EXIT
cat > "$input"
cat "$output"
''

28
packages/genius.nix Normal file
View File

@@ -0,0 +1,28 @@
{
writers,
curl,
coreutils,
gnused,
pandoc,
}:
writers.writeDashBin "genius" ''
${coreutils}/bin/test "$#" -eq 2 || (
echo "usage: $0 <artist> <song>"
exit 1
)
normalize() {
${coreutils}/bin/tr -d -c '0-9A-Za-z ' | ${coreutils}/bin/tr ' ' - | ${coreutils}/bin/tr '[:upper:]' '[:lower:]'
}
ARTIST=$(echo "$1" | normalize | ${gnused}/bin/sed 's/./\U&/')
TITLE=$(echo "$2" | normalize)
GENIUS_URL="https://genius.com/$ARTIST-$TITLE-lyrics"
${curl}/bin/curl -s "$GENIUS_URL" \
| ${gnused}/bin/sed -ne '/class="lyrics"/,/<\/p>/p' \
| ${pandoc}/bin/pandoc -f html -s -t plain \
| ${gnused}/bin/sed 's/^_/\x1b[3m/g;s/_$/\x1b[0m/g;s/^\[/\n\x1b\[1m\[/g;s/\]$/\]\x1b[0m/g'
printf "\n%s\n" "$GENIUS_URL" >/dev/stderr
''

23
packages/git-preview.nix Normal file
View File

@@ -0,0 +1,23 @@
{
coreutils,
git,
writers,
}:
writers.writeDashBin "git-preview" ''
set -efu
head_commit=$(${git}/bin/git log -1 --format=%H)
merge_commit=$1; shift
merge_message='Merge for git-preview'
preview_dir=$(${coreutils}/bin/mktemp --tmpdir -d git-preview.XXXXXXXX)
preview_name=$(${coreutils}/bin/basename "$preview_dir")
${git}/bin/git worktree add --detach -f "$preview_dir" 2>/dev/null
${git}/bin/git -C "$preview_dir" checkout -q "$head_commit"
${git}/bin/git -C "$preview_dir" merge \
''${GIT_PREVIEW_MERGE_STRATEGY+-s "$GIT_PREVIEW_MERGE_STRATEGY"} \
-m "$merge_message" \
-q \
"$merge_commit"
${git}/bin/git -C "$preview_dir" diff "$head_commit.." "$@"
${coreutils}/bin/rm -fR "$preview_dir"
${coreutils}/bin/rm -R .git/worktrees/"$preview_name"
''

View File

@@ -1,14 +0,0 @@
# { stdenv, python }:
{pkgs ? import <nixpkgs> {}}:
with pkgs;
with pkgs.python2Packages;
buildPythonApplication rec {
pname = "gourmet";
version = "0.17.4";
src = builtins.fetchTarball {
url = "https://github.com/thinkle/gourmet/archive/${version}.tar.gz";
};
buildInputs = [distutils_extra intltool];
propagatedBuildInputs = [sqlalchemy reportlab lxml];
meta = with stenv.lib; {maintainers = with maintainers; [kmein];};
}

49
packages/hc.nix Normal file
View File

@@ -0,0 +1,49 @@
{
fetchgit,
lib,
makeWrapper,
stdenv,
coreutils,
findutils,
gawk,
gnugrep,
qrencode,
texlive,
utillinux,
zbar,
}:
stdenv.mkDerivation rec {
name = "hc-${meta.version}";
src = fetchgit {
url = "https://cgit.krebsco.de/hc";
rev = "refs/tags/v${meta.version}";
sha256 = "09349gja22p0j3xs082kp0fnaaada14bafszn4r3q7rg1id2slfb";
};
nativeBuildInputs = [makeWrapper];
buildPhase = null;
installPhase = ''
mkdir -p $out/bin
cp $src/bin/hc $out/bin/hc
wrapProgram $out/bin/hc \
--prefix PATH : ${lib.makeBinPath [
coreutils
findutils
gawk
gnugrep
qrencode
texlive.combined.scheme-full
utillinux
zbar
]}
'';
meta = {
version = "1.0.0";
};
}

13
packages/heuretes.nix Normal file
View File

@@ -0,0 +1,13 @@
{
writers,
fetchurl,
xsv,
}: let
database = fetchurl {
url = "http://c.krebsco.de/greek.csv";
hash = "sha256-SYL10kerNI0HzExG6JXh765+CBBCHLO95B6OKErQ/sU=";
};
in
writers.writeDashBin "heuretes" ''
${xsv}/bin/xsv search -s simple "^$*$" ${database} | ${xsv}/bin/xsv table
''

31
packages/htgen.nix Normal file
View File

@@ -0,0 +1,31 @@
{
fetchgit,
lib,
pkgs,
stdenv,
}:
stdenv.mkDerivation rec {
pname = "htgen";
version = "1.3.1";
src = fetchgit {
url = "http://cgit.krebsco.de/htgen";
rev = "refs/tags/${version}";
sha256 = "0ml8kp89bwkrwy6iqclzyhxgv2qn9dcpwaafbmsr4mgcl70zx22r";
};
installPhase = ''
mkdir -p $out/bin
{
echo '#! ${pkgs.dash}/bin/dash'
echo 'export PATH=${lib.makeBinPath [
pkgs.coreutils
pkgs.jq
pkgs.ucspi-tcp
]}''${PATH+":$PATH"}'
sed 's:^Server=htgen$:&/${version}:' htgen
} > $out/bin/htgen
chmod +x $out/bin/htgen
cp -r examples $out
'';
}

View File

@@ -0,0 +1,7 @@
{
writers,
imagemagick,
}:
writers.writeDashBin "image-convert-favicon" ''
${imagemagick}/bin/convert "$1" -define icon:auto-resize=64,48,32,16 "''${2-favicon.ico}"
''

View File

@@ -0,0 +1,14 @@
{
writers,
imagemagick,
}:
writers.writeDashBin "image-convert-tolino" ''
source_image="$1"
if [ -e "$source_image" ]; then
${imagemagick}/bin/convert -type Grayscale -resize 758x1024 "$source_image" "suspend.jpg"
else
echo >/dev/stderr "$1 must exist."
exit 1
fi
''

13
packages/infschmv.nix Normal file
View File

@@ -0,0 +1,13 @@
{
writers,
pup,
curl,
pandoc,
man,
}:
writers.writeDashBin "InfSchMV" ''
${curl}/bin/curl -sSL https://www.berlin.de/corona/massnahmen/verordnung/ \
| ${pup}/bin/pup .textile \
| ${pandoc}/bin/pandoc -f html -t man -s \
| ${man}/bin/man -l -
''

1
packages/scripts/ipa.py → packages/ipa.py Executable file → Normal file
View File

@@ -1,4 +1,3 @@
#!/usr/bin/env python3
import sys import sys
# https://www.phon.ucl.ac.uk/home/sampa/x-sampa.htm # https://www.phon.ucl.ac.uk/home/sampa/x-sampa.htm

28
packages/itl.nix Normal file
View File

@@ -0,0 +1,28 @@
{
stdenv,
fetchFromGitHub,
cmake,
lib,
}:
stdenv.mkDerivation rec {
pname = "itl";
version = "0.8.0";
src = fetchFromGitHub {
owner = "arabeyes-org";
repo = "ITL";
rev = "v${version}";
sha256 = "sha256-GTicTbZmFbPhzInFob3cfvtTxOpUZuqsQz1w9CoWu9w=";
};
nativeBuildInputs = [cmake];
cmakeFlags = [
"-DCMAKE_INSTALL_PREFIX=${placeholder "out"}"
"-DCMAKE_INSTALL_LIBDIR=lib"
];
meta = {
homepage = "https://www.arabeyes.org/ITL";
description = "Islamic Tools and Libraries";
license = lib.licenses.lgpl2;
platforms = lib.platforms.all;
maintainer = [lib.maintainers.kmein];
};
}

32
packages/itools.nix Normal file
View File

@@ -0,0 +1,32 @@
{
stdenv,
fetchFromGitHub,
itl,
lib,
# autoreconfHook,
automake,
}:
stdenv.mkDerivation rec {
pname = "itools";
version = "1.0";
src = fetchFromGitHub {
owner = "arabeyes-org";
repo = "itools";
rev = version;
sha256 = "sha256-g9bsjupC4Sb5ywAgUNbjYLbHZ/i994lbNSnX2JyaP3g=";
};
# nativeBuildInputs = [autoreconfHook];
buildPhase = ''
touch ChangeLog
./configure
make
'';
buildInputs = [itl];
meta = {
homepage = "https://www.arabeyes.org/ITL";
description = "The itools package is a set of user friendly applications utilizing Arabeyes' ITL library. ";
license = lib.licenses.gpl2;
platforms = lib.platforms.all;
maintainer = [lib.maintainers.kmein];
};
}

Some files were not shown because too many files have changed in this diff Show More