mirror of
https://github.com/kmein/niveum
synced 2026-03-16 10:11:08 +01:00
feat: fix secrets permissions, move ./packages to flake outputs
This commit is contained in:
8
.bin/unicode
Normal file
8
.bin/unicode
Normal 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)))
|
||||||
@@ -21,30 +21,44 @@ in {
|
|||||||
email-password-cock = {
|
email-password-cock = {
|
||||||
file = ../secrets/email-password-cock.age;
|
file = ../secrets/email-password-cock.age;
|
||||||
owner = config.users.users.me.name;
|
owner = config.users.users.me.name;
|
||||||
|
group = config.users.users.me.group;
|
||||||
|
mode = "400";
|
||||||
};
|
};
|
||||||
email-password-fysi = {
|
email-password-fysi = {
|
||||||
file = ../secrets/email-password-fysi.age;
|
file = ../secrets/email-password-fysi.age;
|
||||||
owner = config.users.users.me.name;
|
owner = config.users.users.me.name;
|
||||||
|
group = config.users.users.me.group;
|
||||||
|
mode = "400";
|
||||||
};
|
};
|
||||||
email-password-posteo = {
|
email-password-posteo = {
|
||||||
file = ../secrets/email-password-posteo.age;
|
file = ../secrets/email-password-posteo.age;
|
||||||
owner = config.users.users.me.name;
|
owner = config.users.users.me.name;
|
||||||
|
group = config.users.users.me.group;
|
||||||
|
mode = "400";
|
||||||
};
|
};
|
||||||
email-password-meinhark = {
|
email-password-meinhark = {
|
||||||
file = ../secrets/email-password-meinhark.age;
|
file = ../secrets/email-password-meinhark.age;
|
||||||
owner = config.users.users.me.name;
|
owner = config.users.users.me.name;
|
||||||
|
group = config.users.users.me.group;
|
||||||
|
mode = "400";
|
||||||
};
|
};
|
||||||
email-password-meinhaki = {
|
email-password-meinhaki = {
|
||||||
file = ../secrets/email-password-meinhaki.age;
|
file = ../secrets/email-password-meinhaki.age;
|
||||||
owner = config.users.users.me.name;
|
owner = config.users.users.me.name;
|
||||||
|
group = config.users.users.me.group;
|
||||||
|
mode = "400";
|
||||||
};
|
};
|
||||||
email-password-dslalewa = {
|
email-password-dslalewa = {
|
||||||
file = ../secrets/email-password-dslalewa.age;
|
file = ../secrets/email-password-dslalewa.age;
|
||||||
owner = config.users.users.me.name;
|
owner = config.users.users.me.name;
|
||||||
|
group = config.users.users.me.group;
|
||||||
|
mode = "400";
|
||||||
};
|
};
|
||||||
email-password-fsklassp = {
|
email-password-fsklassp = {
|
||||||
file = ../secrets/email-password-fsklassp.age;
|
file = ../secrets/email-password-fsklassp.age;
|
||||||
owner = config.users.users.me.name;
|
owner = config.users.users.me.name;
|
||||||
|
group = config.users.users.me.group;
|
||||||
|
mode = "400";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -96,7 +96,12 @@ in {
|
|||||||
'')
|
'')
|
||||||
];
|
];
|
||||||
|
|
||||||
age.secrets.mega-password.file = ../secrets/mega-password.age;
|
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";
|
||||||
|
|||||||
@@ -2,12 +2,11 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
lib,
|
lib,
|
||||||
config,
|
config,
|
||||||
options,
|
niveumPackages,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.strings) makeBinPath;
|
inherit (lib.strings) makeBinPath;
|
||||||
inherit (import ../lib) localAddresses kieran;
|
inherit (import ../lib) localAddresses kieran;
|
||||||
scripts = import ../packages/scripts {inherit config pkgs lib;};
|
|
||||||
defaultApplications = (import ../lib).defaultApplications {inherit pkgs;};
|
defaultApplications = (import ../lib).defaultApplications {inherit pkgs;};
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
@@ -27,10 +26,6 @@ in {
|
|||||||
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 ../packages/gfs-fonts.nix {};
|
|
||||||
tocharian-font = pkgs.callPackage ../packages/tocharian-font.nix {};
|
|
||||||
iolanguage = pkgs.callPackage ../packages/iolanguage.nix {};
|
|
||||||
ix = pkgs.callPackage ../packages/ix.nix {};
|
|
||||||
};
|
};
|
||||||
permittedInsecurePackages = [
|
permittedInsecurePackages = [
|
||||||
"qtwebkit-5.212.0-alpha4"
|
"qtwebkit-5.212.0-alpha4"
|
||||||
@@ -43,7 +38,20 @@ in {
|
|||||||
boot.loader.timeout = 1;
|
boot.loader.timeout = 1;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
age.secrets.di-fm-key.file = ../secrets/di-fm-key.age;
|
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 = {
|
||||||
@@ -88,7 +96,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";
|
||||||
|
|||||||
@@ -2,10 +2,7 @@
|
|||||||
lib,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: let
|
}: {
|
||||||
inherit (import <niveum/lib>) defaultApplications;
|
|
||||||
flameshot-once = pkgs.callPackage <stockholm/krebs/5pkgs/simple/flameshot-once> {};
|
|
||||||
in {
|
|
||||||
home-manager.users.me = {
|
home-manager.users.me = {
|
||||||
services.flameshot = {
|
services.flameshot = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@@ -19,25 +16,7 @@ in {
|
|||||||
showHelp = false;
|
showHelp = false;
|
||||||
squareMagnifier = true;
|
squareMagnifier = true;
|
||||||
uploadWithoutConfirmation = true;
|
uploadWithoutConfirmation = true;
|
||||||
buttons = lib.concatStringsSep " " [
|
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)'';
|
||||||
"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"
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
|
inputs,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (import ../lib) kieran ignorePaths;
|
inherit (import ../lib) kieran ignorePaths;
|
||||||
git-preview = pkgs.callPackage ../packages/git-preview.nix {};
|
|
||||||
in {
|
in {
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
pkgs.mr
|
pkgs.mr
|
||||||
@@ -19,7 +19,7 @@ in {
|
|||||||
pkgs.gitstats
|
pkgs.gitstats
|
||||||
pkgs.patch
|
pkgs.patch
|
||||||
pkgs.patchutils
|
pkgs.patchutils
|
||||||
git-preview
|
inputs.self.packages.x86_64-linux.git-preview
|
||||||
];
|
];
|
||||||
|
|
||||||
environment.shellAliases = {
|
environment.shellAliases = {
|
||||||
|
|||||||
@@ -2,12 +2,12 @@
|
|||||||
config,
|
config,
|
||||||
pkgs,
|
pkgs,
|
||||||
lib,
|
lib,
|
||||||
|
niveumPackages,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (import ../lib) defaultApplications colours;
|
inherit (import ../lib) defaultApplications colours;
|
||||||
scripts = import ../packages/scripts {inherit config pkgs lib;};
|
klem = niveumPackages.klem.override {
|
||||||
klem = import ../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)"
|
||||||
@@ -60,14 +60,14 @@ in {
|
|||||||
age.secrets = {
|
age.secrets = {
|
||||||
github-token-i3status-rust = {
|
github-token-i3status-rust = {
|
||||||
file = ../secrets/github-token-i3status-rust.age;
|
file = ../secrets/github-token-i3status-rust.age;
|
||||||
owner = "kfm";
|
owner = config.users.users.me.name;
|
||||||
group = "users";
|
group = config.users.users.me.group;
|
||||||
mode = "400";
|
mode = "400";
|
||||||
};
|
};
|
||||||
openweathermap-api-key = {
|
openweathermap-api-key = {
|
||||||
file = ../secrets/openweathermap-api-key.age;
|
file = ../secrets/openweathermap-api-key.age;
|
||||||
owner = "kfm";
|
owner = config.users.users.me.name;
|
||||||
group = "users";
|
group = config.users.users.me.group;
|
||||||
mode = "400";
|
mode = "400";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -254,9 +254,9 @@ 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}+Shift+w" = "exec ${niveumPackages.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" ''
|
||||||
@@ -279,16 +279,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";
|
||||||
@@ -298,9 +304,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/dmenurandr";
|
||||||
|
|
||||||
# key names detected with xorg.xev:
|
# key names detected with xorg.xev:
|
||||||
# XF86WakeUp (fn twice)
|
# XF86WakeUp (fn twice)
|
||||||
|
|||||||
@@ -17,8 +17,18 @@
|
|||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
age.secrets = {
|
age.secrets = {
|
||||||
nextcloud-password-kieran.file = ../secrets/nextcloud-password-kieran.age;
|
nextcloud-password-kieran = {
|
||||||
nextcloud-password-fysi.file = ../secrets/nextcloud-password-fysi.age;
|
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 = [
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
lib,
|
lib,
|
||||||
config,
|
config,
|
||||||
|
niveumPackages,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
scripts = import ../packages/scripts {inherit config 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";
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ in {
|
|||||||
};
|
};
|
||||||
scripts = [
|
scripts = [
|
||||||
pkgs.mpvScripts.youtube-quality
|
pkgs.mpvScripts.youtube-quality
|
||||||
(pkgs.callPackage ../packages/mpv-visualizer.nix {})
|
niveumPackages.mpv-visualizer
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,25 +1,13 @@
|
|||||||
{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 ../packages/vimPlugins/cheat-sh.nix {};
|
|
||||||
vim-fetch = pkgs.callPackage ../packages/vimPlugins/vim-fetch.nix {};
|
|
||||||
vim-colors-paramount = pkgs.callPackage ../packages/vimPlugins/vim-colors-paramount.nix {};
|
|
||||||
vim-256noir = pkgs.callPackage ../packages/vimPlugins/vim-256noir.nix {};
|
|
||||||
icalendar-vim = pkgs.callPackage ../packages/vimPlugins/icalendar-vim.nix {};
|
|
||||||
jq-vim = pkgs.callPackage ../packages/vimPlugins/jq-vim.nix {};
|
|
||||||
vim-fsharp = pkgs.callPackage ../packages/vimPlugins/vim-fsharp.nix {};
|
|
||||||
vim-reason-plus = pkgs.callPackage ../packages/vimPlugins/vim-reason-plus.nix {};
|
|
||||||
vim-mail = pkgs.callPackage ../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 {
|
||||||
@@ -34,11 +22,11 @@
|
|||||||
undotree
|
undotree
|
||||||
tabular
|
tabular
|
||||||
# vimwiki
|
# vimwiki
|
||||||
vim-colors-paramount
|
niveumPackages.vimPlugins-vim-colors-paramount
|
||||||
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 +49,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 +59,7 @@
|
|||||||
vimtex
|
vimtex
|
||||||
vim-pandoc
|
vim-pandoc
|
||||||
vim-pandoc-syntax
|
vim-pandoc-syntax
|
||||||
vim-256noir
|
niveumPackages.vimPlugins-vim-256noir
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -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";
|
||||||
|
|||||||
@@ -3,17 +3,10 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
lib,
|
lib,
|
||||||
inputs,
|
inputs,
|
||||||
|
niveumPackages,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
hc = pkgs.callPackage ../packages/hc.nix {};
|
|
||||||
worldradio = pkgs.callPackage ../packages/worldradio.nix {};
|
worldradio = pkgs.callPackage ../packages/worldradio.nix {};
|
||||||
pandoc-doc = pkgs.callPackage ../packages/man/pandoc.nix {};
|
|
||||||
dic = pkgs.callPackage ../packages/dic.nix {};
|
|
||||||
untilport = pkgs.callPackage ../packages/untilport.nix {};
|
|
||||||
cyberlocker-tools = pkgs.callPackage ../packages/cyberlocker-tools.nix {};
|
|
||||||
kpaste = pkgs.callPackage ../packages/kpaste.nix {};
|
|
||||||
|
|
||||||
scripts = import ../packages/scripts {inherit config pkgs lib;};
|
|
||||||
|
|
||||||
zoteroStyle = {
|
zoteroStyle = {
|
||||||
name,
|
name,
|
||||||
@@ -141,60 +134,58 @@ 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
|
||||||
scripts.vimv
|
niveumPackages.swallow # window swallowing
|
||||||
scripts.swallow # window swallowing
|
niveumPackages.literature-quote
|
||||||
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.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.tolino-screensaver
|
niveumPackages.image-convert-tolino
|
||||||
scripts.rfc
|
niveumPackages.rfc
|
||||||
scripts.tag
|
niveumPackages.tag
|
||||||
scripts.timer
|
niveumPackages.timer
|
||||||
python3Packages.eyeD3
|
niveumPackages.menu-calc
|
||||||
scripts.menu-calc
|
|
||||||
nix-prefetch-git
|
nix-prefetch-git
|
||||||
scripts.nix-git
|
niveumPackages.nix-git
|
||||||
nixfmt
|
nixfmt
|
||||||
par
|
par
|
||||||
qrencode
|
qrencode
|
||||||
@@ -213,35 +204,20 @@ in {
|
|||||||
(pkgs.writers.writeDashBin "ncmpcpp-zaatar" ''MPD_HOST=${(import ../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 ../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 "$@"'')
|
||||||
|
|
||||||
(pkgs.writers.writeDashBin "alarm" ''
|
inputs.scripts.packages.x86_64-linux.alarm
|
||||||
set -efu
|
|
||||||
export PATH=${lib.makeBinPath [pkgs.coreutils pkgs.bc inputs.scripts.packages.x86_64-linux.rusty-jeep]}
|
|
||||||
for i in `seq 8000 1000 10000`; do
|
|
||||||
echo $i 100
|
|
||||||
done | rusty-jeep
|
|
||||||
echo 'if you heard that sound, then goto sleep..^_^'
|
|
||||||
|
|
||||||
echo sleep "$@"
|
|
||||||
sleep "$@"
|
|
||||||
|
|
||||||
echo 'wake up!'
|
|
||||||
while :; do
|
|
||||||
echo $(echo "($(od -tu -An -N 2 /dev/urandom)%1000)+500"|bc) $(echo "($(od -tu -An -N 2 /dev/urandom)%500)+100"|bc)
|
|
||||||
done | rusty-jeep 1
|
|
||||||
'')
|
|
||||||
|
|
||||||
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
|
||||||
config.nur.repos.mic92.ircsink
|
config.nur.repos.mic92.ircsink
|
||||||
|
|
||||||
(python3.withPackages (py: [
|
(python3.withPackages (py: [
|
||||||
@@ -269,14 +245,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
|
||||||
@@ -291,7 +267,12 @@ in {
|
|||||||
'')
|
'')
|
||||||
];
|
];
|
||||||
|
|
||||||
age.secrets.home-assistant-token.file = ../secrets/home-assistant-token.age;
|
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]
|
||||||
|
|||||||
@@ -2,17 +2,15 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
|
niveumPackages,
|
||||||
...
|
...
|
||||||
}: let
|
}: {
|
||||||
scripts = import ../../packages/scripts {inherit config 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";
|
||||||
tokenFile = config.age.secrets.telegram-token-kmein.path;
|
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";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,12 @@ in {
|
|||||||
'')
|
'')
|
||||||
];
|
];
|
||||||
|
|
||||||
age.secrets.traadfri-key.file = ../secrets/traadfri-key.age;
|
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;
|
||||||
|
|||||||
25
flake.lock
generated
25
flake.lock
generated
@@ -542,7 +542,8 @@
|
|||||||
"scripts": "scripts",
|
"scripts": "scripts",
|
||||||
"telebots": "telebots",
|
"telebots": "telebots",
|
||||||
"tinc-graph": "tinc-graph",
|
"tinc-graph": "tinc-graph",
|
||||||
"traadfri": "traadfri"
|
"traadfri": "traadfri",
|
||||||
|
"voidrice": "voidrice"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"rust-overlay": {
|
"rust-overlay": {
|
||||||
@@ -636,11 +637,11 @@
|
|||||||
"rust-overlay": "rust-overlay_3"
|
"rust-overlay": "rust-overlay_3"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1677166498,
|
"lastModified": 1677171835,
|
||||||
"narHash": "sha256-az31wr2tF98+2l3SgCrIy0AcoJdN+qkTCHe2vMmBWnk=",
|
"narHash": "sha256-z8qXF2v++ErEhxGI2PEnX8NcXRiRK3DD0JzZbr/Qjk0=",
|
||||||
"owner": "kmein",
|
"owner": "kmein",
|
||||||
"repo": "scripts",
|
"repo": "scripts",
|
||||||
"rev": "bdc2ccb7081f5b09dedccba4f8875cc1b938ef04",
|
"rev": "6ef4ee97824371e1322aa8306b4670d6fa49359d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -725,6 +726,22 @@
|
|||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"voidrice": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1677155625,
|
||||||
|
"narHash": "sha256-fxkeRwTfdzfHTRmwvUpbbL/bcCtDot/b7sUXfyq3+Vo=",
|
||||||
|
"owner": "Lukesmithxyz",
|
||||||
|
"repo": "voidrice",
|
||||||
|
"rev": "2062e8110cc6b4479417ff5c5f966aebe337a6da",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "Lukesmithxyz",
|
||||||
|
"repo": "voidrice",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
|||||||
341
flake.nix
341
flake.nix
@@ -17,6 +17,7 @@
|
|||||||
telebots.url = "github:kmein/telebots";
|
telebots.url = "github:kmein/telebots";
|
||||||
tinc-graph.url = "github:kmein/tinc-graph";
|
tinc-graph.url = "github:kmein/tinc-graph";
|
||||||
traadfri.url = "github:kmein/traadfri";
|
traadfri.url = "github:kmein/traadfri";
|
||||||
|
voidrice.url = "github:Lukesmithxyz/voidrice";
|
||||||
|
|
||||||
agenix.inputs.nixpkgs.follows = "nixpkgs";
|
agenix.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
@@ -27,6 +28,7 @@
|
|||||||
nixinate.inputs.nixpkgs.follows = "nixpkgs";
|
nixinate.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
tinc-graph.inputs.flake-utils.follows = "flake-utils";
|
tinc-graph.inputs.flake-utils.follows = "flake-utils";
|
||||||
tinc-graph.inputs.nixpkgs.follows = "nixpkgs";
|
tinc-graph.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
voidrice.flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = inputs @ {
|
outputs = inputs @ {
|
||||||
@@ -37,113 +39,246 @@
|
|||||||
nixinate,
|
nixinate,
|
||||||
agenix,
|
agenix,
|
||||||
retiolum,
|
retiolum,
|
||||||
|
flake-utils,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
in {
|
in
|
||||||
apps = nixinate.nixinate.x86_64-linux self;
|
{
|
||||||
|
apps = nixinate.nixinate.x86_64-linux self;
|
||||||
|
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
ful = nixpkgs.lib.nixosSystem {
|
ful = nixpkgs.lib.nixosSystem rec {
|
||||||
system = "aarch64-linux";
|
system = "aarch64-linux";
|
||||||
modules = [
|
specialArgs = {
|
||||||
systems/ful/configuration.nix
|
niveumPackages = inputs.self.packages.${system};
|
||||||
agenix.nixosModules.default
|
inherit inputs;
|
||||||
retiolum.nixosModules.retiolum
|
};
|
||||||
];
|
modules = [
|
||||||
|
{
|
||||||
|
_module.args.nixinate = {
|
||||||
|
host = "ful";
|
||||||
|
sshUser = "root";
|
||||||
|
buildOn = "remote";
|
||||||
|
substituteOnTarget = true;
|
||||||
|
hermetic = false;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
systems/ful/configuration.nix
|
||||||
|
agenix.nixosModules.default
|
||||||
|
retiolum.nixosModules.retiolum
|
||||||
|
];
|
||||||
|
};
|
||||||
|
zaatar = nixpkgs.lib.nixosSystem rec {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
specialArgs = {
|
||||||
|
niveumPackages = inputs.self.packages.${system};
|
||||||
|
inherit inputs;
|
||||||
|
};
|
||||||
|
modules = [
|
||||||
|
{
|
||||||
|
_module.args.nixinate = {
|
||||||
|
host = "zaatar";
|
||||||
|
sshUser = "root";
|
||||||
|
buildOn = "remote";
|
||||||
|
substituteOnTarget = true;
|
||||||
|
hermetic = false;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
systems/zaatar/configuration.nix
|
||||||
|
agenix.nixosModules.default
|
||||||
|
retiolum.nixosModules.retiolum
|
||||||
|
];
|
||||||
|
};
|
||||||
|
makanek = nixpkgs.lib.nixosSystem rec {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
# 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
|
||||||
|
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
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
zaatar = nixpkgs.lib.nixosSystem {
|
}
|
||||||
system = "x86_64-linux";
|
// flake-utils.lib.eachDefaultSystem (system: let
|
||||||
modules = [
|
pkgs = import nixpkgs {
|
||||||
{
|
inherit system;
|
||||||
_module.args.nixinate = {
|
overlays = [nur.overlay];
|
||||||
host = "zaatar";
|
|
||||||
sshUser = "root";
|
|
||||||
buildOn = "remote";
|
|
||||||
substituteOnTarget = true;
|
|
||||||
hermetic = false;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
systems/zaatar/configuration.nix
|
|
||||||
agenix.nixosModules.default
|
|
||||||
retiolum.nixosModules.retiolum
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
makanek = nixpkgs.lib.nixosSystem {
|
wrapScript = {
|
||||||
system = "x86_64-linux";
|
packages ? [],
|
||||||
# for using inputs in other config files
|
name,
|
||||||
specialArgs = {inherit inputs;};
|
script,
|
||||||
modules = [
|
}:
|
||||||
{
|
pkgs.writers.writeDashBin name ''PATH=$PATH:${nixpkgs.lib.makeBinPath (packages ++ [pkgs.findutils pkgs.coreutils pkgs.gnused pkgs.gnugrep])} ${script} "$@"'';
|
||||||
_module.args.nixinate = {
|
in {
|
||||||
host = "makanek";
|
packages = {
|
||||||
sshUser = "root";
|
auc = pkgs.callPackage packages/auc.nix {};
|
||||||
buildOn = "remote";
|
betacode = pkgs.callPackage packages/betacode.nix {};
|
||||||
substituteOnTarget = true;
|
cheat-sh = pkgs.callPackage packages/cheat-sh.nix {};
|
||||||
hermetic = false;
|
closest = pkgs.callPackage packages/closest {};
|
||||||
};
|
cyberlocker-tools = pkgs.callPackage packages/cyberlocker-tools.nix {};
|
||||||
}
|
default-gateway = pkgs.callPackage packages/default-gateway.nix {};
|
||||||
systems/makanek/configuration.nix
|
depp = pkgs.callPackage packages/depp.nix {};
|
||||||
agenix.nixosModules.default
|
devanagari = pkgs.callPackage packages/devanagari {};
|
||||||
retiolum.nixosModules.retiolum
|
devour = pkgs.callPackage packages/devour.nix {};
|
||||||
nur.nixosModules.nur
|
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 {};
|
||||||
|
|
||||||
|
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];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
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 {
|
|
||||||
system = "x86_64-linux";
|
|
||||||
specialArgs = {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 {
|
|
||||||
system = "x86_64-linux";
|
|
||||||
specialArgs = {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
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
16
packages/betacode.nix
Normal file
16
packages/betacode.nix
Normal 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
9
packages/cheat-sh.nix
Normal 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/"$*"
|
||||||
|
''
|
||||||
18
packages/closest/default.nix
Normal file
18
packages/closest/default.nix
Normal 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";
|
||||||
|
}
|
||||||
|
} "$@"
|
||||||
|
''
|
||||||
@@ -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;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
8
packages/default-gateway.nix
Normal file
8
packages/default-gateway.nix
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
writers,
|
||||||
|
iproute2,
|
||||||
|
jq,
|
||||||
|
}:
|
||||||
|
writers.writeDashBin "default-gateway" ''
|
||||||
|
${iproute2}/bin/ip -json route | ${jq}/bin/jq --raw-output '.[0].gateway'
|
||||||
|
''
|
||||||
24
packages/dirmir.nix
Normal file
24
packages/dirmir.nix
Normal 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
|
||||||
|
''
|
||||||
64
packages/dmenu-bluetooth.nix
Normal file
64
packages/dmenu-bluetooth.nix
Normal 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
42
packages/dmenu-scrot.nix
Normal 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
|
||||||
|
''
|
||||||
7
packages/dns-sledgehammer.nix
Normal file
7
packages/dns-sledgehammer.nix
Normal 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
22
packages/fkill.nix
Normal 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
53
packages/fzfmenu.nix
Normal 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
28
packages/genius.nix
Normal 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
|
||||||
|
''
|
||||||
@@ -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];};
|
|
||||||
}
|
|
||||||
13
packages/heuretes.nix
Normal file
13
packages/heuretes.nix
Normal 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
|
||||||
|
''
|
||||||
7
packages/image-convert-favicon.nix
Normal file
7
packages/image-convert-favicon.nix
Normal 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}"
|
||||||
|
''
|
||||||
14
packages/image-convert-tolino.nix
Normal file
14
packages/image-convert-tolino.nix
Normal 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
13
packages/infschmv.nix
Normal 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
1
packages/scripts/ipa.py → packages/ipa.py
Executable file → Normal 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
|
||||||
17
packages/kirciuoklis.nix
Normal file
17
packages/kirciuoklis.nix
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
writers,
|
||||||
|
curl,
|
||||||
|
jq,
|
||||||
|
}:
|
||||||
|
writers.writeDashBin "kirciuoklis" ''
|
||||||
|
${curl}/bin/curl -sSL 'https://kalbu.vdu.lt/wp-admin/admin-ajax.php' -F action=text_accents -F body="$(cat)" \
|
||||||
|
| ${jq}/bin/jq -r .message \
|
||||||
|
| if [ "$1" = "--json" ]
|
||||||
|
then ${jq}/bin/jq .textParts
|
||||||
|
else ${jq}/bin/jq -r '
|
||||||
|
.textParts
|
||||||
|
| map(if has("accented") then .accented else .string end)
|
||||||
|
| join("")
|
||||||
|
'
|
||||||
|
fi
|
||||||
|
''
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
{
|
|
||||||
lib,
|
|
||||||
pkg-config,
|
|
||||||
fetchFromGitHub,
|
|
||||||
automake,
|
|
||||||
autoconf,
|
|
||||||
which,
|
|
||||||
libtool,
|
|
||||||
stdenv,
|
|
||||||
gnutls,
|
|
||||||
doxygen,
|
|
||||||
asciidoc,
|
|
||||||
tls ? false,
|
|
||||||
docs ? true,
|
|
||||||
}:
|
|
||||||
stdenv.mkDerivation {
|
|
||||||
name = "libcoap";
|
|
||||||
version = "unstable-2021-05-28";
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
repo = "libcoap";
|
|
||||||
owner = "obgm";
|
|
||||||
rev = "62b2be4da1d0fdf4b7217487ee83dc5920174425";
|
|
||||||
sha256 = "1igjv0hbwmakdccp5in4gw9w2p5swxdwsdx0glyna2s29sh1d37x";
|
|
||||||
fetchSubmodules = true;
|
|
||||||
};
|
|
||||||
buildInputs =
|
|
||||||
[which pkg-config automake autoconf libtool]
|
|
||||||
++ lib.optionals docs [doxygen asciidoc]
|
|
||||||
++ lib.optional tls gnutls;
|
|
||||||
# preConfigure = "./autogen.sh";
|
|
||||||
# configureFlags = lib.optional (!docs) "--disable-documentation" ++ lib.optional tls "--enable-dtls";
|
|
||||||
configurePhase = ''
|
|
||||||
./autogen.sh || :
|
|
||||||
./configure --enable-dtls --prefix=$out
|
|
||||||
'';
|
|
||||||
buildPhase = "make";
|
|
||||||
installPhase = "make install";
|
|
||||||
meta = with lib; {
|
|
||||||
homepage = "https://github.com/obgm/libcoap";
|
|
||||||
description = "A CoAP (RFC 7252) implementation in C";
|
|
||||||
platforms = platforms.linux;
|
|
||||||
license = licenses.bsd2;
|
|
||||||
maintainers = [maintainers.kmein];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
19
packages/literature-quote.nix
Normal file
19
packages/literature-quote.nix
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
writers,
|
||||||
|
lib,
|
||||||
|
xsv,
|
||||||
|
curl,
|
||||||
|
gnused,
|
||||||
|
}:
|
||||||
|
writers.writeDashBin "literature-quote" ''
|
||||||
|
PATH=$PATH:${lib.makeBinPath [xsv curl gnused]}
|
||||||
|
ROW=$(curl -Ls http://kmein.github.io/logotheca/quotes.csv | shuf -n1)
|
||||||
|
|
||||||
|
(
|
||||||
|
printf '%s\n\n— %s: _%s_, %s\n' \
|
||||||
|
"$(echo "$ROW" | xsv select 4)" \
|
||||||
|
"$(echo "$ROW" | xsv select 1)" \
|
||||||
|
"$(echo "$ROW" | xsv select 2)" \
|
||||||
|
"$(echo "$ROW" | xsv select 3 | tr : ,)"
|
||||||
|
) | sed 's/ | /\n/g;s/ || /\n\n/g;s/"\(.*\)"/\1/'
|
||||||
|
''
|
||||||
10
packages/man-pdf.nix
Normal file
10
packages/man-pdf.nix
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
writers,
|
||||||
|
ghostscript,
|
||||||
|
man-db,
|
||||||
|
gnused,
|
||||||
|
}:
|
||||||
|
writers.writeDashBin "man-pdf" ''
|
||||||
|
set -efu
|
||||||
|
${man-db}/bin/man -t "$@" | ${ghostscript}/bin/ps2pdf - "$(echo "$*" | ${gnused}/bin/sed 's/\s\+/_/g').pdf"
|
||||||
|
''
|
||||||
18
packages/mansplain.nix
Normal file
18
packages/mansplain.nix
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
# https://www.youtube.com/watch?v=8E8sUNHdzG8
|
||||||
|
{
|
||||||
|
writers,
|
||||||
|
man-db,
|
||||||
|
dmenu,
|
||||||
|
gnused,
|
||||||
|
findutils,
|
||||||
|
coreutils,
|
||||||
|
zathura,
|
||||||
|
}:
|
||||||
|
writers.writeDashBin "mansplain" ''
|
||||||
|
${man-db}/bin/man -k . \
|
||||||
|
| ${coreutils}/bin/cut -d" " -f1,2 \
|
||||||
|
| ${dmenu}/bin/dmenu -l 5 \
|
||||||
|
| ${gnused}/bin/sed 's/\(.*\) (\(.*\))/\2 \1/' \
|
||||||
|
| ${findutils}/bin/xargs -r ${man-db}/bin/man -t \
|
||||||
|
| ${zathura}/bin/zathura -
|
||||||
|
''
|
||||||
30
packages/manual-sort.nix
Normal file
30
packages/manual-sort.nix
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
{writers}:
|
||||||
|
writers.writeHaskellBin "manual-sort" {} ''
|
||||||
|
{-# LANGUAGE LambdaCase #-}
|
||||||
|
import Data.Char (toLower)
|
||||||
|
import System.Environment (getArgs)
|
||||||
|
import System.IO (BufferMode(NoBuffering), hSetBuffering, stdout)
|
||||||
|
|
||||||
|
insertionSortM :: Monad f => (a -> a -> f Ordering) -> [a] -> f [a]
|
||||||
|
insertionSortM cmp = foldr ((=<<) . insertByM cmp) (pure [])
|
||||||
|
where
|
||||||
|
insertByM cmp x = \case
|
||||||
|
[] -> pure [x]
|
||||||
|
yys@(y : ys) -> cmp x y >>= \case
|
||||||
|
GT -> (y :) <$> insertByM cmp x ys
|
||||||
|
_ -> pure (x : yys)
|
||||||
|
|
||||||
|
ask :: Show a => a -> a -> IO Ordering
|
||||||
|
ask a b = do
|
||||||
|
putStr (show a ++ " > " ++ show b ++ "? (y/n) ")
|
||||||
|
map toLower <$> getLine >>= \case
|
||||||
|
'y' : _ -> return GT
|
||||||
|
_ -> return LT
|
||||||
|
|
||||||
|
main :: IO ()
|
||||||
|
main = do
|
||||||
|
hSetBuffering stdout NoBuffering
|
||||||
|
argv <- getArgs
|
||||||
|
sorted <- insertionSortM ask argv
|
||||||
|
mapM_ (\(place, thing) -> putStrLn (show place ++ ". " ++ show thing)) $ zip [1 ..] (reverse sorted)
|
||||||
|
''
|
||||||
21
packages/menu-calc.nix
Normal file
21
packages/menu-calc.nix
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
writers,
|
||||||
|
gnused,
|
||||||
|
pari,
|
||||||
|
dmenu,
|
||||||
|
xclip,
|
||||||
|
}:
|
||||||
|
writers.writeDashBin "=" ''
|
||||||
|
# https://github.com/onespaceman/menu-calc
|
||||||
|
|
||||||
|
answer=$(echo "$@" | ${pari}/bin/gp -q | ${gnused}/bin/sed '/\./ s/\.\{0,1\}0\{1,\}$//')
|
||||||
|
|
||||||
|
action=$(printf "copy\nclear" | ${dmenu}/bin/dmenu -p "= $answer")
|
||||||
|
|
||||||
|
case $action in
|
||||||
|
"clear") $0 ;;
|
||||||
|
"copy") printf %s "$answer" | ${xclip}/bin/xclip -selection clipboard;;
|
||||||
|
"") ;;
|
||||||
|
*) $0 "$answer $action" ;;
|
||||||
|
esac
|
||||||
|
''
|
||||||
89
packages/meteo.nix
Normal file
89
packages/meteo.nix
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
{
|
||||||
|
writers,
|
||||||
|
lib,
|
||||||
|
jq,
|
||||||
|
curl,
|
||||||
|
xdotool,
|
||||||
|
nsxiv,
|
||||||
|
gnused,
|
||||||
|
defaultStation ? 103840,
|
||||||
|
}:
|
||||||
|
writers.writeDashBin "meteo" ''
|
||||||
|
# usage: meteo --list
|
||||||
|
# usage: meteo --update
|
||||||
|
# usage: meteo STATION
|
||||||
|
set -efu
|
||||||
|
|
||||||
|
PATH=$PATH:${lib.makeBinPath [jq curl xdotool nsxiv gnused]}
|
||||||
|
|
||||||
|
# TODO XDG
|
||||||
|
CONFIG_DIR=$HOME/.config/wetter
|
||||||
|
STATIONS_FILE=$CONFIG_DIR/stations.json
|
||||||
|
|
||||||
|
case ''${1-} in
|
||||||
|
--list)
|
||||||
|
sed -n 's/^\s*\(--[^)]\+\))$/\1/p' "$0"
|
||||||
|
jq -r -n \
|
||||||
|
--slurpfile stations_file "$STATIONS_FILE" \
|
||||||
|
'
|
||||||
|
$stations_file[0] as $known_stations |
|
||||||
|
|
||||||
|
$known_stations | keys[]
|
||||||
|
'
|
||||||
|
exit
|
||||||
|
;;
|
||||||
|
--update)
|
||||||
|
mkdir -p "$(dirname "$STATIONS_FILE")"
|
||||||
|
exec >"$STATIONS_FILE"
|
||||||
|
|
||||||
|
curl -fsSL http://wetterstationen.meteomedia.de/ |
|
||||||
|
jq -Rrs '
|
||||||
|
def decodeHTML:
|
||||||
|
gsub("ä";"ä") |
|
||||||
|
gsub("ö";"ö") |
|
||||||
|
gsub("ü";"ü") |
|
||||||
|
gsub("Ä";"Ä") |
|
||||||
|
gsub("Ö";"Ö") |
|
||||||
|
gsub("Ü";"Ü") |
|
||||||
|
gsub("ß";"ß")
|
||||||
|
;
|
||||||
|
[
|
||||||
|
match(".*<option value=\"/\\?map=Deutschland&station=(?<station>[0-9]+)\">(?<name>[^<]+)</option>";"g")
|
||||||
|
.captures |
|
||||||
|
map({"\(.name)":(.string)}) |
|
||||||
|
add |
|
||||||
|
{"\(.name|decodeHTML)":(.station|tonumber)}
|
||||||
|
] |
|
||||||
|
add
|
||||||
|
'
|
||||||
|
exit
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# set -x
|
||||||
|
|
||||||
|
station=''${1-${toString defaultStation}}
|
||||||
|
station=$(jq -e -n \
|
||||||
|
--arg station "$station" \
|
||||||
|
--slurpfile stations_file "$STATIONS_FILE" \
|
||||||
|
'
|
||||||
|
$stations_file[0] as $known_stations |
|
||||||
|
|
||||||
|
$station |
|
||||||
|
if test("^[0-9]+$") then
|
||||||
|
tonumber
|
||||||
|
else
|
||||||
|
$known_stations[.]
|
||||||
|
end
|
||||||
|
')
|
||||||
|
cache="/tmp/''${LOGNAME}_wetter_$station.png"
|
||||||
|
curl -sSL \
|
||||||
|
"http://wetterstationen.meteomedia.de/messnetz/vorhersagegrafik/$station.png" \
|
||||||
|
-o "$cache"
|
||||||
|
|
||||||
|
if window_id=$(xdotool search --name "^nsxiv - $cache$"); then
|
||||||
|
xdotool key --window "$window_id" r
|
||||||
|
else
|
||||||
|
nsxiv "$cache" &
|
||||||
|
fi
|
||||||
|
''
|
||||||
29
packages/mpv-radio.nix
Normal file
29
packages/mpv-radio.nix
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
writeText,
|
||||||
|
lib,
|
||||||
|
writers,
|
||||||
|
mpv,
|
||||||
|
dmenu,
|
||||||
|
coreutils,
|
||||||
|
gnused,
|
||||||
|
di-fm-key-file,
|
||||||
|
}: let
|
||||||
|
streams = import ../lib/streams.nix {
|
||||||
|
di-fm-key = "%DI_FM_KEY%";
|
||||||
|
};
|
||||||
|
streams-tsv = writeText "streams.tsv" (lib.concatMapStringsSep "\n" ({
|
||||||
|
desc ? "",
|
||||||
|
stream,
|
||||||
|
station,
|
||||||
|
...
|
||||||
|
}: "${station}\t${desc}\t${stream}")
|
||||||
|
streams);
|
||||||
|
in
|
||||||
|
writers.writeDashBin "mpv-radio" ''
|
||||||
|
export DI_FM_KEY=$(cat "${di-fm-key-file}")
|
||||||
|
exec ${mpv}/bin/mpv --force-window=yes "$(
|
||||||
|
${dmenu}/bin/dmenu -i -l 5 < ${streams-tsv} \
|
||||||
|
| ${coreutils}/bin/cut -f3 \
|
||||||
|
| ${gnused}/bin/sed s/%DI_FM_KEY%/"$DI_FM_KEY"/
|
||||||
|
)"
|
||||||
|
''
|
||||||
@@ -30,7 +30,6 @@ stdenvNoCC.mkDerivation rec {
|
|||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "various audio visualization";
|
description = "various audio visualization";
|
||||||
homepage = "https://github.com/mfcc64/mpv-scripts";
|
homepage = "https://github.com/mfcc64/mpv-scripts";
|
||||||
license = licenses.unfree;
|
|
||||||
platforms = platforms.all;
|
platforms = platforms.all;
|
||||||
maintainers = with maintainers; [kmein];
|
maintainers = with maintainers; [kmein];
|
||||||
};
|
};
|
||||||
|
|||||||
23
packages/new-mac.nix
Normal file
23
packages/new-mac.nix
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
openssl,
|
||||||
|
writers,
|
||||||
|
gnused,
|
||||||
|
iproute2,
|
||||||
|
jq,
|
||||||
|
}:
|
||||||
|
writers.writeDashBin "new-mac" ''
|
||||||
|
random_mac() {
|
||||||
|
${openssl}/bin/openssl rand -hex 6 | ${gnused}/bin/sed 's/\(..\)/\1:/g; s/.$//'
|
||||||
|
}
|
||||||
|
|
||||||
|
change_mac() {
|
||||||
|
old_mac="$(${iproute2}/bin/ip -j link show "$interface" | ${jq}/bin/jq -r '.[].address')"
|
||||||
|
new_mac="$(random_mac)"
|
||||||
|
${iproute2}/bin/ip link set "$interface" address "$new_mac" 2>/dev/null && echo "$old_mac -> $new_mac"
|
||||||
|
}
|
||||||
|
|
||||||
|
interface="''${1:-wlp3s0}"
|
||||||
|
${iproute2}/bin/ip link set "$interface" down
|
||||||
|
until change_mac; do :; done
|
||||||
|
${iproute2}/bin/ip link set "$interface" up
|
||||||
|
''
|
||||||
9
packages/nix-git.nix
Normal file
9
packages/nix-git.nix
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
writers,
|
||||||
|
nix-prefetch-git,
|
||||||
|
jq,
|
||||||
|
}:
|
||||||
|
writers.writeDashBin "nix-git" ''
|
||||||
|
${nix-prefetch-git}/bin/nix-prefetch-git "$@" 2> /dev/null \
|
||||||
|
| ${jq}/bin/jq -r '"rev = \"\(.rev)\";\nsha256 = \"\(.sha256)\";"'
|
||||||
|
''
|
||||||
13
packages/nix-index-update.nix
Normal file
13
packages/nix-index-update.nix
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
writers,
|
||||||
|
wget,
|
||||||
|
system,
|
||||||
|
}:
|
||||||
|
writers.writeDashBin "nix-index-update" ''
|
||||||
|
filename="index-${system}"
|
||||||
|
mkdir -p ~/.cache/nix-index
|
||||||
|
cd ~/.cache/nix-index
|
||||||
|
# -N will only download a new version if there is an update.
|
||||||
|
${wget}/bin/wget -q -N https://github.com/Mic92/nix-index-database/releases/latest/download/$filename
|
||||||
|
ln -f $filename files
|
||||||
|
''
|
||||||
25
packages/scripts/pls.nix → packages/pls.nix
Executable file → Normal file
25
packages/scripts/pls.nix → packages/pls.nix
Executable file → Normal file
@@ -1,12 +1,15 @@
|
|||||||
{
|
{
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
lib,
|
||||||
|
writers,
|
||||||
|
miller,
|
||||||
|
gnused,
|
||||||
|
curl,
|
||||||
|
nur,
|
||||||
}: let
|
}: let
|
||||||
playlistAPI = "https://radio.lassul.us";
|
playlistAPI = "https://radio.lassul.us";
|
||||||
|
|
||||||
sendIRC = pkgs.writers.writeDash "send-irc" ''
|
sendIRC = writers.writeDash "send-irc" ''
|
||||||
${config.nur.repos.mic92.ircsink}/bin/ircsink \
|
${nur.repos.mic92.ircsink}/bin/ircsink \
|
||||||
--nick musikkritiker \
|
--nick musikkritiker \
|
||||||
--server irc.hackint.org \
|
--server irc.hackint.org \
|
||||||
--port 6697 \
|
--port 6697 \
|
||||||
@@ -48,14 +51,14 @@
|
|||||||
"idk man"
|
"idk man"
|
||||||
];
|
];
|
||||||
in
|
in
|
||||||
pkgs.writers.writeDashBin "pls" ''
|
writers.writeDashBin "pls" ''
|
||||||
case "$1" in
|
case "$1" in
|
||||||
good|like|cool|nice|noice|top|yup|yass|yes|+)
|
good|like|cool|nice|noice|top|yup|yass|yes|+)
|
||||||
${pkgs.curl}/bin/curl -sS -XPOST "${playlistAPI}/good"
|
${curl}/bin/curl -sS -XPOST "${playlistAPI}/good"
|
||||||
echo ${lib.escapeShellArg (lib.concatStringsSep "\n" messages.good)} | shuf -n1 | ${sendIRC}
|
echo ${lib.escapeShellArg (lib.concatStringsSep "\n" messages.good)} | shuf -n1 | ${sendIRC}
|
||||||
;;
|
;;
|
||||||
skip|next|bad|sucks|no|nope|flop|-)
|
skip|next|bad|sucks|no|nope|flop|-)
|
||||||
${pkgs.curl}/bin/curl -sS -XPOST "${playlistAPI}/skip"
|
${curl}/bin/curl -sS -XPOST "${playlistAPI}/skip"
|
||||||
echo ${lib.escapeShellArg (lib.concatStringsSep "\n" messages.bad)} | shuf -n1 | ${sendIRC}
|
echo ${lib.escapeShellArg (lib.concatStringsSep "\n" messages.bad)} | shuf -n1 | ${sendIRC}
|
||||||
;;
|
;;
|
||||||
0|meh|neutral)
|
0|meh|neutral)
|
||||||
@@ -66,12 +69,12 @@ in
|
|||||||
echo "$@" | ${sendIRC}
|
echo "$@" | ${sendIRC}
|
||||||
;;
|
;;
|
||||||
recent)
|
recent)
|
||||||
${pkgs.curl}/bin/curl -sS -XGET "${playlistAPI}/recent" | tac | head
|
${curl}/bin/curl -sS -XGET "${playlistAPI}/recent" | tac | head
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
${pkgs.curl}/bin/curl -sS -XGET "${playlistAPI}/current" \
|
${curl}/bin/curl -sS -XGET "${playlistAPI}/current" \
|
||||||
| ${pkgs.miller}/bin/mlr --ijson --oxtab cat \
|
| ${miller}/bin/mlr --ijson --oxtab cat \
|
||||||
| ${pkgs.gnused}/bin/sed -n '/artist\|title\|youtube/p'
|
| ${gnused}/bin/sed -n '/artist\|title\|youtube/p'
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
wait
|
wait
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
{
|
|
||||||
fetchPypi,
|
|
||||||
buildPythonPackage,
|
|
||||||
pygtrie,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
buildPythonPackage rec {
|
|
||||||
pname = "betacode";
|
|
||||||
version = "0.2";
|
|
||||||
src = fetchPypi {
|
|
||||||
inherit pname version;
|
|
||||||
sha256 = "08fnjzjvnm9m6p4ddyr8qgfb9bs2nipv4ls50784v0xazgxx7siv";
|
|
||||||
};
|
|
||||||
preBuild = ''echo > README.rst'';
|
|
||||||
propagatedBuildInputs = [pygtrie];
|
|
||||||
doCheck = false;
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
{
|
|
||||||
buildPythonApplication,
|
|
||||||
fetchPypi,
|
|
||||||
requests,
|
|
||||||
}: let
|
|
||||||
in
|
|
||||||
buildPythonApplication rec {
|
|
||||||
pname = "instaloader";
|
|
||||||
version = "4.2.4";
|
|
||||||
src = fetchPypi {
|
|
||||||
inherit pname version;
|
|
||||||
sha256 = "02zqb02idk2pzks7dv42vigcmmpjpfhfdyjp911yr0ix7dy3q0b9";
|
|
||||||
};
|
|
||||||
propagatedBuildInputs = [requests];
|
|
||||||
doCheck = false;
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
{
|
|
||||||
fetchPypi,
|
|
||||||
buildPythonPackage,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
buildPythonPackage rec {
|
|
||||||
pname = "pygtrie";
|
|
||||||
version = "2.3";
|
|
||||||
src = fetchPypi {
|
|
||||||
inherit pname version;
|
|
||||||
sha256 = "00x7q4p9r75zdnw3a8vd0d0w0i5l28w408g5bsfl787yv6b1h9i8";
|
|
||||||
};
|
|
||||||
doCheck = false;
|
|
||||||
}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
{
|
|
||||||
buildPythonPackage,
|
|
||||||
buildPythonApplication,
|
|
||||||
fetchPypi,
|
|
||||||
pytestrunner,
|
|
||||||
six,
|
|
||||||
beautifulsoup4,
|
|
||||||
requests,
|
|
||||||
dbus-python,
|
|
||||||
}: let
|
|
||||||
lyricwikia = buildPythonPackage rec {
|
|
||||||
pname = "lyricwikia";
|
|
||||||
version = "0.1.9";
|
|
||||||
src = fetchPypi {
|
|
||||||
inherit pname version;
|
|
||||||
sha256 = "0sa5wkbgp5bpgkl8hgn7byyz9zj0786647ikf2l0k8m4fimq623y";
|
|
||||||
};
|
|
||||||
buildInputs = [pytestrunner];
|
|
||||||
propagatedBuildInputs = [six beautifulsoup4 requests];
|
|
||||||
doCheck = false;
|
|
||||||
};
|
|
||||||
in
|
|
||||||
buildPythonApplication rec {
|
|
||||||
pname = "spotify-cli-linux";
|
|
||||||
version = "1.4.2";
|
|
||||||
src = fetchPypi {
|
|
||||||
inherit pname version;
|
|
||||||
sha256 = "1gxich3v2i4lmh60abbw3mw15399afvvqflv8g6plvvbmvxmbgp0";
|
|
||||||
};
|
|
||||||
propagatedBuildInputs = [lyricwikia dbus-python];
|
|
||||||
doCheck = false;
|
|
||||||
}
|
|
||||||
16
packages/qrpaste.nix
Normal file
16
packages/qrpaste.nix
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
writers,
|
||||||
|
mktemp,
|
||||||
|
qrencode,
|
||||||
|
xclip,
|
||||||
|
nsxiv,
|
||||||
|
}:
|
||||||
|
writers.writeDashBin "qrpaste" ''
|
||||||
|
file="$(${mktemp}/bin/mktemp --tmpdir)"
|
||||||
|
trap clean EXIT
|
||||||
|
clean() {
|
||||||
|
rm "$file"
|
||||||
|
}
|
||||||
|
${qrencode}/bin/qrencode "$(${xclip}/bin/xclip -selection clipboard -out)" -o "$file"
|
||||||
|
${nsxiv}/bin/nsxiv "$file"
|
||||||
|
''
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
regex: https://www.radioeins.de/musik/cd_der_woche/
|
|
||||||
selectors:
|
|
||||||
httpsettings:
|
|
||||||
cookie: {}
|
|
||||||
header: {}
|
|
||||||
useragent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko)
|
|
||||||
Chrome/90.0.4430.72 Safari/537.36
|
|
||||||
insecure: false
|
|
||||||
feed:
|
|
||||||
title: .boxhead h2
|
|
||||||
description: .manualteaserShortText
|
|
||||||
authorname: ""
|
|
||||||
authoremail: ""
|
|
||||||
item:
|
|
||||||
container: .doctyperezension
|
|
||||||
title: h2 a.rezension
|
|
||||||
link: a.rezension
|
|
||||||
linkattr: href
|
|
||||||
created: .manualteaserDateTime
|
|
||||||
createdformat: 02.01.2006
|
|
||||||
description: .manualteaserShortText
|
|
||||||
content: ""
|
|
||||||
image: picture > img
|
|
||||||
imageattr: src
|
|
||||||
nextpage: ""
|
|
||||||
nextpageattr: href
|
|
||||||
nextpagecount: 0
|
|
||||||
sort: ""
|
|
||||||
23
packages/rfc.nix
Normal file
23
packages/rfc.nix
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
writers,
|
||||||
|
curl,
|
||||||
|
pup,
|
||||||
|
gawk,
|
||||||
|
gnused,
|
||||||
|
gnugrep,
|
||||||
|
less,
|
||||||
|
fzf,
|
||||||
|
}:
|
||||||
|
writers.writeDashBin "rfc" ''
|
||||||
|
set -efu
|
||||||
|
selection=$(
|
||||||
|
${curl}/bin/curl -sSL https://www.rfc-editor.org/rfc-index.txt \
|
||||||
|
| ${gawk}/bin/awk '/^$/{print;} /./{printf("%s ", $0);}' \
|
||||||
|
| ${gnused}/bin/sed 's/\s\+/ /g' \
|
||||||
|
| ${gnused}/bin/sed -n '/^[0-9]\+ /,$p' \
|
||||||
|
| ${fzf}/bin/fzf \
|
||||||
|
| ${gawk}/bin/awk '{print $1}'
|
||||||
|
)
|
||||||
|
|
||||||
|
${curl}/bin/curl -sSL "https://www.rfc-editor.org/rfc/rfc$selection.txt" | ${less}/bin/less
|
||||||
|
''
|
||||||
17
packages/scanned.nix
Normal file
17
packages/scanned.nix
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# ref https://tex.stackexchange.com/a/502542
|
||||||
|
{
|
||||||
|
writers,
|
||||||
|
imagemagick,
|
||||||
|
}:
|
||||||
|
writers.writeDashBin "scanned" ''
|
||||||
|
[ $# -eq 1 -a -f "$1" -a -r "$1" ] || exit 1
|
||||||
|
|
||||||
|
${imagemagick}/bin/convert \
|
||||||
|
-density 150 \
|
||||||
|
"$1" \
|
||||||
|
-rotate 0.5 \
|
||||||
|
-attenuate 0.25 \
|
||||||
|
+noise Multiplicative \
|
||||||
|
-colorspace Gray \
|
||||||
|
"scanned-$1"
|
||||||
|
''
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# https://github.com/LukeSmithxyz/voidrice/blob/master/.local/bin/booksplit
|
|
||||||
|
|
||||||
# Requires ffmpeg (audio splitting) and my `tag` wrapper script.
|
|
||||||
|
|
||||||
[ ! -f "$2" ] && printf "The first file should be the audio, the second should be the timecodes.\\n" && exit
|
|
||||||
|
|
||||||
echo "Enter the album/book title:"; read -r booktitle
|
|
||||||
|
|
||||||
echo "Enter the artist/author:"; read -r author
|
|
||||||
|
|
||||||
echo "Enter the publication year:"; read -r year
|
|
||||||
|
|
||||||
inputaudio="$1"
|
|
||||||
|
|
||||||
# Get a safe file name from the book.
|
|
||||||
escbook="$(echo "$booktitle" | iconv -cf UTF-8 -t ASCII//TRANSLIT | tr -d '[:punct:]' | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | sed "s/-\+/-/g;s/\(^-\|-\$\)//g")"
|
|
||||||
|
|
||||||
! mkdir -p "$escbook" && echo "Do you have write access in this directory?" && exit 1
|
|
||||||
|
|
||||||
# As long as the extension is in the tag script, it'll work.
|
|
||||||
ext="opus"
|
|
||||||
#ext="${1#*.}"
|
|
||||||
|
|
||||||
# Get the total number of tracks from the number of lines.
|
|
||||||
total="$(wc -l < "$2")"
|
|
||||||
|
|
||||||
while read -r x;
|
|
||||||
do
|
|
||||||
end="$(echo "$x" | cut -d' ' -f1)"
|
|
||||||
[ -n "$start" ] &&
|
|
||||||
echo "From $start to $end; $track $title"
|
|
||||||
file="$escbook/$(printf "%.2d" "$track")-$esctitle.$ext"
|
|
||||||
[ -n "$start" ] && echo "Splitting \"$title\"..." && ffmpeg -nostdin -y -loglevel -8 -i "$inputaudio" -ss "$start" -to "$end" -vn "$file" &&
|
|
||||||
echo "Tagging \"$title\"..." && tag -a "$author" -A "$booktitle" -t "$title" -n "$track" -N "$total" -d "$year" "$file"
|
|
||||||
title="$(echo "$x" | cut -d' ' -f 2-)"
|
|
||||||
esctitle="$(echo "$title" | iconv -cf UTF-8 -t ASCII//TRANSLIT | tr -d '[:punct:]' | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | sed "s/-\+/-/g;s/\(^-\|-\$\)//g")"
|
|
||||||
track="$((track+1))"
|
|
||||||
start="$end"
|
|
||||||
done < "$2"
|
|
||||||
# The last track must be done outside the loop.
|
|
||||||
echo "From $start to the end: $title"
|
|
||||||
file="$escbook/$(printf "%.2d" "$track")-$esctitle.$ext"
|
|
||||||
echo "Splitting \"$title\"..." && ffmpeg -nostdin -y -loglevel -8 -i "$inputaudio" -ss "$start" -vn "$file" &&
|
|
||||||
echo "Tagging \"$title\"..." && tag -a "$author" -A "$booktitle" -t "$title" -n "$track" -N "$total" -d "$year" "$file"
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
{
|
|
||||||
ruby,
|
|
||||||
stdenv,
|
|
||||||
bundlerEnv,
|
|
||||||
fetchFromGitHub,
|
|
||||||
}: let
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "kmein";
|
|
||||||
repo = "bvg";
|
|
||||||
rev = "bbfea2e0fdc91a37a34f581c4623704297275b47";
|
|
||||||
sha256 = "1iyghksyiy4xkyjw10a7qhy796p88gm9ll6wr7iq55xg98w9mya4";
|
|
||||||
};
|
|
||||||
env = bundlerEnv {
|
|
||||||
name = "bvg-env";
|
|
||||||
inherit ruby;
|
|
||||||
gemfile = "${src.out}/Gemfile";
|
|
||||||
lockfile = "${src.out}/Gemfile.lock";
|
|
||||||
gemset = "${src.out}/gemset.nix";
|
|
||||||
};
|
|
||||||
in
|
|
||||||
stdenv.mkDerivation {
|
|
||||||
name = "bvg";
|
|
||||||
buildInputs = [env.wrappedRuby];
|
|
||||||
script = "${src.out}/bvg.rb";
|
|
||||||
buildCommand = ''
|
|
||||||
install -D -m755 $script $out/bin/bvg
|
|
||||||
patchShebangs $out/bin/bvg
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
{
|
|
||||||
lib,
|
|
||||||
stdenv,
|
|
||||||
makeWrapper,
|
|
||||||
pandoc,
|
|
||||||
fetchFromGitHub,
|
|
||||||
}:
|
|
||||||
stdenv.mkDerivation {
|
|
||||||
name = "daybook";
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "kmein";
|
|
||||||
repo = "daybook";
|
|
||||||
rev = "cad1aef158b0df36861434eb04c953d99a122e80";
|
|
||||||
sha256 = "07qippyry0yjf971pnqxm9i0xpvih8mvbhxwfwpwq980jik1hbl1";
|
|
||||||
};
|
|
||||||
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;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,459 +0,0 @@
|
|||||||
{
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
kpaste = pkgs.callPackage <stockholm/krebs/5pkgs/simple/kpaste> {};
|
|
||||||
opustags = pkgs.callPackage ../opustags.nix {};
|
|
||||||
betacode = pkgs.callPackage ../python3Packages/betacode.nix {};
|
|
||||||
wrapScript = {
|
|
||||||
packages ? [],
|
|
||||||
name,
|
|
||||||
script,
|
|
||||||
}:
|
|
||||||
pkgs.writers.writeDashBin name ''
|
|
||||||
PATH=$PATH:${
|
|
||||||
lib.makeBinPath (packages ++ [pkgs.coreutils pkgs.findutils])
|
|
||||||
}
|
|
||||||
${script} "$@"
|
|
||||||
'';
|
|
||||||
voidrice = pkgs.fetchFromGitHub {
|
|
||||||
owner = "LukeSmithxyz";
|
|
||||||
repo = "voidrice";
|
|
||||||
rev = "0582b495937117d899ce8ef715a89c6cc25a36cf";
|
|
||||||
sha256 = "0c4hkny4zkknlimc9yi9ljss2cws4zn8lzd8ip9b8mfsm094dlfl";
|
|
||||||
};
|
|
||||||
in
|
|
||||||
rec {
|
|
||||||
auc = pkgs.callPackage ./auc.nix {};
|
|
||||||
|
|
||||||
instaget = wrapScript {
|
|
||||||
packages = [pkgs.jq pkgs.curl pkgs.gnugrep];
|
|
||||||
script = ./instaget.sh;
|
|
||||||
name = "instaget";
|
|
||||||
};
|
|
||||||
|
|
||||||
infschmv = pkgs.writers.writeDashBin "InfSchMV" ''
|
|
||||||
${pkgs.curl}/bin/curl -sSL https://www.berlin.de/corona/massnahmen/verordnung/ \
|
|
||||||
| ${pkgs.pup}/bin/pup .textile \
|
|
||||||
| ${pkgs.pandoc}/bin/pandoc -f html -t man -s \
|
|
||||||
| ${pkgs.man}/bin/man -l -
|
|
||||||
'';
|
|
||||||
|
|
||||||
trans = let
|
|
||||||
script = pkgs.fetchurl {
|
|
||||||
url = "https://raw.githubusercontent.com/soimort/translate-shell/gh-pages/trans.awk";
|
|
||||||
sha256 = "178r8d27bry1mzd1g8x2svp4w469hwv7nnxnmnsinx974skjx0jb";
|
|
||||||
};
|
|
||||||
in
|
|
||||||
pkgs.writers.writeDashBin "trans" ''
|
|
||||||
${pkgs.gawk}/bin/gawk -f ${script} -- "$@"
|
|
||||||
'';
|
|
||||||
|
|
||||||
dns-sledgehammer = pkgs.writers.writeDashBin "dns-sledgehammer" ''
|
|
||||||
${pkgs.coreutils}/bin/printf '%s\n' 'nameserver 1.1.1.1' 'options edns0' > /etc/resolv.conf
|
|
||||||
'';
|
|
||||||
|
|
||||||
showkeys-toggle = pkgs.writers.writeDashBin "showkeys-toggle" ''
|
|
||||||
if ${pkgs.procps}/bin/pgrep screenkey; then
|
|
||||||
exec ${pkgs.procps}/bin/pkill screenkey
|
|
||||||
else
|
|
||||||
exec ${pkgs.screenkey}/bin/screenkey
|
|
||||||
fi
|
|
||||||
'';
|
|
||||||
|
|
||||||
qrpaste = pkgs.writers.writeDashBin "qrpaste" ''
|
|
||||||
file="$(${pkgs.mktemp}/bin/mktemp --tmpdir)"
|
|
||||||
trap clean EXIT
|
|
||||||
clean() {
|
|
||||||
rm "$file"
|
|
||||||
}
|
|
||||||
${pkgs.qrencode}/bin/qrencode "$(${pkgs.xclip}/bin/xclip -selection clipboard -out)" -o "$file"
|
|
||||||
${pkgs.nsxiv}/bin/nsxiv "$file"
|
|
||||||
'';
|
|
||||||
|
|
||||||
ttspaste = pkgs.writers.writeDashBin "ttspaste" ''
|
|
||||||
${pkgs.xclip}/bin/xclip -selection clipboard -out | ${pkgs.curl}/bin/curl -G http://tts.r/api/tts --data-urlencode 'text@-' | ${pkgs.mpv}/bin/mpv -
|
|
||||||
'';
|
|
||||||
|
|
||||||
interdimensional-cable = let
|
|
||||||
nimaid-github-io = pkgs.fetchFromGitHub {
|
|
||||||
owner = "nimaid";
|
|
||||||
repo = "nimaid.github.io";
|
|
||||||
rev = "9cb4ede215be6bb01bd2df1ef3e9689cc8c4eb9e";
|
|
||||||
sha256 = "1g47cj5an7xgmhpc09m7qim5j9rspqxvnzfy90cnlvz4pg8hil96";
|
|
||||||
};
|
|
||||||
in
|
|
||||||
pkgs.writeShellScriptBin "interdimensional-cable" ''
|
|
||||||
export PATH=${lib.makeBinPath [pkgs.mpv pkgs.jq pkgs.gnused]}
|
|
||||||
mpv --shuffle --playlist=<(jq -r '.videos[]' ${nimaid-github-io}/tv/interdimensional_database.json | sed 's#^#https://youtu.be/#')
|
|
||||||
'';
|
|
||||||
|
|
||||||
tag = wrapScript {
|
|
||||||
packages = [pkgs.vorbis-tools pkgs.python3Packages.eyeD3 opustags];
|
|
||||||
script = "${voidrice}/.local/bin/tag";
|
|
||||||
name = "tag";
|
|
||||||
};
|
|
||||||
|
|
||||||
meteo = wrapScript {
|
|
||||||
packages = [pkgs.jq pkgs.curl pkgs.xdotool pkgs.nsxiv pkgs.gnused];
|
|
||||||
script = ./meteo.sh;
|
|
||||||
name = "meteo";
|
|
||||||
};
|
|
||||||
|
|
||||||
kirciuoklis = wrapScript {
|
|
||||||
packages = [pkgs.curl pkgs.jq];
|
|
||||||
script = ./kirciuoklis.sh;
|
|
||||||
name = "kirciuoklis";
|
|
||||||
};
|
|
||||||
|
|
||||||
booksplit = wrapScript {
|
|
||||||
packages = [pkgs.ffmpeg tag pkgs.glibc.bin];
|
|
||||||
script = "${voidrice}/.local/bin/booksplit";
|
|
||||||
name = "booksplit";
|
|
||||||
};
|
|
||||||
|
|
||||||
n = wrapScript {
|
|
||||||
script = ./n.sh;
|
|
||||||
name = "n";
|
|
||||||
};
|
|
||||||
|
|
||||||
dirmir = wrapScript {
|
|
||||||
name = "dirmir";
|
|
||||||
script = ./dirmir.sh;
|
|
||||||
};
|
|
||||||
|
|
||||||
liddel-scott-jones = wrapScript {
|
|
||||||
name = "lsj";
|
|
||||||
script = ./liddel-scott-jones.sh;
|
|
||||||
packages = [pkgs.curl pkgs.pup betacode pkgs.gnused pkgs.pandoc pkgs.man];
|
|
||||||
};
|
|
||||||
|
|
||||||
sanskrit-dictionary = pkgs.writers.writeDashBin "sa" ''
|
|
||||||
set -efu
|
|
||||||
|
|
||||||
usage() {
|
|
||||||
echo "usage: [OUTPUT=deva|roman] $0 mw|mwe|boet|bopp|apte|boro TERM"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
[ $# -eq 2 ] || usage
|
|
||||||
|
|
||||||
case $1 in
|
|
||||||
mw) id=MWScan;;
|
|
||||||
mwe) id=MWEScan;;
|
|
||||||
bopp) id=BOPScan;;
|
|
||||||
boet) id=PWGScan;;
|
|
||||||
apte) id=AEScan;;
|
|
||||||
boro) id=BORScan;;
|
|
||||||
*) usage;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
shift
|
|
||||||
|
|
||||||
input="$*"
|
|
||||||
|
|
||||||
${pkgs.curl}/bin/curl -sSL "https://www.sanskrit-lexicon.uni-koeln.de/scans/$id/2020/web/webtc/getword.php?key=$input&filter=''${OUTPUT-roman}&accent=yes&transLit=hk" \
|
|
||||||
| ${pkgs.pandoc}/bin/pandoc --standalone --variable=title:"$input" --from=html --to=man \
|
|
||||||
| ${pkgs.gnused}/bin/sed 's/\s\+\([:.,;]\)/\1/g;s/\s\+/ /g' \
|
|
||||||
| ${pkgs.man}/bin/man --local-file --pager="${pkgs.bat}/bin/bat -p" -
|
|
||||||
'';
|
|
||||||
|
|
||||||
playlist = import ./pls.nix {inherit pkgs lib config;};
|
|
||||||
|
|
||||||
mpv-tv = import ./mpv-tv.nix {inherit pkgs lib;};
|
|
||||||
|
|
||||||
favicon = wrapScript {
|
|
||||||
packages = [pkgs.imagemagick];
|
|
||||||
name = "favicon";
|
|
||||||
script = ./favicon.sh;
|
|
||||||
};
|
|
||||||
|
|
||||||
closest = pkgs.writers.writeDashBin "closest" ''
|
|
||||||
${
|
|
||||||
pkgs.writers.writeHaskellBin "closest" {
|
|
||||||
libraries = with pkgs.haskellPackages; [parallel optparse-applicative edit-distance];
|
|
||||||
ghcArgs = ["-O3" "-threaded"];
|
|
||||||
} (builtins.readFile ./distance.hs)
|
|
||||||
}/bin/closest +RTS -N4 -RTS --dictionary ${
|
|
||||||
pkgs.fetchurl {
|
|
||||||
url = "https://gist.github.com/MarvinJWendt/2f4f4154b8ae218600eb091a5706b5f4/raw/36b70dd6be330aa61cd4d4cdfda6234dcb0b8784/wordlist-german.txt";
|
|
||||||
sha256 = "0vr4lmlckgvj4s8sk502sknq9pf3297rvasj5sqqm05zzbdgpppj";
|
|
||||||
}
|
|
||||||
} "$@"
|
|
||||||
'';
|
|
||||||
|
|
||||||
horoscope = pkgs.callPackage ./horoscope {};
|
|
||||||
|
|
||||||
genius = wrapScript {
|
|
||||||
packages = [pkgs.curl pkgs.gnused pkgs.pandoc];
|
|
||||||
name = "genius";
|
|
||||||
script = ./genius.sh;
|
|
||||||
};
|
|
||||||
|
|
||||||
literature-quote = wrapScript {
|
|
||||||
packages = [pkgs.xsv pkgs.curl pkgs.gnused];
|
|
||||||
name = "literature-quote";
|
|
||||||
script = ./literature-quote.sh;
|
|
||||||
};
|
|
||||||
|
|
||||||
man-pdf = wrapScript {
|
|
||||||
packages = [pkgs.man pkgs.ghostscript];
|
|
||||||
name = "man-pdf";
|
|
||||||
script = ./man-pdf.sh;
|
|
||||||
};
|
|
||||||
|
|
||||||
odyssey = wrapScript {
|
|
||||||
packages = [pkgs.curl pkgs.xmlstarlet];
|
|
||||||
name = "odyssey";
|
|
||||||
script = ./odyssey.sh;
|
|
||||||
};
|
|
||||||
|
|
||||||
tolino-screensaver = wrapScript {
|
|
||||||
packages = [pkgs.imagemagick];
|
|
||||||
name = "tolino-screensaver";
|
|
||||||
script = ./tolino-screensaver.sh;
|
|
||||||
};
|
|
||||||
|
|
||||||
wttr = wrapScript {
|
|
||||||
packages = [pkgs.curl];
|
|
||||||
name = "wttr";
|
|
||||||
script = ./wttr.sh;
|
|
||||||
};
|
|
||||||
|
|
||||||
vg = wrapScript {
|
|
||||||
packages = [pkgs.ripgrep pkgs.fzf pkgs.gawk];
|
|
||||||
name = "vg";
|
|
||||||
script = ./vg.sh;
|
|
||||||
};
|
|
||||||
|
|
||||||
dmenurandr = wrapScript {
|
|
||||||
packages = [pkgs.dmenu pkgs.gnugrep pkgs.gnused pkgs.xorg.xrandr pkgs.gawk pkgs.libnotify pkgs.arandr];
|
|
||||||
name = "dmenurandr";
|
|
||||||
script = ./dmenurandr.sh;
|
|
||||||
};
|
|
||||||
|
|
||||||
dmenubluetooth = wrapScript {
|
|
||||||
packages = [pkgs.bluez5 pkgs.dmenu pkgs.libnotify];
|
|
||||||
name = "dmenubluetooth";
|
|
||||||
script = ./dmenubluetooth.sh;
|
|
||||||
};
|
|
||||||
|
|
||||||
fkill = wrapScript {
|
|
||||||
packages = [pkgs.procps pkgs.gawk pkgs.gnused pkgs.fzf pkgs.bash];
|
|
||||||
script = ./fkill.sh;
|
|
||||||
name = "fkill";
|
|
||||||
};
|
|
||||||
|
|
||||||
nix-git = wrapScript {
|
|
||||||
packages = [pkgs.nix-prefetch-git pkgs.jq];
|
|
||||||
script = ./nix-git.sh;
|
|
||||||
name = "nix-git";
|
|
||||||
};
|
|
||||||
|
|
||||||
mansplain = wrapScript {
|
|
||||||
packages = [pkgs.man pkgs.zathura pkgs.dmenu pkgs.gnused];
|
|
||||||
script = ./mansplain.sh;
|
|
||||||
name = "mansplain";
|
|
||||||
};
|
|
||||||
|
|
||||||
notetags = wrapScript {
|
|
||||||
script = ./notetags.sh;
|
|
||||||
name = "notetags";
|
|
||||||
};
|
|
||||||
|
|
||||||
fzfmenu = wrapScript {
|
|
||||||
script = ./fzfmenu.sh;
|
|
||||||
name = "fzfmenu";
|
|
||||||
packages = [pkgs.st pkgs.fzf pkgs.dash pkgs.bash];
|
|
||||||
};
|
|
||||||
|
|
||||||
swallow = wrapScript {
|
|
||||||
script = ./swallow.sh;
|
|
||||||
name = "swallow";
|
|
||||||
packages = [pkgs.xdo];
|
|
||||||
};
|
|
||||||
|
|
||||||
ipa = wrapScript {
|
|
||||||
script = ./ipa.py;
|
|
||||||
name = "ipa";
|
|
||||||
packages = [pkgs.python3];
|
|
||||||
};
|
|
||||||
|
|
||||||
default-gateway = pkgs.writers.writeDashBin "default-gateway" ''
|
|
||||||
${pkgs.iproute2}/bin/ip -json route | ${pkgs.jq}/bin/jq --raw-output '.[0].gateway'
|
|
||||||
'';
|
|
||||||
|
|
||||||
betacode =
|
|
||||||
pkgs.writers.writeHaskellBin "betacode" {
|
|
||||||
libraries = with pkgs; [
|
|
||||||
(haskell.lib.unmarkBroken (haskell.lib.doJailbreak haskellPackages.betacode))
|
|
||||||
haskellPackages.text
|
|
||||||
];
|
|
||||||
} ''
|
|
||||||
import qualified Data.Text.IO as T
|
|
||||||
import qualified Data.Text as T
|
|
||||||
import Text.BetaCode
|
|
||||||
main = T.interact (either (error . T.unpack) id . fromBeta)
|
|
||||||
'';
|
|
||||||
|
|
||||||
devanagari = pkgs.callPackage ../devanagari {};
|
|
||||||
|
|
||||||
timer = pkgs.writers.writeDashBin "timer" ''
|
|
||||||
[ $# -eq 2 ] || {
|
|
||||||
echo "Usage: $0 TIME MESSAGE" 1>&2
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
time=$(echo "$1" | ${pkgs.bc}/bin/bc)
|
|
||||||
echo "sleeping $time seconds, then saying: $2"
|
|
||||||
${pkgs.coreutils}/bin/sleep "$time" && {
|
|
||||||
echo "$2" | ${pkgs.espeak}/bin/espeak -v german-mbrola-6
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
|
|
||||||
manual-sort = pkgs.writers.writeHaskellBin "manual-sort" {} ''
|
|
||||||
{-# LANGUAGE LambdaCase #-}
|
|
||||||
import Data.Char (toLower)
|
|
||||||
import System.Environment (getArgs)
|
|
||||||
import System.IO (BufferMode(NoBuffering), hSetBuffering, stdout)
|
|
||||||
|
|
||||||
insertionSortM :: Monad f => (a -> a -> f Ordering) -> [a] -> f [a]
|
|
||||||
insertionSortM cmp = foldr ((=<<) . insertByM cmp) (pure [])
|
|
||||||
where
|
|
||||||
insertByM cmp x = \case
|
|
||||||
[] -> pure [x]
|
|
||||||
yys@(y : ys) -> cmp x y >>= \case
|
|
||||||
GT -> (y :) <$> insertByM cmp x ys
|
|
||||||
_ -> pure (x : yys)
|
|
||||||
|
|
||||||
ask :: Show a => a -> a -> IO Ordering
|
|
||||||
ask a b = do
|
|
||||||
putStr (show a ++ " > " ++ show b ++ "? (y/n) ")
|
|
||||||
map toLower <$> getLine >>= \case
|
|
||||||
'y' : _ -> return GT
|
|
||||||
_ -> return LT
|
|
||||||
|
|
||||||
main :: IO ()
|
|
||||||
main = do
|
|
||||||
hSetBuffering stdout NoBuffering
|
|
||||||
argv <- getArgs
|
|
||||||
sorted <- insertionSortM ask argv
|
|
||||||
mapM_ (\(place, thing) -> putStrLn (show place ++ ". " ++ show thing)) $ zip [1 ..] (reverse sorted)
|
|
||||||
'';
|
|
||||||
|
|
||||||
scrot-dmenu = wrapScript {
|
|
||||||
script = ./scrot-dmenu.sh;
|
|
||||||
name = "dmenu-scrot";
|
|
||||||
packages = [pkgs.xclip pkgs.scrot kpaste pkgs.libnotify pkgs.dmenu];
|
|
||||||
};
|
|
||||||
|
|
||||||
unicodmenu = pkgs.callPackage ./unicodmenu.nix {};
|
|
||||||
|
|
||||||
mpv-radio = let
|
|
||||||
streams = import ../../lib/streams.nix {
|
|
||||||
di-fm-key = "%DI_FM_KEY%"; # lib.strings.fileContents <secrets/di.fm/key>;
|
|
||||||
};
|
|
||||||
streams-tsv = pkgs.writeText "streams.tsv" (lib.concatMapStringsSep "\n" ({
|
|
||||||
desc ? "",
|
|
||||||
stream,
|
|
||||||
station,
|
|
||||||
...
|
|
||||||
}: "${station}\t${desc}\t${stream}")
|
|
||||||
streams);
|
|
||||||
in
|
|
||||||
pkgs.writers.writeDashBin "mpv-radio" ''
|
|
||||||
export DI_FM_KEY=$(cat "${config.age.secrets.di-fm-key.path}")
|
|
||||||
exec ${pkgs.mpv}/bin/mpv --force-window=yes "$(
|
|
||||||
${pkgs.dmenu}/bin/dmenu -i -l 5 < ${streams-tsv} \
|
|
||||||
| ${pkgs.coreutils}/bin/cut -f3 \
|
|
||||||
| ${pkgs.gnused}/bin/sed s/%DI_FM_KEY%/"$DI_FM_KEY"/
|
|
||||||
)"
|
|
||||||
'';
|
|
||||||
|
|
||||||
rfc = wrapScript {
|
|
||||||
script = ./rfc.sh;
|
|
||||||
name = "rfc";
|
|
||||||
packages = [pkgs.curl pkgs.pup pkgs.gnused pkgs.gawk pkgs.gnugrep pkgs.fzf];
|
|
||||||
};
|
|
||||||
|
|
||||||
new-mac = wrapScript {
|
|
||||||
script = ./new-mac.sh;
|
|
||||||
name = "new-mac";
|
|
||||||
packages = [pkgs.gnused pkgs.openssl pkgs.jq pkgs.iproute2];
|
|
||||||
};
|
|
||||||
|
|
||||||
bvg = pkgs.callPackage ./bvg.nix {};
|
|
||||||
nav = pkgs.callPackage ./nav.nix {};
|
|
||||||
k-lock = pkgs.callPackage ./k-lock.nix {};
|
|
||||||
|
|
||||||
menu-calc = pkgs.writers.writeDashBin "=" ''
|
|
||||||
# https://github.com/onespaceman/menu-calc
|
|
||||||
|
|
||||||
answer=$(echo "$@" | ${pkgs.pari}/bin/gp -q | ${pkgs.gnused}/bin/sed '/\./ s/\.\{0,1\}0\{1,\}$//')
|
|
||||||
|
|
||||||
action=$(printf "copy\nclear" | ${pkgs.dmenu}/bin/dmenu -p "= $answer")
|
|
||||||
|
|
||||||
case $action in
|
|
||||||
"clear") $0 ;;
|
|
||||||
"copy") printf %s "$answer" | ${pkgs.xclip}/bin/xclip -selection clipboard;;
|
|
||||||
"") ;;
|
|
||||||
*) $0 "$answer $action" ;;
|
|
||||||
esac
|
|
||||||
'';
|
|
||||||
|
|
||||||
# ref https://tex.stackexchange.com/a/502542
|
|
||||||
scanned = pkgs.writers.writeDashBin "scanned" ''
|
|
||||||
[ $# -eq 1 -a -f "$1" -a -r "$1" ] || exit 1
|
|
||||||
|
|
||||||
${pkgs.imagemagick}/bin/convert -density 150 "$1" -rotate 0.5 -attenuate 0.25 +noise Multiplicative -colorspace Gray "scanned-$1"
|
|
||||||
'';
|
|
||||||
|
|
||||||
nix-index-update = pkgs.writers.writeDashBin "nix-index-update" ''
|
|
||||||
filename="index-x86_64-$(uname | tr A-Z a-z)"
|
|
||||||
mkdir -p ~/.cache/nix-index
|
|
||||||
cd ~/.cache/nix-index
|
|
||||||
# -N will only download a new version if there is an update.
|
|
||||||
${pkgs.wget}/bin/wget -q -N https://github.com/Mic92/nix-index-database/releases/latest/download/$filename
|
|
||||||
ln -f $filename files
|
|
||||||
'';
|
|
||||||
|
|
||||||
heuretes = let
|
|
||||||
database = pkgs.fetchurl {
|
|
||||||
url = "http://c.krebsco.de/greek.csv";
|
|
||||||
hash = "sha256-SYL10kerNI0HzExG6JXh765+CBBCHLO95B6OKErQ/sU=";
|
|
||||||
};
|
|
||||||
in
|
|
||||||
pkgs.writers.writeDashBin "heuretes" ''
|
|
||||||
${pkgs.xsv}/bin/xsv search -s simple "^$*$" ${database} | ${pkgs.xsv}/bin/xsv table
|
|
||||||
'';
|
|
||||||
|
|
||||||
# https://nitter.net/igor_chubin/status/1557793569104183298
|
|
||||||
stackoverflow = pkgs.writers.writeDashBin "so" ''
|
|
||||||
IFS=+
|
|
||||||
${pkgs.curl}/bin/curl -sSL http://cht.sh/"$*"
|
|
||||||
'';
|
|
||||||
|
|
||||||
rofi-hass = pkgs.writers.writeBashBin "rofi-hass" ''
|
|
||||||
export PATH=${lib.makeBinPath [pkgs.home-assistant-cli pkgs.jq pkgs.util-linux pkgs.rofi pkgs.gnused pkgs.libnotify]}
|
|
||||||
json=$(hass-cli -o json state list 2>/dev/null)
|
|
||||||
idx=$(jq -r '.[] | [.entity_id, .state] | join(" ")' <<< "$json" | column -t | rofi -dmenu -i -markup-rows -format d)
|
|
||||||
item=$(jq -r '.[].entity_id' <<< "$json" | sed "''${idx}q;d")
|
|
||||||
itype=$(sed -r 's/\..+$//' <<< "$item")
|
|
||||||
|
|
||||||
case "$itype" in
|
|
||||||
light) hass-cli state toggle "$item" &>/dev/null ;;
|
|
||||||
scene) hass-cli service call --arguments entity_id="$item" scene.turn_on &>/dev/null ;;
|
|
||||||
*) notify-send "Error" "Event type '$itype' not implemented yet. Do you have time to file an issue or write a PR?" ;;
|
|
||||||
esac
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
// {
|
|
||||||
devour = pkgs.callPackage ../devour.nix {};
|
|
||||||
depp = pkgs.callPackage ../depp.nix {};
|
|
||||||
text2pdf = pkgs.callPackage ../text2pdf.nix {};
|
|
||||||
vimv = pkgs.callPackage ../vimv.nix {};
|
|
||||||
when = pkgs.callPackage ../when.nix {};
|
|
||||||
mahlzeit = pkgs.haskellPackages.callPackage ../mahlzeit.nix {};
|
|
||||||
inherit opustags;
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
{
|
|
||||||
lib,
|
|
||||||
writeShellScriptBin,
|
|
||||||
}: let
|
|
||||||
aliasFlag = name: value: "-c alias.${name}=${lib.escapeShellArg value}";
|
|
||||||
aliases = {
|
|
||||||
eroeffne = "init";
|
|
||||||
machnach = "clone";
|
|
||||||
zieh = "pull";
|
|
||||||
fueghinzu = "add";
|
|
||||||
drueck = "push";
|
|
||||||
pfusch = "push --force";
|
|
||||||
zweig = "branch";
|
|
||||||
verzweige = "branch";
|
|
||||||
uebergib = "commit";
|
|
||||||
erde = "rebase";
|
|
||||||
unterscheide = "diff";
|
|
||||||
vereinige = "merge";
|
|
||||||
bunkere = "stash";
|
|
||||||
markiere = "tag";
|
|
||||||
nimm = "checkout";
|
|
||||||
tagebuch = "log";
|
|
||||||
zustand = "status";
|
|
||||||
};
|
|
||||||
in
|
|
||||||
writeShellScriptBin "depp" ''
|
|
||||||
if [ $# -gt 0 ]; then
|
|
||||||
git ${
|
|
||||||
lib.concatStringsSep " " (lib.attrsets.mapAttrsToList aliasFlag aliases)
|
|
||||||
} "$@"
|
|
||||||
else
|
|
||||||
printf "${
|
|
||||||
lib.concatStringsSep "\n"
|
|
||||||
(lib.attrsets.mapAttrsToList (n: v: n + " " + v) aliases)
|
|
||||||
}\n"
|
|
||||||
fi
|
|
||||||
''
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
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
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# UI for connecting to bluetooth devices
|
|
||||||
set -efu
|
|
||||||
|
|
||||||
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
|
|
||||||
@@ -1,89 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# ref https://github.com/LukeSmithxyz/voidrice/blob/927a7c39c24272eeb6c7ca9e75a359314ad20025/.local/bin/displayselect
|
|
||||||
|
|
||||||
# A UI for detecting and selecting all displays. Probes xrandr for connected
|
|
||||||
# displays and lets user select one to use. User may also select "manual
|
|
||||||
# selection" which opens arandr.
|
|
||||||
|
|
||||||
query_direction() {
|
|
||||||
printf "left-of\\nright-of\\nabove\\nbelow"
|
|
||||||
}
|
|
||||||
|
|
||||||
twoscreen() { # If multi-monitor is selected and there are two screens.
|
|
||||||
|
|
||||||
mirror=$(printf "no\\nyes" | dmenu -i -p "Mirror displays?")
|
|
||||||
# Mirror displays using native resolution of external display and a scaled
|
|
||||||
# version for the internal display
|
|
||||||
if [ "$mirror" = "yes" ]; then
|
|
||||||
external=$(echo "$screens" | dmenu -i -p "Optimize resolution for")
|
|
||||||
internal=$(echo "$screens" | grep -v "$external")
|
|
||||||
|
|
||||||
res_external=$(xrandr --query | sed -n "/^$external/,/\+/p" | \
|
|
||||||
tail -n 1 | awk '{print $1}')
|
|
||||||
|
|
||||||
res_internal=$(xrandr --query | sed -n "/^$internal/,/\+/p" | \
|
|
||||||
tail -n 1 | awk '{print $1}')
|
|
||||||
|
|
||||||
res_ext_x=$(echo "$res_external" | sed 's/x.*//')
|
|
||||||
res_ext_y=$(echo "$res_external" | sed 's/.*x//')
|
|
||||||
res_int_x=$(echo "$res_internal" | sed 's/x.*//')
|
|
||||||
res_int_y=$(echo "$res_internal" | sed 's/.*x//')
|
|
||||||
|
|
||||||
scale_x=$(echo "$res_ext_x / $res_int_x" | bc -l)
|
|
||||||
scale_y=$(echo "$res_ext_y / $res_int_y" | bc -l)
|
|
||||||
|
|
||||||
xrandr --output "$external" --auto --scale 1.0x1.0 \
|
|
||||||
--output "$internal" --auto --same-as "$external" \
|
|
||||||
--scale "$scale_x"x"$scale_y"
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
primary=$(echo "$screens" | dmenu -i -p "Select primary display")
|
|
||||||
secondary=$(echo "$screens" | grep -v "$primary")
|
|
||||||
direction=$(query_direction | dmenu -i -p "What side of $primary should $secondary be on?")
|
|
||||||
xrandr --output "$primary" --auto --scale 1.0x1.0 --output "$secondary" --"$direction" "$primary" --auto --scale 1.0x1.0
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# If multi-monitor is selected and there are more than two screens.
|
|
||||||
morescreen() {
|
|
||||||
primary=$(echo "$screens" | dmenu -i -p "Select primary display:")
|
|
||||||
secondary=$(echo "$screens" | grep -v "$primary" | dmenu -i -p "Select secondary display:")
|
|
||||||
direction=$(query_direction | dmenu -i -p "What side of $primary should $secondary be on?")
|
|
||||||
tertiary=$(echo "$screens" | grep -v "$primary" | grep -v "$secondary" | dmenu -i -p "Select third display:")
|
|
||||||
xrandr --output "$primary" --auto --output "$secondary" --"$direction" "$primary" --auto --output "$tertiary" --"$(query_direction | grep -v "$direction")" "$primary" --auto
|
|
||||||
}
|
|
||||||
|
|
||||||
# Multi-monitor handler.
|
|
||||||
multimon() {
|
|
||||||
case "$(echo "$screens" | wc -l)" in
|
|
||||||
2) twoscreen ;;
|
|
||||||
*) morescreen ;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
# If only one output available or chosen.
|
|
||||||
onescreen() {
|
|
||||||
xrandr --output "$1" --auto --primary --scale 1.0x1.0 $(echo "$allposs" | grep -v "$1" | awk '{print "--output", $1, "--off"}' | paste -sd ' ')
|
|
||||||
}
|
|
||||||
|
|
||||||
# Get all possible displays
|
|
||||||
allposs=$(xrandr -q | grep "connected")
|
|
||||||
|
|
||||||
# Get all connected screens.
|
|
||||||
screens=$(echo "$allposs" | awk '/ connected/ {print $1}')
|
|
||||||
|
|
||||||
# If there's only one screen
|
|
||||||
[ "$(echo "$screens" | wc -l)" -lt 2 ] && {
|
|
||||||
onescreen "$screens"
|
|
||||||
notify-send "💻 Only one screen detected." "Using it in its optimal settings..."
|
|
||||||
exit
|
|
||||||
}
|
|
||||||
|
|
||||||
# Get user choice including multi-monitor and manual selection:
|
|
||||||
chosen=$(printf "%s\\nmulti-monitor\\nmanual selection" "$screens" | dmenu -i -p "Select display arangement:") &&
|
|
||||||
case "$chosen" in
|
|
||||||
"manual selection") arandr ; exit ;;
|
|
||||||
"multi-monitor") multimon ;;
|
|
||||||
*) onescreen "$chosen" ;;
|
|
||||||
esac
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
convert "$1" -define icon:auto-resize=64,48,32,16 "${2-favicon.ico}"
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
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
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# fzfmenu - fzf as dmenu replacement
|
|
||||||
# https://github.com/junegunn/fzf/wiki/Examples#fzf-as-dmenu-replacement
|
|
||||||
set -efu
|
|
||||||
|
|
||||||
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"
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
test "$#" -eq 2 || (
|
|
||||||
echo "usage: $0 <artist> <song>"
|
|
||||||
exit 1
|
|
||||||
)
|
|
||||||
|
|
||||||
normalize() {
|
|
||||||
tr -d -c '0-9A-Za-z ' | tr ' ' - | tr '[:upper:]' '[:lower:]'
|
|
||||||
}
|
|
||||||
|
|
||||||
ARTIST=$(echo "$1" | normalize | sed 's/./\U&/')
|
|
||||||
TITLE=$(echo "$2" | normalize)
|
|
||||||
GENIUS_URL="https://genius.com/$ARTIST-$TITLE-lyrics"
|
|
||||||
|
|
||||||
curl -s "$GENIUS_URL" \
|
|
||||||
| sed -ne '/class="lyrics"/,/<\/p>/p' \
|
|
||||||
| pandoc -f html -s -t plain \
|
|
||||||
| 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
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
{poetry2nix}:
|
|
||||||
poetry2nix.mkPoetryApplication {
|
|
||||||
projectDir = ./.;
|
|
||||||
}
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
from datetime import datetime
|
|
||||||
import click
|
|
||||||
from flatlib.datetime import Datetime
|
|
||||||
from flatlib.geopos import GeoPos
|
|
||||||
from flatlib.chart import Chart
|
|
||||||
import flatlib.const
|
|
||||||
|
|
||||||
sign_symbols = {
|
|
||||||
flatlib.const.ARIES: "♈",
|
|
||||||
flatlib.const.TAURUS: "♉",
|
|
||||||
flatlib.const.GEMINI: "♊",
|
|
||||||
flatlib.const.CANCER: "♋",
|
|
||||||
flatlib.const.LEO: "♌",
|
|
||||||
flatlib.const.VIRGO: "♍",
|
|
||||||
flatlib.const.LIBRA: "♎",
|
|
||||||
flatlib.const.SCORPIO: "♏",
|
|
||||||
flatlib.const.SAGITTARIUS: "♐",
|
|
||||||
flatlib.const.CAPRICORN: "♑",
|
|
||||||
flatlib.const.AQUARIUS: "♒",
|
|
||||||
flatlib.const.PISCES: "♓",
|
|
||||||
}
|
|
||||||
|
|
||||||
planet_symbols = {
|
|
||||||
flatlib.const.SUN: "☉",
|
|
||||||
flatlib.const.MOON: "☽",
|
|
||||||
flatlib.const.MERCURY: "☿",
|
|
||||||
flatlib.const.VENUS: "♀",
|
|
||||||
flatlib.const.MARS: "♂",
|
|
||||||
flatlib.const.JUPITER: "♃",
|
|
||||||
flatlib.const.SATURN: "♄",
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def convert_into_stupid_flatlib_format(dt):
|
|
||||||
return Datetime(dt.strftime("%Y/%m/%d"), dt.strftime("%H:%M"))
|
|
||||||
|
|
||||||
|
|
||||||
@click.command()
|
|
||||||
@click.option("--latitude", type=click.FLOAT, required=True)
|
|
||||||
@click.option("--longitude", type=click.FLOAT, required=True)
|
|
||||||
@click.option("--date", type=click.DateTime(), default=datetime.now())
|
|
||||||
def main(latitude: float, longitude: float, date: datetime):
|
|
||||||
flatlib_datetime = convert_into_stupid_flatlib_format(date)
|
|
||||||
position = GeoPos(latitude, longitude)
|
|
||||||
chart = Chart(flatlib_datetime, position)
|
|
||||||
for planet in planet_symbols.keys():
|
|
||||||
planet_position = chart.getObject(planet)
|
|
||||||
print(
|
|
||||||
planet_symbols[planet],
|
|
||||||
sign_symbols[planet_position.sign],
|
|
||||||
"℞" if planet_position.movement() == flatlib.const.RETROGRADE else "",
|
|
||||||
end="",
|
|
||||||
)
|
|
||||||
print()
|
|
||||||
81
packages/scripts/horoscope/poetry.lock
generated
81
packages/scripts/horoscope/poetry.lock
generated
@@ -1,81 +0,0 @@
|
|||||||
[[package]]
|
|
||||||
name = "click"
|
|
||||||
version = "8.1.3"
|
|
||||||
description = "Composable command line interface toolkit"
|
|
||||||
category = "main"
|
|
||||||
optional = false
|
|
||||||
python-versions = ">=3.7"
|
|
||||||
|
|
||||||
[package.dependencies]
|
|
||||||
colorama = {version = "*", markers = "platform_system == \"Windows\""}
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "colorama"
|
|
||||||
version = "0.4.5"
|
|
||||||
description = "Cross-platform colored terminal text."
|
|
||||||
category = "main"
|
|
||||||
optional = false
|
|
||||||
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*"
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "flatlib"
|
|
||||||
version = "0.2.3"
|
|
||||||
description = "Python library for Traditional Astrology"
|
|
||||||
category = "main"
|
|
||||||
optional = false
|
|
||||||
python-versions = "*"
|
|
||||||
|
|
||||||
[package.dependencies]
|
|
||||||
pyswisseph = "2.08.00-1"
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "numpy"
|
|
||||||
version = "1.23.1"
|
|
||||||
description = "NumPy is the fundamental package for array computing with Python."
|
|
||||||
category = "main"
|
|
||||||
optional = false
|
|
||||||
python-versions = ">=3.8"
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "pyswisseph"
|
|
||||||
version = "2.08.00-1"
|
|
||||||
description = "Python extension to the Swiss Ephemeris"
|
|
||||||
category = "main"
|
|
||||||
optional = false
|
|
||||||
python-versions = "*"
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "pytz"
|
|
||||||
version = "2021.3"
|
|
||||||
description = "World timezone definitions, modern and historical"
|
|
||||||
category = "main"
|
|
||||||
optional = false
|
|
||||||
python-versions = "*"
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "timezonefinder"
|
|
||||||
version = "5.2.0"
|
|
||||||
description = "fast python package for finding the timezone of any point on earth (coordinates) offline"
|
|
||||||
category = "main"
|
|
||||||
optional = false
|
|
||||||
python-versions = ">=3.6"
|
|
||||||
|
|
||||||
[package.dependencies]
|
|
||||||
numpy = ">=1.16"
|
|
||||||
|
|
||||||
[package.extras]
|
|
||||||
numba = ["numba (>=0.48)"]
|
|
||||||
|
|
||||||
[metadata]
|
|
||||||
lock-version = "1.1"
|
|
||||||
python-versions = "^3.8"
|
|
||||||
content-hash = "657742383232643f2fa13df5686de0cc79c624f9ae9bdb2f0fc96c7a94b5b8bf"
|
|
||||||
|
|
||||||
[metadata.files]
|
|
||||||
click = []
|
|
||||||
colorama = []
|
|
||||||
flatlib = []
|
|
||||||
numpy = []
|
|
||||||
pyswisseph = []
|
|
||||||
pytz = []
|
|
||||||
timezonefinder = []
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
[tool.poetry]
|
|
||||||
name = "horoscope"
|
|
||||||
version = "0.1.0"
|
|
||||||
description = ""
|
|
||||||
authors = ["Kierán Meinhardt <kmein@posteo.de>"]
|
|
||||||
|
|
||||||
[tool.poetry.dependencies]
|
|
||||||
python = "^3.8"
|
|
||||||
flatlib = "^0.2.3"
|
|
||||||
click = "^8.0.3"
|
|
||||||
timezonefinder = "^5.2.0"
|
|
||||||
pytz = "^2021.3"
|
|
||||||
|
|
||||||
[tool.poetry.scripts]
|
|
||||||
horoscope = "horoscope:main"
|
|
||||||
transits-current = "transits:current"
|
|
||||||
transits-forecast = "transits:forecast"
|
|
||||||
|
|
||||||
[build-system]
|
|
||||||
requires = ["poetry-core>=1.0.0"]
|
|
||||||
build-backend = "poetry.core.masonry.api"
|
|
||||||
@@ -1,181 +0,0 @@
|
|||||||
from flatlib import aspects, const
|
|
||||||
from flatlib.chart import Chart
|
|
||||||
from flatlib.datetime import Datetime
|
|
||||||
import pytz
|
|
||||||
from flatlib.geopos import GeoPos
|
|
||||||
import timezonefinder
|
|
||||||
import operator
|
|
||||||
import click
|
|
||||||
import itertools
|
|
||||||
from datetime import datetime, timedelta
|
|
||||||
|
|
||||||
tf = timezonefinder.TimezoneFinder()
|
|
||||||
|
|
||||||
planets = [
|
|
||||||
const.SUN,
|
|
||||||
const.MOON,
|
|
||||||
const.MERCURY,
|
|
||||||
const.VENUS,
|
|
||||||
const.MARS,
|
|
||||||
const.JUPITER,
|
|
||||||
const.SATURN,
|
|
||||||
const.URANUS,
|
|
||||||
const.NEPTUNE,
|
|
||||||
const.PLUTO,
|
|
||||||
]
|
|
||||||
|
|
||||||
planet_symbols = {
|
|
||||||
const.SUN: "☉",
|
|
||||||
const.MOON: "☽",
|
|
||||||
const.MERCURY: "☿",
|
|
||||||
const.VENUS: "♀",
|
|
||||||
const.MARS: "♂",
|
|
||||||
const.JUPITER: "♃",
|
|
||||||
const.SATURN: "♄",
|
|
||||||
const.URANUS: "♅",
|
|
||||||
const.NEPTUNE: "♆",
|
|
||||||
const.PLUTO: "⯓",
|
|
||||||
}
|
|
||||||
|
|
||||||
aspect_symbols = {
|
|
||||||
const.NO_ASPECT: " ",
|
|
||||||
const.CONJUNCTION: "☌",
|
|
||||||
const.SEXTILE: "⚹",
|
|
||||||
const.SQUARE: "□",
|
|
||||||
const.TRINE: "△",
|
|
||||||
const.OPPOSITION: "☍",
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def convert_into_stupid_flatlib_format(dt):
|
|
||||||
return Datetime(
|
|
||||||
dt.strftime("%Y/%m/%d"),
|
|
||||||
dt.strftime("%H:%M"),
|
|
||||||
dt.utcoffset().total_seconds() / 3600,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
here_latitude = 52.52
|
|
||||||
here_longitude = 13.4
|
|
||||||
|
|
||||||
|
|
||||||
def get_aspects(chart1, chart2, *, threshold):
|
|
||||||
for planet1 in chart1.objects:
|
|
||||||
for planet2 in chart2.objects:
|
|
||||||
aspect = aspects.getAspect(planet1, planet2, const.MAJOR_ASPECTS)
|
|
||||||
if aspect.exists() and aspect.orb <= threshold:
|
|
||||||
yield aspect
|
|
||||||
|
|
||||||
|
|
||||||
def get_chart(position, dt_naive):
|
|
||||||
timezone = pytz.timezone(tf.timezone_at(lat=position.lat, lng=position.lon))
|
|
||||||
dt_aware = timezone.localize(dt_naive)
|
|
||||||
return Chart(convert_into_stupid_flatlib_format(dt_aware), position, IDs=planets)
|
|
||||||
|
|
||||||
|
|
||||||
def show_aspect(aspect):
|
|
||||||
return " ".join(
|
|
||||||
[
|
|
||||||
planet_symbols[aspect.active.id],
|
|
||||||
aspect_symbols[aspect.type],
|
|
||||||
planet_symbols[aspect.passive.id],
|
|
||||||
]
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@click.command()
|
|
||||||
@click.option("--natal-latitude", type=click.FLOAT, default=here_latitude)
|
|
||||||
@click.option("--natal-longitude", type=click.FLOAT, default=here_longitude)
|
|
||||||
@click.option("--natal-date", type=click.DateTime(), default=datetime.now())
|
|
||||||
@click.option("--transit-latitude", type=click.FLOAT, default=here_latitude)
|
|
||||||
@click.option("--transit-longitude", type=click.FLOAT, default=here_longitude)
|
|
||||||
@click.option("--transit-date", type=click.DateTime(), default=datetime.now())
|
|
||||||
@click.option("--threshold", type=click.FLOAT, default=5)
|
|
||||||
def forecast(
|
|
||||||
natal_latitude: float,
|
|
||||||
natal_longitude: float,
|
|
||||||
natal_date: datetime,
|
|
||||||
transit_latitude: float,
|
|
||||||
transit_longitude: float,
|
|
||||||
transit_date: datetime,
|
|
||||||
threshold: float,
|
|
||||||
):
|
|
||||||
transit_position = GeoPos(transit_latitude, transit_longitude)
|
|
||||||
natal_position = GeoPos(natal_latitude, natal_longitude)
|
|
||||||
natal_chart = get_chart(natal_position, natal_date)
|
|
||||||
transit_chart = get_chart(transit_position, transit_date)
|
|
||||||
|
|
||||||
offset = 0
|
|
||||||
previous_aspects = set(
|
|
||||||
show_aspect(a)
|
|
||||||
for a in get_aspects(natal_chart, transit_chart, threshold=threshold)
|
|
||||||
)
|
|
||||||
while True:
|
|
||||||
then = transit_date + timedelta(minutes=offset)
|
|
||||||
current_chart = get_chart(transit_position, then)
|
|
||||||
current_aspects = set(
|
|
||||||
show_aspect(a)
|
|
||||||
for a in get_aspects(natal_chart, current_chart, threshold=threshold)
|
|
||||||
)
|
|
||||||
entered = current_aspects - previous_aspects
|
|
||||||
exited = previous_aspects - current_aspects
|
|
||||||
if entered or exited:
|
|
||||||
print(
|
|
||||||
then.strftime("%Y-%m-%d %H:%M"),
|
|
||||||
"".join([" | +" + a for a in entered] + [" | -" + a for a in exited]),
|
|
||||||
sep="",
|
|
||||||
)
|
|
||||||
previous_aspects = current_aspects
|
|
||||||
offset += 1
|
|
||||||
|
|
||||||
|
|
||||||
@click.command()
|
|
||||||
@click.option("--natal-latitude", type=click.FLOAT, default=here_latitude)
|
|
||||||
@click.option("--natal-longitude", type=click.FLOAT, default=here_longitude)
|
|
||||||
@click.option("--natal-date", "-D", type=click.DateTime(), default=datetime.now())
|
|
||||||
@click.option("--transit-latitude", type=click.FLOAT, default=here_latitude)
|
|
||||||
@click.option("--transit-longitude", type=click.FLOAT, default=here_longitude)
|
|
||||||
@click.option("--transit-date", "-d", type=click.DateTime(), default=datetime.now())
|
|
||||||
@click.option("--threshold", "-t", type=click.FLOAT, default=5)
|
|
||||||
def current(
|
|
||||||
natal_latitude: float,
|
|
||||||
natal_longitude: float,
|
|
||||||
natal_date: datetime,
|
|
||||||
transit_latitude: float,
|
|
||||||
transit_longitude: float,
|
|
||||||
transit_date: datetime,
|
|
||||||
threshold: float,
|
|
||||||
):
|
|
||||||
transit_position = GeoPos(transit_latitude, transit_longitude)
|
|
||||||
natal_position = GeoPos(natal_latitude, natal_longitude)
|
|
||||||
natal_chart = get_chart(natal_position, natal_date)
|
|
||||||
transit_chart = get_chart(transit_position, transit_date)
|
|
||||||
|
|
||||||
relevant_aspects = list(
|
|
||||||
get_aspects(natal_chart, transit_chart, threshold=threshold)
|
|
||||||
)
|
|
||||||
|
|
||||||
def aspect_switch_date(aspect, *, direction=1, threshold):
|
|
||||||
offset = 0
|
|
||||||
while True:
|
|
||||||
then = transit_date + direction * timedelta(days=offset)
|
|
||||||
current_chart = get_chart(transit_position, then)
|
|
||||||
aspects = [
|
|
||||||
show_aspect(a)
|
|
||||||
for a in get_aspects(natal_chart, current_chart, threshold=threshold)
|
|
||||||
]
|
|
||||||
if aspect not in aspects:
|
|
||||||
return then.date()
|
|
||||||
offset += 1
|
|
||||||
|
|
||||||
for aspect in sorted(relevant_aspects, key=operator.attrgetter("orb")):
|
|
||||||
aspect_string = show_aspect(aspect)
|
|
||||||
print(
|
|
||||||
aspect_switch_date(
|
|
||||||
aspect_string, direction=-1, threshold=threshold
|
|
||||||
).isoformat(),
|
|
||||||
aspect_switch_date(
|
|
||||||
aspect_string, direction=1, threshold=threshold
|
|
||||||
).isoformat(),
|
|
||||||
aspect_string,
|
|
||||||
)
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
{
|
|
||||||
writeShellScriptBin,
|
|
||||||
wget,
|
|
||||||
curl,
|
|
||||||
jq,
|
|
||||||
}:
|
|
||||||
writeShellScriptBin "instaget" ''
|
|
||||||
for url in "$@"; do
|
|
||||||
json="$(${curl}/bin/curl -s "$url" \
|
|
||||||
| grep display_url \
|
|
||||||
| grep -o '{.*}')"
|
|
||||||
|
|
||||||
echo "$json"
|
|
||||||
| ${jq}/bin/jq -r '
|
|
||||||
.entry_data.PostPage
|
|
||||||
| .[].graphql.shortcode_media.edge_sidecar_to_children.edges
|
|
||||||
| .[].node.display_url' \
|
|
||||||
| xargs ${wget}/bin/wget
|
|
||||||
|
|
||||||
echo "$json"
|
|
||||||
| ${jq}/bin/jq -r '
|
|
||||||
.entry_data.PostPage
|
|
||||||
| .[].graphql.shortcode_media.display_url' \
|
|
||||||
| xargs ${wget}/bin/wget
|
|
||||||
done
|
|
||||||
''
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
for url in "$@"; do
|
|
||||||
json="$(curl -s "$url" \
|
|
||||||
| grep display_url \
|
|
||||||
| grep -o '{.*}')"
|
|
||||||
|
|
||||||
echo "$json" \
|
|
||||||
| jq -r '
|
|
||||||
.entry_data.PostPage
|
|
||||||
| .[].graphql.shortcode_media.edge_sidecar_to_children.edges
|
|
||||||
| .[].node.display_url' \
|
|
||||||
| xargs wget
|
|
||||||
|
|
||||||
echo "$json" \
|
|
||||||
| jq -r '
|
|
||||||
.entry_data.PostPage
|
|
||||||
| .[].graphql.shortcode_media.display_url' \
|
|
||||||
| xargs wget
|
|
||||||
done
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
curl -sSL 'https://kalbu.vdu.lt/wp-admin/admin-ajax.php' -F action=text_accents -F body="$(cat)" \
|
|
||||||
| jq -r .message \
|
|
||||||
| if [ "$1" = "--json" ]
|
|
||||||
then jq .textParts
|
|
||||||
else jq -r '
|
|
||||||
.textParts
|
|
||||||
| map(if has("accented") then .accented else .string end)
|
|
||||||
| join("")
|
|
||||||
'
|
|
||||||
fi
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
set -efu
|
|
||||||
|
|
||||||
input="$*"
|
|
||||||
|
|
||||||
if echo "$input" | grep '^\w\+$'; then
|
|
||||||
curl -sSL "https://lsj.gr/wiki/$input" | pup '#mw-content-text'
|
|
||||||
else
|
|
||||||
curl -sSL "https://lsj.gr/wiki/$(echo "$input" | betacode)" \
|
|
||||||
| pup ':parent-of(#English_(LSJ)) + p' \
|
|
||||||
| sed 's/<span class="sense">/<p>&/g'
|
|
||||||
fi \
|
|
||||||
| pandoc --standalone --variable=title:"$input" --from=html --to=man \
|
|
||||||
| sed 's/\s\+\([:.,;]\)/\1/g;s/\s\+/ /g' \
|
|
||||||
| man --local-file --pager="bat -p" -
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
ROW=$(curl -Ls http://kmein.github.io/logotheca/quotes.csv | shuf -n1)
|
|
||||||
|
|
||||||
(
|
|
||||||
printf '%s\n\n— %s: _%s_, %s\n' \
|
|
||||||
"$(echo "$ROW" | xsv select 4)" \
|
|
||||||
"$(echo "$ROW" | xsv select 1)" \
|
|
||||||
"$(echo "$ROW" | xsv select 2)" \
|
|
||||||
"$(echo "$ROW" | xsv select 3 | tr : ,)"
|
|
||||||
) | sed 's/ | /\n/g;s/ || /\n\n/g;s/"\(.*\)"/\1/'
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
if [ "$#" -eq 1 ]; then
|
|
||||||
man_entry="$1"
|
|
||||||
elif [ $# -eq 2 ]; then
|
|
||||||
man_page="$1"
|
|
||||||
man_entry="$2"
|
|
||||||
else
|
|
||||||
echo >/dev/stderr "Usage: $0 [MAN-PAGE] ENTRY"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
man "${man_page:-}" "$man_entry" | ps2pdf - "$man_entry.pdf"
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# https://www.youtube.com/watch?v=8E8sUNHdzG8
|
|
||||||
man -k . \
|
|
||||||
| cut -d" " -f1,2 \
|
|
||||||
| dmenu -l 5 \
|
|
||||||
| sed 's/\(.*\) (\(.*\))/\2 \1/' \
|
|
||||||
| xargs -r man -t \
|
|
||||||
| zathura -
|
|
||||||
@@ -1,76 +0,0 @@
|
|||||||
#! /bin/sh
|
|
||||||
# usage: meteo --list
|
|
||||||
# usage: meteo --update
|
|
||||||
# usage: meteo STATION
|
|
||||||
set -efu
|
|
||||||
|
|
||||||
# TODO XDG
|
|
||||||
CONFIG_DIR=$HOME/.config/wetter
|
|
||||||
STATIONS_FILE=$CONFIG_DIR/stations.json
|
|
||||||
|
|
||||||
case ${1-} in
|
|
||||||
--list)
|
|
||||||
sed -n 's/^\s*\(--[^)]\+\))$/\1/p' "$0"
|
|
||||||
jq -r -n \
|
|
||||||
--slurpfile stations_file "$STATIONS_FILE" \
|
|
||||||
'
|
|
||||||
$stations_file[0] as $known_stations |
|
|
||||||
|
|
||||||
$known_stations | keys[]
|
|
||||||
'
|
|
||||||
exit
|
|
||||||
;;
|
|
||||||
--update)
|
|
||||||
mkdir -p "$(dirname "$STATIONS_FILE")"
|
|
||||||
exec >"$STATIONS_FILE"
|
|
||||||
|
|
||||||
curl -fsSL http://wetterstationen.meteomedia.de/ |
|
|
||||||
jq -Rrs '
|
|
||||||
def decodeHTML:
|
|
||||||
gsub("ä";"ä") |
|
|
||||||
gsub("ö";"ö") |
|
|
||||||
gsub("ü";"ü") |
|
|
||||||
gsub("Ä";"Ä") |
|
|
||||||
gsub("Ö";"Ö") |
|
|
||||||
gsub("Ü";"Ü") |
|
|
||||||
gsub("ß";"ß")
|
|
||||||
;
|
|
||||||
[
|
|
||||||
match(".*<option value=\"/\\?map=Deutschland&station=(?<station>[0-9]+)\">(?<name>[^<]+)</option>";"g")
|
|
||||||
.captures |
|
|
||||||
map({"\(.name)":(.string)}) |
|
|
||||||
add |
|
|
||||||
{"\(.name|decodeHTML)":(.station|tonumber)}
|
|
||||||
] |
|
|
||||||
add
|
|
||||||
'
|
|
||||||
exit
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# set -x
|
|
||||||
|
|
||||||
station=${1-103840}
|
|
||||||
station=$(jq -e -n \
|
|
||||||
--arg station "$station" \
|
|
||||||
--slurpfile stations_file "$STATIONS_FILE" \
|
|
||||||
'
|
|
||||||
$stations_file[0] as $known_stations |
|
|
||||||
|
|
||||||
$station |
|
|
||||||
if test("^[0-9]+$") then
|
|
||||||
tonumber
|
|
||||||
else
|
|
||||||
$known_stations[.]
|
|
||||||
end
|
|
||||||
')
|
|
||||||
cache="/tmp/${LOGNAME}_wetter_$station.png"
|
|
||||||
curl -sSL \
|
|
||||||
"http://wetterstationen.meteomedia.de/messnetz/vorhersagegrafik/$station.png" \
|
|
||||||
-o "$cache"
|
|
||||||
|
|
||||||
if window_id=$(xdotool search --name "^nsxiv - $cache$"); then
|
|
||||||
xdotool key --window "$window_id" r
|
|
||||||
else
|
|
||||||
nsxiv "$cache" &
|
|
||||||
fi
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
#! /bin/sh
|
|
||||||
set -efu
|
|
||||||
exec curl -fSs --unix-socket /tmp/much.api.sock http://localhost/current/query
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
nix-shell -p "$1" --run "${2:-$1}"
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
{
|
|
||||||
lib,
|
|
||||||
fetchFromGitHub,
|
|
||||||
stdenv,
|
|
||||||
fzf,
|
|
||||||
}:
|
|
||||||
stdenv.mkDerivation rec {
|
|
||||||
name = "nav";
|
|
||||||
version = "8da22b1";
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "huntrar";
|
|
||||||
repo = name;
|
|
||||||
rev = version;
|
|
||||||
sha256 = "0aw10495901dagyfxn2pj6nh3nl1xgi5p57mwgkgn9g5hi66xa87";
|
|
||||||
};
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out/bin/
|
|
||||||
install nav $out/bin/
|
|
||||||
'';
|
|
||||||
propagatedBuildInputs = [fzf];
|
|
||||||
meta = {
|
|
||||||
maintainer = [lib.maintainers.kmein];
|
|
||||||
description = "JSON data structure navigator";
|
|
||||||
homepage = "https://github.com/huntrar/nav";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
random_mac() {
|
|
||||||
openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'
|
|
||||||
}
|
|
||||||
|
|
||||||
change_mac() {
|
|
||||||
old_mac="$(ip -j link show "$interface" | jq -r '.[].address')"
|
|
||||||
new_mac="$(random_mac)"
|
|
||||||
ip link set "$interface" address "$new_mac" 2>/dev/null && echo "$old_mac -> $new_mac"
|
|
||||||
}
|
|
||||||
|
|
||||||
interface="${1:-wlp3s0}"
|
|
||||||
ip link set "$interface" down
|
|
||||||
until change_mac; do :; done
|
|
||||||
ip link set "$interface" up
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
nix-prefetch-git "$@" 2> /dev/null \
|
|
||||||
| jq -r '"rev = \"\(.rev)\";\nsha256 = \"\(.sha256)\";"'
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
if [ "$#" -eq 1 ] && (echo "$1" | grep -Eq '[0-9]+\.[0-9]+'); then
|
|
||||||
curl -Gs http://www.perseus.tufts.edu/hopper/CTS \
|
|
||||||
-d request=GetPassage \
|
|
||||||
-d "urn=urn:cts:greekLit:tlg0012.tlg002:$1" \
|
|
||||||
| xmlstarlet sel -t -v 'cts:GetPassage//tei:div'
|
|
||||||
else
|
|
||||||
echo you must supply BOOK.VERSE
|
|
||||||
fi
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
set -efu
|
|
||||||
|
|
||||||
cache_file=/tmp/rfc-index.txt
|
|
||||||
|
|
||||||
fetch_index() {
|
|
||||||
if [ -f "$cache_file" ]
|
|
||||||
then cat "$cache_file"
|
|
||||||
else curl -sSL https://tools.ietf.org/rfc/index | tee "$cache_file"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
rfc_list="$(fetch_index \
|
|
||||||
| pup 'pre text{}' \
|
|
||||||
| awk '$0 != "" {printf "%s",$0} $0 == "" {printf "\n"}' \
|
|
||||||
| sed 's/\s\+/ /g' \
|
|
||||||
| sed 'n;d' \
|
|
||||||
| grep '^RFC[[:digit:]]' \
|
|
||||||
| sed 's/RFC\([[:digit:]]\+\)/\1\t/;s/\. .*//'
|
|
||||||
)"
|
|
||||||
|
|
||||||
selection="$(echo "$rfc_list" | fzf | awk '{print $1}')"
|
|
||||||
|
|
||||||
curl -sSL "https://tools.ietf.org/rfc/rfc$selection.txt" | less
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# ref https://gitlab.com/dwt1/dotfiles/-/blob/master/.dmenu/dmenu-scrot.sh
|
|
||||||
|
|
||||||
APP_NAME="📸 Scrot"
|
|
||||||
IMG_PATH="$HOME/Downloads/Screenshots"
|
|
||||||
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
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user