migrated many of my scripts, and minor pack adjstm

This commit is contained in:
Danilo Reyes 2023-08-20 03:01:27 -06:00
parent a178298564
commit c25dfd3916
2 changed files with 118 additions and 85 deletions

View File

@ -19,16 +19,23 @@ let
unstable = import unstable_tarball { config = config.nixpkgs.config; };
nix-gaming = import (builtins.fetchTarball
"https://github.com/fufexan/nix-gaming/archive/master.tar.gz");
nextcloud_scrapsync = pkgs.writeScriptBin "nextcloud_scrapsync"
jawz_nextcloud_scrapsync = pkgs.writeScriptBin "nextcloud_scrapsync"
(builtins.readFile ./scripts/nextcloud_scrapsync.sh);
manage_library = pkgs.writeScriptBin "manage_library"
jawz_manage_library = pkgs.writeScriptBin "manage_library"
(builtins.readFile ./scripts/manage_library.sh);
ffmpreg =
jawz_ffmpreg =
pkgs.writeScriptBin "ffmpreg" (builtins.readFile ./scripts/ffmpreg.sh);
ffmpeg4discord = pkgs.writeScriptBin "ffmpeg4discord"
jawz_ffmpeg4discord = pkgs.writeScriptBin "ffmpeg4discord"
(builtins.readFile ./scripts/ffmpeg4discord.py);
chat-dl =
jawz_chat-dl =
pkgs.writeScriptBin "chat-dl" (builtins.readFile ./scripts/chat-dl.sh);
jawz_tasks =
pkgs.writeScriptBin "tasks" (builtins.readFile ./scripts/tasks.sh);
jawz_split_dir =
pkgs.writeScriptBin "split_dir" (builtins.readFile ./scripts/split_dir.sh);
jawz_pika_list =
pkgs.writeScriptBin "pika_list" (builtins.readFile ./scripts/pika_list.sh);
jawz_run = pkgs.writeScriptBin "run" (builtins.readFile ./scripts/run.sh);
in { # Remember to close this bracket at the end of the document
imports = [
@ -150,7 +157,7 @@ in { # Remember to close this bracket at the end of the document
vulkan-tools
# nix-gaming.packages.${pkgs.hostPlatform.system}.wine-tkg
winetricks
nix-gaming.packages.${pkgs.hostPlatform.system}.wine-discord-ipc-bridge
# nix-gaming.packages.${pkgs.hostPlatform.system}.wine-discord-ipc-bridge
# grapejuice # roblox manager
# minecraft # minecraft official launcher
parsec-bin # remote gaming with friends
@ -160,7 +167,7 @@ in { # Remember to close this bracket at the end of the document
libreoffice-fresh # office, but based
calibre # ugly af eBook library manager
foliate # gtk eBook reader
gnome-feeds # feed reader, maybe will replace with nextcloud
newsflash # feed reader, syncs with nextcloud
wike # gtk wikipedia wow!
unstable.furtherance # I made this one tehee track time utility
gnome.simple-scan # scanner
@ -222,11 +229,14 @@ in { # Remember to close this bracket at the end of the document
lm_sensors # for extension, displays cpu temp
# My own scripts
nextcloud_scrapsync
ffmpeg4discord
ffmpreg
manage_library
chat-dl
jawz_ffmpeg4discord
jawz_ffmpreg
jawz_manage_library
jawz_chat-dl
jawz_tasks
jawz_split_dir
jawz_pika_list
jawz_run
# required by doom emacs, but still are rather useful.
fd # modern find, faster searches
@ -248,7 +258,7 @@ in { # Remember to close this bracket at the end of the document
shellcheck # linting
shfmt # a shell parser and formatter
file # required by my tasks script?
gnome.zenity # dependency of my scripts
# gnome.zenity # dependency of my scripts
xclip # manipulate clipboard from scripts
# NIX
@ -312,17 +322,6 @@ in { # Remember to close this bracket at the end of the document
buildInputs = [ setuptools ];
propagatedBuildInputs = [ pyyaml types-pyyaml ];
})
(buildPythonApplication rec {
pname = "classifier";
version = "2.0";
src = fetchPypi {
inherit pname version;
sha256 = "sha256-yHtc0qNZbKIkhhxrh0Zh5KWWsC/aU51WX1oEPVN9nOg=";
};
doCheck = false;
buildInputs = [ setuptools ];
propagatedBuildInputs = [ arrow ];
})
(buildPythonApplication rec {
pname = "ffpb";
version = "0.4.1";
@ -383,8 +382,8 @@ in { # Remember to close this bracket at the end of the document
ls =
"exa --icons --group-directories-first --no-permissions --no-user --no-time";
edit = "emacsclient -t";
comic = "download -u jawz -i $(cat $lc | fzf --multi --exact -i)";
gallery = "download -u jawz -i $(cat $lw | fzf --multi --exact -i)";
comic = "download -u jawz -i $(cat $LC | fzf --multi --exact -i)";
gallery = "download -u jawz -i $(cat $LW | fzf --multi --exact -i)";
open_gallery = ''
cd /mnt/disk2/scrapping/JawZ/gallery-dl && nautilus
"$(fd . ./ Husbands -tdirectory -d 1 | fzf -i)"'';
@ -413,9 +412,9 @@ in { # Remember to close this bracket at the end of the document
/home/jawz/.local/bin/pokemon-colorscripts -r --no-title
# Lists
list_root=${config.home.homeDirectory}/.config/jawz/lists/jawz
export lw=$list_root/watch.txt
export li=$list_root/instant.txt
export lc=$list_root/comic.txt
export LW=$list_root/watch.txt
export LI=$list_root/instant.txt
export LC=$list_root/comic.txt
export command_timeout=30
# GPG_TTY=$(tty)
@ -569,7 +568,7 @@ in { # Remember to close this bracket at the end of the document
};
parityFiles = [ "/mnt/parity/snapraid.parity" ];
extraConfig = ''
autosave 50
autosave 5000
'';
exclude = [
"/tmp/"
@ -639,14 +638,6 @@ in { # Remember to close this bracket at the end of the document
defaultEditor = true;
package = pkgs.emacs;
};
# udev = {
# packages = with pkgs; [ gnome.gnome-settings-daemon ];
# extraRules = ''
# SUBSYSTEM=="hidraw", ATTRS{idVendor}=="256c", ATTRS{idProduct}=="006d", MODE="0666"
# SUBSYSTEM=="usb", ATTRS{idVendor}=="256c", ATTRS{idProduct}=="006d", MODE="0666"
# SUBSYSTEM=="input", ATTRS{idVendor}=="256c", ATTRS{idProduct}=="006d", ENV{LIBINPUT_IGNORE_DEVICE}="1"
# '';
# };
};
systemd.services = {
@ -672,10 +663,10 @@ in { # Remember to close this bracket at the end of the document
"nextcloud_scrapsync" = {
description = "Sync scrapped files with nextcloud";
wantedBy = [ "default.target" ];
path = [ pkgs.bash nextcloud_scrapsync ];
path = [ pkgs.bash jawz_nextcloud_scrapsync ];
serviceConfig = {
RestartSec = 30;
ExecStart = "${nextcloud_scrapsync}/bin/nextcloud_scrapsync";
ExecStart = "${jawz_nextcloud_scrapsync}/bin/nextcloud_scrapsync";
};
};
};
@ -715,11 +706,34 @@ in { # Remember to close this bracket at the end of the document
restartIfChanged = true;
description = "Run the manage library bash script";
wantedBy = [ "default.target" ];
path = [ pkgs.bash manage_library ];
path = [ pkgs.bash pkgs.nix jawz_manage_library ];
serviceConfig = {
Restart = "on-failure";
RestartSec = 30;
ExecStart = "${manage_library}/bin/manage_library";
ExecStart = "${jawz_manage_library}/bin/manage_library";
};
};
"tasks" = {
restartIfChanged = true;
description = "Run a tasks script which keeps a lot of things organized";
wantedBy = [ "default.target" ];
path = [ pkgs.bash pkgs.nix jawz_tasks ];
serviceConfig = {
Restart = "on-failure";
RestartSec = 30;
ExecStart = "${jawz_tasks}/bin/tasks";
};
};
};
systemd.user.timers = {
"tasks" = {
enable = true;
description = "Run a tasks script which keeps a lot of things organized";
wantedBy = [ "timers.target" ];
timerConfig = {
OnBootSec = "1min";
OnUnitActivateSec = "5m";
Persistent = true;
};
};
};

View File

@ -56,16 +56,24 @@ let
config = config.nixpkgs.config;
};
nix-gaming = import (builtins.fetchTarball "https://github.com/fufexan/nix-gaming/archive/master.tar.gz");
nextcloud_scrapsync = pkgs.writeScriptBin
jawz_nextcloud_scrapsync = pkgs.writeScriptBin
"nextcloud_scrapsync" (builtins.readFile ./scripts/nextcloud_scrapsync.sh);
manage_library = pkgs.writeScriptBin
jawz_manage_library = pkgs.writeScriptBin
"manage_library" (builtins.readFile ./scripts/manage_library.sh);
ffmpreg = pkgs.writeScriptBin
jawz_ffmpreg = pkgs.writeScriptBin
"ffmpreg" (builtins.readFile ./scripts/ffmpreg.sh);
ffmpeg4discord = pkgs.writeScriptBin
jawz_ffmpeg4discord = pkgs.writeScriptBin
"ffmpeg4discord" (builtins.readFile ./scripts/ffmpeg4discord.py);
chat-dl = pkgs.writeScriptBin
jawz_chat-dl = pkgs.writeScriptBin
"chat-dl" (builtins.readFile ./scripts/chat-dl.sh);
jawz_tasks = pkgs.writeScriptBin
"tasks" (builtins.readFile ./scripts/tasks.sh);
jawz_split_dir = pkgs.writeScriptBin
"split_dir" (builtins.readFile ./scripts/split_dir.sh);
jawz_pika_list = pkgs.writeScriptBin
"pika_list" (builtins.readFile ./scripts/pika_list.sh);
jawz_run = pkgs.writeScriptBin
"run" (builtins.readFile ./scripts/run.sh);
in
{ # Remember to close this bracket at the end of the document
#+end_src
@ -290,7 +298,7 @@ wineWowPackages.full
vulkan-tools
# nix-gaming.packages.${pkgs.hostPlatform.system}.wine-tkg
winetricks
nix-gaming.packages.${pkgs.hostPlatform.system}.wine-discord-ipc-bridge
# nix-gaming.packages.${pkgs.hostPlatform.system}.wine-discord-ipc-bridge
# grapejuice # roblox manager
# minecraft # minecraft official launcher
parsec-bin # remote gaming with friends
@ -306,7 +314,7 @@ this are not used as often as I wish…
libreoffice-fresh # office, but based
calibre # ugly af eBook library manager
foliate # gtk eBook reader
gnome-feeds # feed reader, maybe will replace with nextcloud
newsflash # feed reader, syncs with nextcloud
wike # gtk wikipedia wow!
unstable.furtherance # I made this one tehee track time utility
gnome.simple-scan # scanner
@ -391,11 +399,14 @@ torrenttools # create torrent files from the terminal!
lm_sensors # for extension, displays cpu temp
# My own scripts
nextcloud_scrapsync
ffmpeg4discord
ffmpreg
manage_library
chat-dl
jawz_ffmpeg4discord
jawz_ffmpreg
jawz_manage_library
jawz_chat-dl
jawz_tasks
jawz_split_dir
jawz_pika_list
jawz_run
#+end_src
** DEVELOPMENT PACKAGES
@ -421,7 +432,7 @@ bashdb # autocomplete
shellcheck # linting
shfmt # a shell parser and formatter
file # required by my tasks script?
gnome.zenity # dependency of my scripts
# gnome.zenity # dependency of my scripts
xclip # manipulate clipboard from scripts
# NIX
@ -496,18 +507,6 @@ symbola
propagatedBuildInputs =
[ pyyaml types-pyyaml ];
})
(buildPythonApplication rec {
pname = "classifier";
version = "2.0";
src = fetchPypi {
inherit pname version;
sha256 = "sha256-yHtc0qNZbKIkhhxrh0Zh5KWWsC/aU51WX1oEPVN9nOg=";
};
doCheck = false;
buildInputs = [ setuptools ];
propagatedBuildInputs =
[ arrow ];
})
(buildPythonApplication rec {
pname = "ffpb";
version = "0.4.1";
@ -606,8 +605,8 @@ programs.bash = {
shellAliases = {
ls = "exa --icons --group-directories-first --no-permissions --no-user --no-time";
edit = "emacsclient -t";
comic = "download -u jawz -i $(cat $lc | fzf --multi --exact -i)";
gallery = "download -u jawz -i $(cat $lw | fzf --multi --exact -i)";
comic = "download -u jawz -i $(cat $LC | fzf --multi --exact -i)";
gallery = "download -u jawz -i $(cat $LW | fzf --multi --exact -i)";
open_gallery = "cd /mnt/disk2/scrapping/JawZ/gallery-dl && nautilus \
\"$(fd . ./ Husbands -tdirectory -d 1 | fzf -i)\"";
unique_extensions = "fd -tf | rev | cut -d. -f1 | rev | tr '[:upper:]' '[:lower:]' | sort | uniq --count | sort -rn";
@ -636,9 +635,9 @@ programs.bash = {
/home/jawz/.local/bin/pokemon-colorscripts -r --no-title
# Lists
list_root=${config.home.homeDirectory}/.config/jawz/lists/jawz
export lw=$list_root/watch.txt
export li=$list_root/instant.txt
export lc=$list_root/comic.txt
export LW=$list_root/watch.txt
export LI=$list_root/instant.txt
export LC=$list_root/comic.txt
export command_timeout=30
# GPG_TTY=$(tty)
@ -834,7 +833,7 @@ snapraid = {
"/mnt/parity/snapraid.parity"
];
extraConfig = ''
autosave 50
autosave 5000
'';
exclude = [
"/tmp/"
@ -918,14 +917,6 @@ services = {
defaultEditor = true;
package = pkgs.emacs;
};
# udev = {
# packages = with pkgs; [ gnome.gnome-settings-daemon ];
# extraRules = ''
# SUBSYSTEM=="hidraw", ATTRS{idVendor}=="256c", ATTRS{idProduct}=="006d", MODE="0666"
# SUBSYSTEM=="usb", ATTRS{idVendor}=="256c", ATTRS{idProduct}=="006d", MODE="0666"
# SUBSYSTEM=="input", ATTRS{idVendor}=="256c", ATTRS{idProduct}=="006d", ENV{LIBINPUT_IGNORE_DEVICE}="1"
# '';
# };
};
#+end_src
@ -960,11 +951,11 @@ systemd.services = {
wantedBy = [ "default.target" ];
path = [
pkgs.bash
nextcloud_scrapsync
jawz_nextcloud_scrapsync
];
serviceConfig = {
RestartSec = 30;
ExecStart = "${nextcloud_scrapsync}/bin/nextcloud_scrapsync";
ExecStart = "${jawz_nextcloud_scrapsync}/bin/nextcloud_scrapsync";
};
};
};
@ -1008,12 +999,40 @@ systemd.user.services = {
wantedBy = [ "default.target" ];
path = [
pkgs.bash
manage_library
pkgs.nix
jawz_manage_library
];
serviceConfig = {
Restart = "on-failure";
RestartSec = 30;
ExecStart = "${manage_library}/bin/manage_library";
ExecStart = "${jawz_manage_library}/bin/manage_library";
};
};
"tasks" = {
restartIfChanged = true;
description = "Run a tasks script which keeps a lot of things organized";
wantedBy = [ "default.target" ];
path = [
pkgs.bash
pkgs.nix
jawz_tasks
];
serviceConfig = {
Restart = "on-failure";
RestartSec = 30;
ExecStart = "${jawz_tasks}/bin/tasks";
};
};
};
systemd.user.timers = {
"tasks" = {
enable = true;
description = "Run a tasks script which keeps a lot of things organized";
wantedBy = [ "timers.target" ];
timerConfig = {
OnBootSec = "1min";
OnUnitActivateSec = "5m";
Persistent = true;
};
};
};