mirror of
https://github.com/kmein/niveum
synced 2026-03-21 12:21:08 +01:00
Compare commits
35 Commits
c1f013fc2f
...
mympd
| Author | SHA1 | Date | |
|---|---|---|---|
| d06d0a9de4 | |||
| d4e82500ae | |||
| 6aa9be6f70 | |||
| 4e362678ca | |||
| a2081dece4 | |||
| 98cf188a17 | |||
| 4932c7c08a | |||
| c8a6991f09 | |||
| 5d3c9a67ab | |||
|
|
659a888c3d | ||
| 26908b03a3 | |||
| feccea5234 | |||
| 8ffb0bd245 | |||
| c1b777b689 | |||
| e85a8f7634 | |||
| 25bc6f573c | |||
| 4b5915354b | |||
| 43ab6b3210 | |||
| e08eb0e970 | |||
| 012d78cc0e | |||
|
|
62f52922b8 | ||
| 28d359c73b | |||
| 8830147359 | |||
| e9adccacd9 | |||
|
|
588ec3d180 | ||
| 6ea8500818 | |||
| bf6c82a11d | |||
| 9c68ff20bc | |||
| 2565bfbc27 | |||
| a4d002e293 | |||
| 730070bc9d | |||
| 6f1f1887b9 | |||
|
|
68f8bb06f4 | ||
| 7afe712c27 | |||
| 1946a30b2f |
58
ci.nix
58
ci.nix
@@ -19,17 +19,18 @@
|
||||
}
|
||||
'';
|
||||
nixPath = nixpkgs.lib.concatStringsSep ":" ([
|
||||
"niveum=${toString ./.}"
|
||||
"nixos-config=${toString ./.}/systems/${name}/configuration.nix"
|
||||
"system-secrets=${systemSecrets}"
|
||||
"secrets=${sharedSecrets}"
|
||||
]
|
||||
++ nixpkgs.lib.mapAttrsToList (name: value: "${name}=${value}") inputs);
|
||||
"niveum=${toString ./.}"
|
||||
"nixos-config=${toString ./.}/systems/${name}/configuration.nix"
|
||||
"system-secrets=${systemSecrets}"
|
||||
"secrets=${sharedSecrets}"
|
||||
]
|
||||
++ nixpkgs.lib.mapAttrsToList (name: value: "${name}=${value}") inputs);
|
||||
# cd ~/.password-store/shared && find * -type f | sed 's/.gpg$//'
|
||||
sharedSecrets = ensureFiles [
|
||||
"di.fm/key"
|
||||
"eduroam/identity"
|
||||
"eduroam/password"
|
||||
"hass/token"
|
||||
"mail/cock"
|
||||
"mail/fastmail"
|
||||
"mail/gmail/amroplay"
|
||||
@@ -52,29 +53,30 @@
|
||||
zaatar = ensureFiles (["moodle.token" "telegram/moodle-dl.token" "mpd-web.key"] ++ basic);
|
||||
kabsa = ensureFiles basic;
|
||||
manakish = ensureFiles basic;
|
||||
tahina = ensureFiles basic;
|
||||
makanek = ensureFiles ([
|
||||
"irc/retiolum"
|
||||
"irc/hackint"
|
||||
"irc/libera"
|
||||
"irc/oftc"
|
||||
"matrix/nibbana"
|
||||
"maxmind/license.key"
|
||||
"moodle-dl/faye.token"
|
||||
"nextcloud/admin"
|
||||
"nextcloud/database"
|
||||
"telegram/nachtischsatan.token"
|
||||
"telegram/reverse.token"
|
||||
"telegram/odyssey.token"
|
||||
"telegram/betacode.token"
|
||||
"telegram/moodle-dl.token"
|
||||
"telegram/proverb.token"
|
||||
"telegram/menstruation.token"
|
||||
"telegram/cool_village.token"
|
||||
"telegram/kmein.token"
|
||||
"telegram/prometheus.token"
|
||||
"weechat/relay"
|
||||
]
|
||||
++ basic);
|
||||
"irc/retiolum"
|
||||
"irc/hackint"
|
||||
"irc/libera"
|
||||
"irc/oftc"
|
||||
"matrix/nibbana"
|
||||
"maxmind/license.key"
|
||||
"moodle-dl/faye.token"
|
||||
"nextcloud/admin"
|
||||
"nextcloud/database"
|
||||
"telegram/nachtischsatan.token"
|
||||
"telegram/reverse.token"
|
||||
"telegram/odyssey.token"
|
||||
"telegram/betacode.token"
|
||||
"telegram/moodle-dl.token"
|
||||
"telegram/proverb.token"
|
||||
"telegram/menstruation.token"
|
||||
"telegram/cool_village.token"
|
||||
"telegram/kmein.token"
|
||||
"telegram/prometheus.token"
|
||||
"weechat/relay"
|
||||
]
|
||||
++ basic);
|
||||
}
|
||||
.${name};
|
||||
in
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
programs.chromium = {
|
||||
enable = true;
|
||||
extensions = [
|
||||
"nngceckbapebfimnlniiiahkandclblb" # BitWarden
|
||||
# "ihlenndgcmojhcghmfjfneahoeklbjjh" # cVim
|
||||
# "fpnmgdkabkmnadcjpehmlllkndpkmiak" # Wayback Machine
|
||||
"cjpalhdlnbpafiamejdnhcphjbkeiagm" # uBlock Origin
|
||||
"khncfooichmfjbepaaaebmommgaepoid" # Remove YouTube Recommended Videos
|
||||
"pjjgklgkfeoeiebjogplpnibpfnffkng" # undistracted
|
||||
"nhdogjmejiglipccpnnnanhbledajbpd" # vuejs devtools
|
||||
];
|
||||
};
|
||||
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
}: let
|
||||
inherit (import <niveum/lib>) tmpfilesConfig;
|
||||
in {
|
||||
imports = [
|
||||
<niveum/modules/dropbox.nix>
|
||||
];
|
||||
@@ -12,13 +14,35 @@
|
||||
dropbox.enable = false;
|
||||
};
|
||||
|
||||
system.activationScripts.home-symlinks = ''
|
||||
ln -sfn ${config.users.users.me.home}/cloud/syncthing/common/mahlzeit ${config.users.users.me.home}/mahlzeit
|
||||
ln -sfn ${config.users.users.me.home}/cloud/Seafile/Wiki ${config.users.users.me.home}/notes
|
||||
ln -sfn ${config.users.users.me.home}/cloud/Seafile/Uni ${config.users.users.me.home}/uni
|
||||
'';
|
||||
systemd.tmpfiles.rules = map tmpfilesConfig [
|
||||
{
|
||||
type = "L+";
|
||||
user = config.users.users.me.name;
|
||||
group = "users";
|
||||
mode = "0755";
|
||||
argument = "${config.users.users.me.home}/cloud/Seafile/Wiki";
|
||||
path = "${config.users.users.me.home}/notes";
|
||||
}
|
||||
{
|
||||
type = "L+";
|
||||
user = config.users.users.me.name;
|
||||
group = "users";
|
||||
mode = "0755";
|
||||
argument = "${config.users.users.me.home}/cloud/Seafile/Uni";
|
||||
path = "${config.users.users.me.home}/uni";
|
||||
}
|
||||
{
|
||||
type = "L+";
|
||||
user = config.users.users.me.name;
|
||||
group = "users";
|
||||
mode = "0755";
|
||||
argument = "${config.users.users.me.home}/cloud/syncthing/common/mahlzeit";
|
||||
path = "${config.users.users.me.home}/mahlzeit";
|
||||
}
|
||||
];
|
||||
|
||||
home-manager.users.me = {
|
||||
services.gnome-keyring.enable = true;
|
||||
services.nextcloud-client = {
|
||||
enable = true;
|
||||
startInBackground = true;
|
||||
|
||||
@@ -111,6 +111,10 @@ in {
|
||||
take = pkgs.writers.writeDash "take" ''
|
||||
mkdir "$1" && cd "$1"
|
||||
'';
|
||||
cdt = pkgs.writers.writeDash "cdt" ''
|
||||
cd "$(mktemp -d)"
|
||||
pwd
|
||||
'';
|
||||
swallow = command: "${pkgs.scripts.swallow}/bin/swallow ${command}";
|
||||
in {
|
||||
"ß" = "${pkgs.utillinux}/bin/setsid";
|
||||
@@ -131,6 +135,8 @@ in {
|
||||
rm = "rm --interactive";
|
||||
s = "${pkgs.systemd}/bin/systemctl";
|
||||
take = "source ${take}";
|
||||
cdt = "source ${cdt}";
|
||||
vit = "$EDITOR $(mktemp)";
|
||||
tmux = "${pkgs.tmux}/bin/tmux -2";
|
||||
sxiv = swallow "${pkgs.sxiv}/bin/sxiv";
|
||||
zathura = swallow "${pkgs.zathura}/bin/zathura";
|
||||
@@ -181,7 +187,7 @@ in {
|
||||
|
||||
environment.systemPackages = [
|
||||
pkgs.gnupg
|
||||
(pkgs.pass.withExtensions (e: [e.pass-otp]))
|
||||
(pkgs.pass.withExtensions (e: [e.pass-otp e.pass-import e.pass-genphrase]))
|
||||
];
|
||||
}
|
||||
{
|
||||
@@ -194,11 +200,12 @@ in {
|
||||
};
|
||||
}
|
||||
{
|
||||
networking.hosts = lib.mapAttrs' (name: address: {
|
||||
name = address;
|
||||
value = ["${name}.local"];
|
||||
})
|
||||
localAddresses;
|
||||
networking.hosts =
|
||||
lib.mapAttrs' (name: address: {
|
||||
name = address;
|
||||
value = ["${name}.local"];
|
||||
})
|
||||
localAddresses;
|
||||
}
|
||||
./alacritty.nix
|
||||
./backup.nix
|
||||
@@ -255,5 +262,6 @@ in {
|
||||
./vscode.nix
|
||||
./watson.nix
|
||||
./zsh.nix
|
||||
./tor.nix
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1,42 +1,53 @@
|
||||
{pkgs, ...}: {
|
||||
nixpkgs.config.joypixels.acceptLicense = true;
|
||||
|
||||
fonts = {
|
||||
enableDefaultFonts = true;
|
||||
fontDir.enable = true;
|
||||
fonts = with pkgs; [
|
||||
alegreya
|
||||
alegreya-sans
|
||||
amiri
|
||||
cantarell-fonts
|
||||
charis-sil
|
||||
corefonts
|
||||
crimson
|
||||
eb-garamond
|
||||
etBook
|
||||
fira
|
||||
font-awesome-ttf
|
||||
gentium
|
||||
gfs-fonts
|
||||
gyre-fonts
|
||||
ia-writer-duospace
|
||||
ibm-plex
|
||||
inconsolata
|
||||
iosevka
|
||||
libertine
|
||||
jetbrains-mono
|
||||
joypixels
|
||||
libertinus
|
||||
libre-bodoni
|
||||
lmodern
|
||||
merriweather
|
||||
noto-fonts
|
||||
noto-fonts-cjk
|
||||
noto-fonts-emoji
|
||||
ocr-a
|
||||
roboto
|
||||
roboto-mono
|
||||
roboto-slab
|
||||
scheherazade-new
|
||||
source-code-pro
|
||||
source-serif-pro
|
||||
source-sans-pro
|
||||
ubuntu_font_family
|
||||
gfs-fonts
|
||||
jetbrains-mono
|
||||
twemoji-color-font
|
||||
joypixels
|
||||
source-serif-pro
|
||||
theano
|
||||
tocharian-font
|
||||
];
|
||||
fontconfig.defaultFonts = {
|
||||
monospace = ["JetBrains Mono" "JoyPixels"];
|
||||
serif = ["Roboto Slab"];
|
||||
sansSerif = ["Roboto" "Noto Sans"];
|
||||
emoji = ["JoyPixels"];
|
||||
vistafonts
|
||||
vollkorn
|
||||
zilla-slab
|
||||
]; # google-fonts league-of-moveable-type
|
||||
fontconfig.defaultFonts = let
|
||||
emojiFont = "JoyPixels";
|
||||
in {
|
||||
monospace = ["JetBrains Mono" emojiFont];
|
||||
serif = ["Merriweather"];
|
||||
sansSerif = ["Cantarell" emojiFont];
|
||||
emoji = [emojiFont];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ in {
|
||||
pkgs.gitAndTools.gh
|
||||
pkgs.gitAndTools.git-extras
|
||||
pkgs.gitAndTools.git-trim
|
||||
pkgs.gitAndTools.git-absorb
|
||||
pkgs.gitstats
|
||||
pkgs.patch
|
||||
pkgs.patchutils
|
||||
|
||||
@@ -18,6 +18,7 @@ in {
|
||||
programs.mpv = {
|
||||
enable = true;
|
||||
config = {
|
||||
ytdl-format = "bestvideo[height<=?720][fps<=?30][vcodec!=?vp9]+bestaudio/best";
|
||||
ytdl-raw-options = lib.concatStringsSep "," [''sub-lang="de,en"'' "write-sub=" "write-auto-sub="];
|
||||
screenshot-template = "%F-%wH%wM%wS-%#04n";
|
||||
};
|
||||
|
||||
@@ -191,14 +191,14 @@ in {
|
||||
# set accordingly: postponed trash record
|
||||
${
|
||||
lib.concatStringsSep "\n\n" (lib.mapAttrsToList (name: account: let
|
||||
imapRoot = "imaps://${account.user}@${account.imap}";
|
||||
in ''
|
||||
account-hook ${account.user}@${account.imap} 'set imap_user="${account.user}" imap_pass="${account.password}"'
|
||||
account-hook ${account.user}@${account.smtp} 'set smtp_user="${account.user}" smtp_pass="${account.password}"'
|
||||
folder-hook ${account.user}@${account.imap} 'set smtp_url="${account.smtpSettings "${account.user}@${account.smtp}"}" from="${account.address}" record="${imapRoot}/${account.folders.sent}" postponed="${imapRoot}/${account.folders.drafts}" trash="${imapRoot}/${account.folders.trash}"'
|
||||
named-mailboxes "${name}←" "${imapRoot}" "${name}→" "${imapRoot}/${account.folders.sent}"
|
||||
'')
|
||||
accounts)
|
||||
imapRoot = "imaps://${account.user}@${account.imap}";
|
||||
in ''
|
||||
account-hook ${account.user}@${account.imap} 'set imap_user="${account.user}" imap_pass="${account.password}"'
|
||||
account-hook ${account.user}@${account.smtp} 'set smtp_user="${account.user}" smtp_pass="${account.password}"'
|
||||
folder-hook ${account.user}@${account.imap} 'set smtp_url="${account.smtpSettings "${account.user}@${account.smtp}"}" from="${account.address}" record="${imapRoot}/${account.folders.sent}" postponed="${imapRoot}/${account.folders.drafts}" trash="${imapRoot}/${account.folders.trash}"'
|
||||
named-mailboxes "${name}←" "${imapRoot}" "${name}→" "${imapRoot}/${account.folders.sent}"
|
||||
'')
|
||||
accounts)
|
||||
}
|
||||
''
|
||||
}
|
||||
|
||||
@@ -23,15 +23,15 @@
|
||||
cslDirectory = pkgs.linkFarm "citation-styles" [
|
||||
(zoteroStyle {
|
||||
name = "chicago-author-date-de";
|
||||
sha256 = "0fz0xn46rkciblr34a7x2v60j0lbq9l3fmzi43iphph27m0czn6s";
|
||||
sha256 = "sha256-ddMYk4A9DJQhx9ldkmF7PhwKuc7wUSr26uHHGAze9Ps=";
|
||||
})
|
||||
(zoteroStyle {
|
||||
name = "din-1505-2";
|
||||
sha256 = "1pvy1b7qm13mnph7z365rrz1j082bl2y8ih73rhzd0zd6dz1jyjq";
|
||||
sha256 = "sha256-bXZbB850fek8J6wMVFL32ndI7F4wiKKr1qUC71ezreE=";
|
||||
})
|
||||
(zoteroStyle {
|
||||
name = "apa";
|
||||
sha256 = "1878vxp0y0h05yzaghnd51n981623mxskw3lsdyzmffqhihvv111";
|
||||
sha256 = "sha256-yq4fW6hQknycLjaj5fPbXLrQlGBp5myXiOSHBU90jEc=";
|
||||
})
|
||||
];
|
||||
|
||||
@@ -121,6 +121,7 @@ in {
|
||||
xorg.xkill # kill by clicking
|
||||
audacity
|
||||
calibre
|
||||
electrum
|
||||
inkscape
|
||||
astrolog
|
||||
anki # flashcards
|
||||
@@ -160,7 +161,7 @@ in {
|
||||
scripts.vimv
|
||||
scripts.swallow # window swallowing
|
||||
scripts.literature-quote
|
||||
scripts.nav # json navigation
|
||||
jless # less(1) for json
|
||||
scripts.notetags
|
||||
scripts.booksplit
|
||||
scripts.dmenurandr
|
||||
@@ -260,6 +261,11 @@ in {
|
||||
binutils # for strip, ld, ...
|
||||
# nightly.rust
|
||||
shellcheck
|
||||
|
||||
(pkgs.writers.writeDashBin "hass-cli" ''
|
||||
HASS_SERVER=http://zaatar.r:8123 HASS_TOKEN=${lib.strings.fileContents <secrets/hass/token>} exec ${pkgs.home-assistant-cli}/bin/hass-cli "$@"
|
||||
'')
|
||||
scripts.rofi-hass
|
||||
];
|
||||
|
||||
home-manager.users.me.xdg.configFile."pycodestyle".text = ''
|
||||
|
||||
@@ -29,6 +29,11 @@ in {
|
||||
user = "root";
|
||||
port = sshPort;
|
||||
};
|
||||
tahina = {
|
||||
hostname = "tahina.r";
|
||||
user = "root";
|
||||
port = sshPort;
|
||||
};
|
||||
manakish = {
|
||||
hostname = "manakish.r";
|
||||
user = "kfm";
|
||||
@@ -52,6 +57,10 @@ in {
|
||||
hostname = "135.181.85.233";
|
||||
user = "root";
|
||||
};
|
||||
oracle = {
|
||||
hostname = "130.61.171.199";
|
||||
user = "ubuntu";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -275,24 +275,24 @@
|
||||
'';
|
||||
in {
|
||||
environment.etc.stardict.source = toString (makeStardictDataDir ({
|
||||
Crum = pkgs.fetchzip {
|
||||
url = "http://download.huzheng.org/misc/stardict-Coptic-English_all_dialects-2.4.2.tar.bz2";
|
||||
sha256 = "1fi281mb9yzv40wjsdapi8fzpa7x2yscz582lv2qnss9g8zzzzr9";
|
||||
};
|
||||
SmithBiographyMythology = pkgs.fetchzip {
|
||||
url = "https://github.com/latin-dict/Smith1873/releases/download/v1.0/Smith1873-stardict.zip";
|
||||
sha256 = "01h5fxacp2m60xir8kzslkfy772vs3vmz07zhdwfhcwdaxif2af2";
|
||||
};
|
||||
SmithAntiquities = pkgs.fetchzip {
|
||||
url = "https://github.com/latin-dict/Smith1890/releases/download/v1.0/Smith1890-stardict.zip";
|
||||
sha256 = "0vpsv62p2lrzmgys4d1swpnc6lqhdi7rxwkj2ngy3lz5dk3fysyb";
|
||||
};
|
||||
}
|
||||
// dictionaries.classics
|
||||
// dictionaries.sanskrit
|
||||
// dictionaries.oed
|
||||
// dictionaries.russian
|
||||
// dictionaries.englishGerman));
|
||||
Crum = pkgs.fetchzip {
|
||||
url = "http://download.huzheng.org/misc/stardict-Coptic-English_all_dialects-2.4.2.tar.bz2";
|
||||
sha256 = "1fi281mb9yzv40wjsdapi8fzpa7x2yscz582lv2qnss9g8zzzzr9";
|
||||
};
|
||||
SmithBiographyMythology = pkgs.fetchzip {
|
||||
url = "https://github.com/latin-dict/Smith1873/releases/download/v1.0/Smith1873-stardict.zip";
|
||||
sha256 = "01h5fxacp2m60xir8kzslkfy772vs3vmz07zhdwfhcwdaxif2af2";
|
||||
};
|
||||
SmithAntiquities = pkgs.fetchzip {
|
||||
url = "https://github.com/latin-dict/Smith1890/releases/download/v1.0/Smith1890-stardict.zip";
|
||||
sha256 = "0vpsv62p2lrzmgys4d1swpnc6lqhdi7rxwkj2ngy3lz5dk3fysyb";
|
||||
};
|
||||
}
|
||||
// dictionaries.classics
|
||||
// dictionaries.sanskrit
|
||||
// dictionaries.oed
|
||||
// dictionaries.russian
|
||||
// dictionaries.englishGerman));
|
||||
|
||||
environment.systemPackages = [
|
||||
pkgs.goldendict
|
||||
|
||||
@@ -18,50 +18,49 @@ in {
|
||||
environment.systemPackages = [pkgs.sxiv];
|
||||
|
||||
# TODO fix
|
||||
home-manager.users.me.xdg.configFile."sxiv/exec/key-handler".source =
|
||||
pkgs.writers.writeDash "key-handler" ''
|
||||
PATH=$PATH:${
|
||||
lib.makeBinPath [
|
||||
pkgs.gnused
|
||||
pkgs.gawk
|
||||
pkgs.dmenu
|
||||
pkgs.coreutils
|
||||
pkgs.libnotify
|
||||
pkgs.imagemagick
|
||||
pkgs.xclip
|
||||
]
|
||||
}
|
||||
home-manager.users.me.xdg.configFile."sxiv/exec/key-handler".source = pkgs.writers.writeDash "key-handler" ''
|
||||
PATH=$PATH:${
|
||||
lib.makeBinPath [
|
||||
pkgs.gnused
|
||||
pkgs.gawk
|
||||
pkgs.dmenu
|
||||
pkgs.coreutils
|
||||
pkgs.libnotify
|
||||
pkgs.imagemagick
|
||||
pkgs.xclip
|
||||
]
|
||||
}
|
||||
|
||||
echo >&2 key "$1" pressed
|
||||
while read file; do
|
||||
case "$1" in
|
||||
"c")
|
||||
[ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ${important-directories} | awk '{print $2}' | dmenu -l 20 -i -p "Copy file(s) to where?" | sed "s|~|$HOME|g")"
|
||||
[ -z "$destdir" ] && exit
|
||||
[ ! -d "$destdir" ] && notify-send "$destdir is not a directory, cancelled." && exit
|
||||
cp "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file copied to $destdir." &
|
||||
;;
|
||||
"m")
|
||||
[ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ${important-directories} | awk '{print $2}' | dmenu -l 20 -i -p "Move file(s) to where?" | sed "s|~|$HOME|g")"
|
||||
[ -z "$destdir" ] && exit
|
||||
[ ! -d "$destdir" ] && notify-send "$destdir is not a directory, cancelled." && exit
|
||||
mv "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file moved to $destdir." &
|
||||
;;
|
||||
"r")
|
||||
convert -rotate 90 "$file" "$file" ;;
|
||||
"R")
|
||||
convert -rotate -90 "$file" "$file" ;;
|
||||
"f")
|
||||
convert -flop "$file" "$file" ;;
|
||||
"y")
|
||||
echo -n "$file" | xclip -selection clipboard &&
|
||||
notify-send "$file copied to clipboard" & ;;
|
||||
"Y")
|
||||
readlink -f "$file" | xclip -selection clipboard &&
|
||||
notify-send "$(readlink -f "$file") copied to clipboard" & ;;
|
||||
"d")
|
||||
[ "$(printf "No\\nYes" | dmenu -i -p "Really delete $file?")" = "Yes" ] && rm "$file" && notify-send "$file deleted." ;;
|
||||
esac
|
||||
done
|
||||
'';
|
||||
echo >&2 key "$1" pressed
|
||||
while read file; do
|
||||
case "$1" in
|
||||
"c")
|
||||
[ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ${important-directories} | awk '{print $2}' | dmenu -l 20 -i -p "Copy file(s) to where?" | sed "s|~|$HOME|g")"
|
||||
[ -z "$destdir" ] && exit
|
||||
[ ! -d "$destdir" ] && notify-send "$destdir is not a directory, cancelled." && exit
|
||||
cp "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file copied to $destdir." &
|
||||
;;
|
||||
"m")
|
||||
[ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ${important-directories} | awk '{print $2}' | dmenu -l 20 -i -p "Move file(s) to where?" | sed "s|~|$HOME|g")"
|
||||
[ -z "$destdir" ] && exit
|
||||
[ ! -d "$destdir" ] && notify-send "$destdir is not a directory, cancelled." && exit
|
||||
mv "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file moved to $destdir." &
|
||||
;;
|
||||
"r")
|
||||
convert -rotate 90 "$file" "$file" ;;
|
||||
"R")
|
||||
convert -rotate -90 "$file" "$file" ;;
|
||||
"f")
|
||||
convert -flop "$file" "$file" ;;
|
||||
"y")
|
||||
echo -n "$file" | xclip -selection clipboard &&
|
||||
notify-send "$file copied to clipboard" & ;;
|
||||
"Y")
|
||||
readlink -f "$file" | xclip -selection clipboard &&
|
||||
notify-send "$(readlink -f "$file") copied to clipboard" & ;;
|
||||
"d")
|
||||
[ "$(printf "No\\nYes" | dmenu -i -p "Really delete $file?")" = "Yes" ] && rm "$file" && notify-send "$file deleted." ;;
|
||||
esac
|
||||
done
|
||||
'';
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
'';
|
||||
in {
|
||||
niveum.telegramBots.transits = {
|
||||
enable = true;
|
||||
enable = false;
|
||||
time = "*:0/1";
|
||||
token = lib.strings.fileContents <system-secrets/telegram/kmein.token>;
|
||||
chatIds = ["-1001796440545"];
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
{pkgs, ...}: {
|
||||
services.tor.enable = true;
|
||||
services.tor.torsocks.enable = true;
|
||||
environment.systemPackages = [pkgs.tor];
|
||||
}
|
||||
|
||||
50
flake.lock
generated
50
flake.lock
generated
@@ -2,11 +2,11 @@
|
||||
"nodes": {
|
||||
"flake-utils": {
|
||||
"locked": {
|
||||
"lastModified": 1644229661,
|
||||
"narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=",
|
||||
"lastModified": 1648297722,
|
||||
"narHash": "sha256-W+qlPsiZd8F3XkzXOzAoR+mpFqzm3ekQkJNa+PIh1BQ=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797",
|
||||
"rev": "0f8662f1319ad6abf89b3380dd2722369fc51ade",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -22,11 +22,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1643933536,
|
||||
"narHash": "sha256-yRmsWAG4DnLxLIUtlaZsl0kH7rN5xSoyNRlf0YZrcH4=",
|
||||
"lastModified": 1648834319,
|
||||
"narHash": "sha256-i5Aj4Aw64D/A0X6XW5LxSS4XBnYj7gMz+kN4dpsbdk8=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "2860d7e3bb350f18f7477858f3513f9798896831",
|
||||
"rev": "0bdbdea2e26c984b096f4f7d10e3c88536a980b0",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -62,11 +62,11 @@
|
||||
"menstruation-backend": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1634573652,
|
||||
"narHash": "sha256-FIj8oCOJO+Wqxr2o5MMqIShvzMJud4iUq3o8y4NIRvw=",
|
||||
"lastModified": 1649545504,
|
||||
"narHash": "sha256-TVm3246ML7gWPeGm+bdb+Qo8o/7nve7sQ2hBdCZm3z8=",
|
||||
"owner": "kmein",
|
||||
"repo": "menstruation.rs",
|
||||
"rev": "dd405fe2acf32441e8ac56e488e689bb1c4bea82",
|
||||
"rev": "d9f3c6d53542fd7c7ed191e37cf4e342d4a47bcb",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -109,11 +109,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1646406548,
|
||||
"narHash": "sha256-xp+3f76ycZXNf9pG65Ef9KfDl1fas2UQu/cBe/pLd+c=",
|
||||
"lastModified": 1649490789,
|
||||
"narHash": "sha256-YrhVxwoofZSx/wLZ4GYET//8vS+uqWX572zvdmP/Etg=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "47cd6702934434dd02bc53a67dbce3e5493e33a2",
|
||||
"rev": "c86185d20d708013caf97a6adaa8dc6d72313c75",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -125,11 +125,11 @@
|
||||
},
|
||||
"nixpkgs-unstable": {
|
||||
"locked": {
|
||||
"lastModified": 1646523963,
|
||||
"narHash": "sha256-ixFwYnaOycrzs0iN9RvyRMEGCkQ9Pj58x6V/qc2khy8=",
|
||||
"lastModified": 1649541735,
|
||||
"narHash": "sha256-JdOywA2jcdGCxNgu0dJA7ZNtaV7sS0HwuZg9YaXd94c=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "a173e92ee458878651356b9bcfb1e2b5145f76af",
|
||||
"rev": "c2b6e029cd1efa0efd37daab89264ef040ae5669",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -158,11 +158,11 @@
|
||||
"retiolum": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1646081604,
|
||||
"narHash": "sha256-+o4I0UWPT2ZBr3oGF3vHGidfjbydkzyuFKWKDOzJo2U=",
|
||||
"lastModified": 1647444524,
|
||||
"narHash": "sha256-N4T1UXLkYJMQqk65LkTDpW70ujXXeZ9xe5k+LOpznAI=",
|
||||
"owner": "krebs",
|
||||
"repo": "retiolum",
|
||||
"rev": "259d60325310b728f79c68dc1148f597e097d1b2",
|
||||
"rev": "de6d7dc9bd671e65f2ee3004b6807625e7553e84",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -194,11 +194,11 @@
|
||||
"scripts": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1639436812,
|
||||
"narHash": "sha256-6CajvfDo7t4ANgjc7DxqH7lI3WRE4MK8q3mBKAjk80k=",
|
||||
"lastModified": 1648400983,
|
||||
"narHash": "sha256-I9ADWgUN1orbnXPBW4kulHpv8wkx6C8zsQcg9wphpPg=",
|
||||
"owner": "kmein",
|
||||
"repo": "scripts",
|
||||
"rev": "d34a8161ba11135a45d3141dc9af482db945d63c",
|
||||
"rev": "f5df67a2416d8f05a7dbfea269c44668854c7887",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -210,11 +210,11 @@
|
||||
"stockholm": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1646301205,
|
||||
"narHash": "sha256-m3eG8L0PI9Y2R2ZRF5NHfIzvRGkOL7aUIl7i+UCxUGc=",
|
||||
"lastModified": 1649089964,
|
||||
"narHash": "sha256-ybuVI8rnpMyBUoyoIXJ1e3QBMBIOoEgKTiFzIPfzy8A=",
|
||||
"ref": "master",
|
||||
"rev": "87a44dd1573cbdc8f0fc3553b0896b470bcfa44d",
|
||||
"revCount": 10431,
|
||||
"rev": "b3833baee96d7bce2c54295110b40c646468a1ff",
|
||||
"revCount": 10500,
|
||||
"type": "git",
|
||||
"url": "https://cgit.lassul.us/stockholm"
|
||||
},
|
||||
|
||||
@@ -82,6 +82,7 @@ rec {
|
||||
manakish.id = "AJVBWR2-VFFAGZF-7ZF5JAX-T63GMOG-NZ446WK-MC5E6WK-6X6Q2HE-QQA2JQ3";
|
||||
toum.id = "CBJQXFF-FMFGWFU-2J6FMPR-SRDTSGX-7NHOYOH-CQCABKF-KQJMRJC-SDE24Q4";
|
||||
zaatar.id = "CGHO6LK-ZJBAXBD-UWI7AH3-BXYARE6-EUIM7PE-O2FUCOM-VCCRNCM-IG34WQ7";
|
||||
tahina.id = "UKJ2CBO-EQPKQL4-3QLRUSG-SSYR6AB-CCCUTKU-CLPYR7N-RUI5A6Y-JTL5NA4";
|
||||
};
|
||||
|
||||
ignorePaths = [
|
||||
|
||||
@@ -18,4 +18,9 @@
|
||||
ipv4 = "10.243.2.85";
|
||||
ipv6 = "42:0:3c46:ac99:ae36:cb8:c551:ba27";
|
||||
};
|
||||
|
||||
tahina = {
|
||||
ipv4 = "10.243.2.74";
|
||||
ipv6 = "42:0:3c46:2923:1c90:872:edd6:306";
|
||||
};
|
||||
}
|
||||
|
||||
424
lib/streams.nix
424
lib/streams.nix
File diff suppressed because it is too large
Load Diff
@@ -15,14 +15,14 @@ with lib; let
|
||||
mode = "0400"; # readonly (user)
|
||||
text =
|
||||
(foldlAttrs (accum: {
|
||||
name,
|
||||
value,
|
||||
}: ''
|
||||
${accum}
|
||||
name,
|
||||
value,
|
||||
}: ''
|
||||
${accum}
|
||||
|
||||
[${name}] ${mkProfileEntry value}'')
|
||||
"# Generated by nixos-networkmanager-profiles"
|
||||
profileAttrs)
|
||||
[${name}] ${mkProfileEntry value}'')
|
||||
"# Generated by nixos-networkmanager-profiles"
|
||||
profileAttrs)
|
||||
+ "\n";
|
||||
};
|
||||
|
||||
|
||||
@@ -33,9 +33,10 @@ in {
|
||||
config = {
|
||||
services.tinc.networks.${netname} = {
|
||||
name = cfg.nodename;
|
||||
hosts = builtins.mapAttrs
|
||||
(name: _: builtins.readFile "${<retiolum/hosts>}/${name}")
|
||||
(builtins.readDir <retiolum/hosts>);
|
||||
hosts =
|
||||
builtins.mapAttrs
|
||||
(name: _: builtins.readFile "${<retiolum/hosts>}/${name}")
|
||||
(builtins.readDir <retiolum/hosts>);
|
||||
rsaPrivateKeyFile = toString <system-secrets/retiolum.key>;
|
||||
ed25519PrivateKeyFile = toString <system-secrets/retiolum.ed25519>;
|
||||
extraConfig = ''
|
||||
|
||||
@@ -14,16 +14,16 @@ with lib; let
|
||||
serviceConfig.Type = "oneshot";
|
||||
wants = ["network-online.target"];
|
||||
script = strings.concatStringsSep "\n" (["QUOTE=$(${bot.command})" "if [ -n \"$QUOTE\" ]; then"]
|
||||
++ map (chatId: ''
|
||||
${pkgs.curl}/bin/curl -s -X POST "https://api.telegram.org/bot${bot.token}/sendMessage" \
|
||||
-d chat_id="${chatId}" \
|
||||
-d text="$QUOTE" ${
|
||||
lib.strings.optionalString (bot.parseMode != null)
|
||||
"-d parse_mode=${bot.parseMode}"
|
||||
}
|
||||
'')
|
||||
bot.chatIds
|
||||
++ ["fi"]);
|
||||
++ map (chatId: ''
|
||||
${pkgs.curl}/bin/curl -s -X POST "https://api.telegram.org/bot${bot.token}/sendMessage" \
|
||||
-d chat_id="${chatId}" \
|
||||
-d text="$QUOTE" ${
|
||||
lib.strings.optionalString (bot.parseMode != null)
|
||||
"-d parse_mode=${bot.parseMode}"
|
||||
}
|
||||
'')
|
||||
bot.chatIds
|
||||
++ ["fi"]);
|
||||
};
|
||||
in {
|
||||
options.niveum.telegramBots = mkOption {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
self: super:
|
||||
with super.lib; let
|
||||
eval = import <nixpkgs/nixos/lib/eval-config.nix>;
|
||||
paths = (eval {modules = [(import <nixos-config>)];}).config.nixpkgs.overlays;
|
||||
in
|
||||
foldl' (flip extends) (_: super) paths self
|
||||
with super.lib; let
|
||||
eval = import <nixpkgs/nixos/lib/eval-config.nix>;
|
||||
paths = (eval {modules = [(import <nixos-config>)];}).config.nixpkgs.overlays;
|
||||
in
|
||||
foldl' (flip extends) (_: super) paths self
|
||||
|
||||
@@ -307,31 +307,33 @@ in
|
||||
packages = [pkgs.xdo];
|
||||
};
|
||||
|
||||
ipa = pkgs.writers.writeHaskellBin "ipa" {
|
||||
libraries = with pkgs; [haskellPackages.text haskellPackages.ipa];
|
||||
} ''
|
||||
import Data.Maybe (fromJust)
|
||||
import Language.IPA
|
||||
import qualified Data.Text as T
|
||||
import qualified Data.Text.IO as T
|
||||
main = T.interact (T.unwords . map (unIPA . fromJust . (xSampaToIpa =<<) . mkXSampa) . T.words)
|
||||
'';
|
||||
ipa =
|
||||
pkgs.writers.writeHaskellBin "ipa" {
|
||||
libraries = with pkgs; [haskellPackages.text haskellPackages.ipa];
|
||||
} ''
|
||||
import Data.Maybe (fromJust)
|
||||
import Language.IPA
|
||||
import qualified Data.Text as T
|
||||
import qualified Data.Text.IO as T
|
||||
main = T.interact (T.unwords . map (unIPA . fromJust . (xSampaToIpa =<<) . mkXSampa) . T.words)
|
||||
'';
|
||||
|
||||
default-gateway = pkgs.writers.writeDashBin "default-gateway" ''
|
||||
${pkgs.iproute}/bin/ip -json route | ${pkgs.jq}/bin/jq --raw-output '.[0].gateway'
|
||||
'';
|
||||
|
||||
betacode = pkgs.writers.writeHaskellBin "betacode" {
|
||||
libraries = with pkgs; [
|
||||
(haskell.lib.unmarkBroken (haskell.lib.doJailbreak haskellPackages.betacode))
|
||||
haskellPackages.text
|
||||
];
|
||||
} ''
|
||||
import qualified Data.Text.IO as T
|
||||
import qualified Data.Text as T
|
||||
import Text.BetaCode
|
||||
main = T.interact (either (error . T.unpack) id . fromBeta)
|
||||
'';
|
||||
betacode =
|
||||
pkgs.writers.writeHaskellBin "betacode" {
|
||||
libraries = with pkgs; [
|
||||
(haskell.lib.unmarkBroken (haskell.lib.doJailbreak haskellPackages.betacode))
|
||||
haskellPackages.text
|
||||
];
|
||||
} ''
|
||||
import qualified Data.Text.IO as T
|
||||
import qualified Data.Text as T
|
||||
import Text.BetaCode
|
||||
main = T.interact (either (error . T.unpack) id . fromBeta)
|
||||
'';
|
||||
|
||||
devanagari = pkgs.callPackage ../devanagari {};
|
||||
|
||||
@@ -447,6 +449,20 @@ in
|
||||
${pkgs.wget}/bin/wget -q -N https://github.com/Mic92/nix-index-database/releases/latest/download/$filename
|
||||
ln -f $filename files
|
||||
'';
|
||||
|
||||
rofi-hass = pkgs.writers.writeBashBin "rofi-hass" ''
|
||||
export PATH=${lib.makeBinPath [pkgs.home-assistant-cli pkgs.jq pkgs.util-linux pkgs.rofi pkgs.gnused pkgs.libnotify]}
|
||||
json=$(hass-cli -o json state list 2>/dev/null)
|
||||
idx=$(jq -r '.[] | [.entity_id, .state] | join(" ")' <<< "$json" | column -t | rofi -dmenu -i -markup-rows -format d)
|
||||
item=$(jq -r '.[].entity_id' <<< "$json" | sed "''${idx}q;d")
|
||||
itype=$(sed -r 's/\..+$//' <<< "$item")
|
||||
|
||||
case "$itype" in
|
||||
light) hass-cli state toggle "$item" &>/dev/null ;;
|
||||
scene) hass-cli service call --arguments entity_id="$item" scene.turn_on &>/dev/null ;;
|
||||
*) notify-send "Error" "Event type '$itype' not implemented yet. Do you have time to file an issue or write a PR?" ;;
|
||||
esac
|
||||
'';
|
||||
}
|
||||
// {
|
||||
devour = pkgs.callPackage <niveum/packages/devour.nix> {};
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
}: let
|
||||
streams-tsv = pkgs.fetchurl {
|
||||
url = "https://raw.githubusercontent.com/jnk22/kodinerds-iptv/master/iptv/kodi/kodi_tv.m3u";
|
||||
sha256 = "1cw1gmb16vwh6qfw0z3wjjfgn0zg2qplnddqzva5b0xx2g2appla";
|
||||
sha256 = "sha256-gbHV37Yo+D3TYfDXZyb9IX8aRsguZ3qG2SYlY8NsTL0=";
|
||||
postFetch = ''
|
||||
${pkgs.gnused}/bin/sed '/#EXTM3U/d;/#EXTINF/s/.*,//g' $out | ${pkgs.coreutils}/bin/paste -d'\t' - - > $out.tmp
|
||||
mv $out.tmp $out
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
"/mnt/sd-card" = {
|
||||
device = "/dev/disk/by-id/mmc-SD32G_0xda0aa352-part1";
|
||||
fsType = "vfat";
|
||||
options = ["nofail"];
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -7,9 +7,8 @@
|
||||
stateLocation = "/var/lib/codimd/state.sqlite";
|
||||
nixpkgs-unstable = import <nixpkgs-unstable> {};
|
||||
domain = "pad.kmein.de";
|
||||
inherit (import <niveum/lib>) tmpfilesConfig;
|
||||
in {
|
||||
imports = [<stockholm/krebs/3modules/permown.nix>];
|
||||
|
||||
services.nginx.virtualHosts.${domain} = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
@@ -49,11 +48,15 @@ in {
|
||||
};
|
||||
};
|
||||
|
||||
krebs.permown.${backupLocation} = {
|
||||
owner = "codimd";
|
||||
group = "codimd";
|
||||
umask = "0002";
|
||||
};
|
||||
systemd.tmpfiles.rules = [
|
||||
(tmpfilesConfig {
|
||||
user = "codimd";
|
||||
group = "codimd";
|
||||
mode = "0755";
|
||||
type = "d";
|
||||
path = backupLocation;
|
||||
})
|
||||
];
|
||||
|
||||
systemd.services.hedgedoc-backup = {
|
||||
description = "Hedgedoc backup service";
|
||||
|
||||
@@ -67,7 +67,7 @@ in {
|
||||
autoconnect = true;
|
||||
address = "irc.libera.chat/6697";
|
||||
ssl = true;
|
||||
autojoin = ["#flipdot" "#haskell" "#nixos" "#fysi" "#binaergewitter" "#neovim" "#lojban" "#vim" "#newsboat" ];
|
||||
autojoin = ["#flipdot" "#haskell" "#nixos" "#fysi" "#binaergewitter" "#neovim" "#lojban" "#vim" "#newsboat"];
|
||||
sasl_mechanism = "plain";
|
||||
sasl_username = nick;
|
||||
sasl_password = lib.strings.fileContents <system-secrets/irc/libera>;
|
||||
@@ -143,6 +143,11 @@ in {
|
||||
tags = ["nick_gitlab"];
|
||||
regex = "*";
|
||||
};
|
||||
people = {
|
||||
buffer = "irc.*.*";
|
||||
tags = map (name: "nick_${name}") ["mod_p[matrix-fli"];
|
||||
regex = "*";
|
||||
};
|
||||
};
|
||||
};
|
||||
extraCommands = ''/matrix connect nibbana'';
|
||||
|
||||
68
systems/tahina/configuration.nix
Normal file
68
systems/tahina/configuration.nix
Normal file
@@ -0,0 +1,68 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (import <niveum/lib>) retiolumAddresses;
|
||||
in {
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
<niveum/configs/battery.nix>
|
||||
<niveum/configs/spacetime.nix>
|
||||
<niveum/modules/retiolum.nix>
|
||||
<niveum/configs/sshd.nix>
|
||||
];
|
||||
|
||||
nix.nixPath = ["/var/src"];
|
||||
|
||||
console.keyMap = "de";
|
||||
i18n.defaultLocale = "de_DE.UTF-8";
|
||||
services.xserver = {
|
||||
layout = "de";
|
||||
libinput.enable = true;
|
||||
};
|
||||
|
||||
users.users.xenos = {
|
||||
name = "xenos";
|
||||
password = "xenos";
|
||||
isNormalUser = true;
|
||||
extraGroups = ["networkmanager"];
|
||||
};
|
||||
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
desktopManager.pantheon.enable = true;
|
||||
displayManager = {
|
||||
lightdm = {
|
||||
enable = true;
|
||||
greeters.pantheon.enable = true;
|
||||
};
|
||||
autoLogin = {
|
||||
enable = true;
|
||||
user = "xenos";
|
||||
};
|
||||
};
|
||||
};
|
||||
boot.plymouth.enable = true;
|
||||
|
||||
environment.systemPackages = [
|
||||
pkgs.libreoffice
|
||||
pkgs.gimp
|
||||
pkgs.inkscape
|
||||
pkgs.firefox
|
||||
pkgs.audacity
|
||||
pkgs.pidgin
|
||||
];
|
||||
|
||||
networking = {
|
||||
useDHCP = false;
|
||||
interfaces = {
|
||||
enp0s25.useDHCP = true;
|
||||
wlo1.useDHCP = true;
|
||||
};
|
||||
retiolum = retiolumAddresses.tahina;
|
||||
hostName = "tahina";
|
||||
};
|
||||
|
||||
system.stateVersion = "21.11";
|
||||
}
|
||||
48
systems/tahina/hardware-configuration.nix
Normal file
48
systems/tahina/hardware-configuration.nix
Normal file
@@ -0,0 +1,48 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
modulesPath,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot = {
|
||||
loader = {
|
||||
systemd-boot = {
|
||||
enable = true;
|
||||
consoleMode = "max";
|
||||
};
|
||||
efi.canTouchEfiVariables = true;
|
||||
};
|
||||
initrd = {
|
||||
availableKernelModules = ["xhci_pci" "ehci_pci" "ahci" "firewire_ohci" "usb_storage" "sd_mod" "sr_mod" "sdhci_pci"];
|
||||
kernelModules = ["dm-snapshot"];
|
||||
luks.devices.luksmap.device = "/dev/disk/by-uuid/b7d66981-8cb7-4aad-a595-ee6574b312cf";
|
||||
};
|
||||
kernelModules = ["kvm-intel"];
|
||||
extraModulePackages = [];
|
||||
};
|
||||
|
||||
fileSystems = {
|
||||
"/" = {
|
||||
device = "/dev/disk/by-uuid/e9a8bd34-61eb-4317-888d-bd7d6248a906";
|
||||
fsType = "xfs";
|
||||
};
|
||||
"/boot" = {
|
||||
device = "/dev/disk/by-uuid/9B2F-31E1";
|
||||
fsType = "vfat";
|
||||
};
|
||||
};
|
||||
|
||||
swapDevices = [
|
||||
{
|
||||
device = "/swapfile";
|
||||
size = 2048;
|
||||
}
|
||||
];
|
||||
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
@@ -15,6 +15,7 @@ in {
|
||||
./pulseaudio.nix
|
||||
./home-assistant.nix
|
||||
./tuna.nix
|
||||
./mympd.nix
|
||||
./grocy.nix
|
||||
./spotifyd.nix
|
||||
<home-manager/nixos>
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
{
|
||||
networking.firewall.allowedTCPPorts = [8123];
|
||||
let
|
||||
port = 8123;
|
||||
in {
|
||||
networking.firewall.allowedTCPPorts = [port];
|
||||
|
||||
services.nginx.virtualHosts."home.kmein.r" = {
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:${toString port}";
|
||||
};
|
||||
};
|
||||
|
||||
virtualisation.oci-containers = {
|
||||
backend = "podman";
|
||||
|
||||
57
systems/zaatar/mympd.nix
Normal file
57
systems/zaatar/mympd.nix
Normal file
@@ -0,0 +1,57 @@
|
||||
{pkgs, ...}: let
|
||||
inherit (import <niveum/lib>) tmpfilesConfig;
|
||||
in {
|
||||
systemd.tmpfiles.rules = [
|
||||
(tmpfilesConfig {
|
||||
type = "d";
|
||||
mode = "0755";
|
||||
user = "mympd";
|
||||
group = "mympd";
|
||||
path = "/var/lib/mympd";
|
||||
})
|
||||
(tmpfilesConfig {
|
||||
type = "d";
|
||||
mode = "0755";
|
||||
user = "mympd";
|
||||
group = "mympd";
|
||||
age = "1d";
|
||||
path = "/var/cache/mympd";
|
||||
})
|
||||
(tmpfilesConfig {
|
||||
type = "L+";
|
||||
mode = "0644";
|
||||
user = "mympd";
|
||||
group = "mympd";
|
||||
path = "/var/lib/mympd/config/http_port";
|
||||
argument = pkgs.writeText "port" "8764";
|
||||
})
|
||||
(tmpfilesConfig {
|
||||
type = "L+";
|
||||
mode = "0644";
|
||||
user = "mympd";
|
||||
group = "mympd";
|
||||
path = "/var/lib/mympd/config/ssl";
|
||||
argument = pkgs.writeText "ssl" "false";
|
||||
})
|
||||
];
|
||||
|
||||
users.users.mympd = {
|
||||
isSystemUser = true;
|
||||
group = "mympd";
|
||||
};
|
||||
users.groups.mympd = {};
|
||||
|
||||
systemd.services.mympd = {
|
||||
wantedBy = ["multi-user.target"];
|
||||
after = ["mpd.service"];
|
||||
script = "${pkgs.mympd}/bin/mympd";
|
||||
environment = {
|
||||
MYMPD_HTTP_PORT = "8764";
|
||||
};
|
||||
serviceConfig = {
|
||||
Restart = "always";
|
||||
User = "mympd";
|
||||
Group = "mympd";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -5,6 +5,7 @@
|
||||
...
|
||||
}: let
|
||||
firewall = (import <niveum/lib>).firewall lib;
|
||||
inherit (import <niveum/lib>) tmpfilesConfig;
|
||||
|
||||
streams = import <niveum/lib/streams.nix> {
|
||||
di-fm-key = lib.strings.fileContents <secrets/di.fm/key>;
|
||||
@@ -71,13 +72,31 @@ in {
|
||||
extraStopCommands = firewall.removeRules rules;
|
||||
};
|
||||
|
||||
system.activationScripts.mpd-playlists = let
|
||||
playlistFile = pkgs.writeText "radio.m3u" (lib.concatMapStringsSep "\n" (lib.getAttr "stream") streams);
|
||||
in ''
|
||||
rm -rf /var/lib/mpd/playlists
|
||||
install -d /var/lib/mpd/playlists
|
||||
ln -sfn "${toString playlistFile}" "/var/lib/mpd/playlists/radio.m3u"
|
||||
'';
|
||||
systemd.tmpfiles.rules = let
|
||||
tags = lib.lists.unique (lib.concatMap ({tags ? [], ...}: tags) streams);
|
||||
tagStreams = tag: lib.filter ({tags ? [], ...}: lib.elem tag tags) streams;
|
||||
makePlaylist = name: streams: pkgs.writeText "${name}.m3u" (lib.concatMapStringsSep "\n" (lib.getAttr "stream") streams);
|
||||
in
|
||||
map (tag:
|
||||
tmpfilesConfig {
|
||||
type = "L+";
|
||||
path = "/var/lib/mpd/playlists/${tag}.m3u";
|
||||
mode = "0644";
|
||||
user = "mpd";
|
||||
group = "mpd";
|
||||
argument = makePlaylist tag (tagStreams tag);
|
||||
})
|
||||
tags
|
||||
++ [
|
||||
(tmpfilesConfig {
|
||||
type = "L+";
|
||||
mode = "0644";
|
||||
user = "mpd";
|
||||
group = "mpd";
|
||||
path = "/var/lib/mpd/playlist/all.m3u";
|
||||
argument = makePlaylist "all" streams;
|
||||
})
|
||||
];
|
||||
|
||||
services.tuna = {
|
||||
enable = true;
|
||||
@@ -87,33 +106,15 @@ in {
|
||||
logo ? "https://picsum.photos/seed/${builtins.hashString "md5" stream}/300",
|
||||
stream,
|
||||
station,
|
||||
...
|
||||
}: {inherit id desc logo stream station;})
|
||||
streams;
|
||||
webPort = 8080;
|
||||
webPort = 7044;
|
||||
};
|
||||
|
||||
systemd.services.tuna-stations = let
|
||||
stations = lib.lists.imap0 (id: {
|
||||
desc ? "",
|
||||
logo ? "https://picsum.photos/seed/${builtins.hashString "md5" stream}/300",
|
||||
stream,
|
||||
station,
|
||||
}: {inherit id desc logo stream station;})
|
||||
streams;
|
||||
stationsJson = (pkgs.formats.json {}).generate "stations.json" stations;
|
||||
in {
|
||||
enable = false;
|
||||
wantedBy = ["tuna.service"];
|
||||
startAt = "hourly";
|
||||
script = ''
|
||||
mkdir -p /etc/tuna
|
||||
antenne_asb_url=$(
|
||||
${pkgs.curl}/bin/curl -sS 'https://www.caster.fm/widgets/em_player.php?jsinit=true&uid=529295&t=blue&c=' \
|
||||
| grep streamUrl \
|
||||
| sed ${lib.escapeShellArg "s/^.*'\\([^']*\\)'.*/\\1/"}
|
||||
)
|
||||
${pkgs.jq}/bin/jq "map(if .station == \"Antenne ASB\" then .stream |= \"$antenne_asb_url\" else . end)" < ${stationsJson} > /etc/tuna/stations.json
|
||||
'';
|
||||
services.ympd = {
|
||||
enable = true;
|
||||
mpd.port = config.services.mpd.network.port;
|
||||
};
|
||||
|
||||
services.nginx = {
|
||||
@@ -125,7 +126,7 @@ in {
|
||||
virtualHosts."radio.kmein.r" = {
|
||||
basicAuth.dj = password;
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:${toString config.services.tuna.webPort}";
|
||||
proxyPass = "http://127.0.0.1:${config.services.ympd.webPort}";
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user