add cache
This commit is contained in:
parent
085db7bbd6
commit
725c40dd2e
3 changed files with 58 additions and 57 deletions
|
|
@ -2,6 +2,7 @@
|
|||
{
|
||||
services.dnsproxy = {
|
||||
enable = true;
|
||||
flags = [ "--cache" ];
|
||||
settings = rec {
|
||||
upstream = [ "https://base.dns.mullvad.net/dns-query" ];
|
||||
listen-addrs = [ "127.0.0.1" ];
|
||||
|
|
|
|||
|
|
@ -1,40 +1,40 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
environment.systemPackages = [
|
||||
(pkgs.writeShellApplication {
|
||||
name = "book";
|
||||
runtimeInputs = with pkgs; [
|
||||
libgourou
|
||||
calibre
|
||||
];
|
||||
text = ''
|
||||
input="$1"
|
||||
# environment.systemPackages = [
|
||||
# (pkgs.writeShellApplication {
|
||||
# name = "book";
|
||||
# runtimeInputs = with pkgs; [
|
||||
# libgourou
|
||||
# calibre
|
||||
# ];
|
||||
# text = ''
|
||||
# input="$1"
|
||||
|
||||
if [ -f "$input" ] && echo "$input" | grep -qi "\.epub$"; then
|
||||
fullpath="$input"
|
||||
else
|
||||
if [ ! -d "$HOME/.config/adept" ]; then
|
||||
adept_activate --anonymous
|
||||
fi
|
||||
# if [ -f "$input" ] && echo "$input" | grep -qi "\.epub$"; then
|
||||
# fullpath="$input"
|
||||
# else
|
||||
# if [ ! -d "$HOME/.config/adept" ]; then
|
||||
# adept_activate --anonymous
|
||||
# fi
|
||||
|
||||
fullpath=$(acsmdownloader --output-dir /tmp "$input" \
|
||||
| tee /dev/tty \
|
||||
| grep "^Created " \
|
||||
| sed "s/^Created //")
|
||||
# fullpath=$(acsmdownloader --output-dir /tmp "$input" \
|
||||
# | tee /dev/tty \
|
||||
# | grep "^Created " \
|
||||
# | sed "s/^Created //")
|
||||
|
||||
adept_remove "$fullpath"
|
||||
fi
|
||||
# adept_remove "$fullpath"
|
||||
# fi
|
||||
|
||||
name=$(basename "$fullpath" | rev | cut -d. -f2- | rev)
|
||||
ext=$(echo "$fullpath" | rev | cut -d. -f1 | rev)
|
||||
# name=$(basename "$fullpath" | rev | cut -d. -f2- | rev)
|
||||
# ext=$(echo "$fullpath" | rev | cut -d. -f1 | rev)
|
||||
|
||||
if [ "$ext" = "epub" ]; then
|
||||
ebook-convert "$fullpath" "/run/media/quadradical/Kindle/documents/$name.mobi"
|
||||
rm "$fullpath"
|
||||
else
|
||||
mv "$fullpath" "/run/media/quadradical/Kindle/documents/$name.pdf"
|
||||
fi
|
||||
'';
|
||||
})
|
||||
];
|
||||
# if [ "$ext" = "epub" ]; then
|
||||
# ebook-convert "$fullpath" "/run/media/quadradical/Kindle/documents/$name.mobi"
|
||||
# rm "$fullpath"
|
||||
# else
|
||||
# mv "$fullpath" "/run/media/quadradical/Kindle/documents/$name.pdf"
|
||||
# fi
|
||||
# '';
|
||||
# })
|
||||
# ];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue